Blame 0171-iscsi-parse-iscsiroot.sh-reload-udev-rules.patch

Harald Hoyer bb31e7
From 602dce9ff2f865038e8e6c618a24b04157809026 Mon Sep 17 00:00:00 2001
Harald Hoyer bb31e7
From: Harald Hoyer <harald@redhat.com>
Harald Hoyer bb31e7
Date: Fri, 13 Nov 2015 16:37:48 +0100
Harald Hoyer bb31e7
Subject: [PATCH] iscsi/parse-iscsiroot.sh: reload udev rules
Harald Hoyer bb31e7
Harald Hoyer bb31e7
in the DHCP case udev is already running, so reload the rules before
Harald Hoyer bb31e7
continuing.
Harald Hoyer bb31e7
---
Harald Hoyer bb31e7
 modules.d/95iscsi/parse-iscsiroot.sh | 8 ++++++++
Harald Hoyer bb31e7
 1 file changed, 8 insertions(+)
Harald Hoyer bb31e7
Harald Hoyer bb31e7
diff --git a/modules.d/95iscsi/parse-iscsiroot.sh b/modules.d/95iscsi/parse-iscsiroot.sh
Harald Hoyer bb31e7
index 1d62b03..43b2e08 100755
Harald Hoyer bb31e7
--- a/modules.d/95iscsi/parse-iscsiroot.sh
Harald Hoyer bb31e7
+++ b/modules.d/95iscsi/parse-iscsiroot.sh
Harald Hoyer bb31e7
@@ -41,6 +41,7 @@ if [ "${root%%:*}" = "iscsi" ] ; then
Harald Hoyer bb31e7
     netroot=$root
Harald Hoyer bb31e7
     # if root is not specified try to mount the whole iSCSI LUN
Harald Hoyer bb31e7
     printf 'ENV{DEVTYPE}!="partition", SYMLINK=="disk/by-path/*-iscsi-*-*", SYMLINK+="root"\n' >> /etc/udev/rules.d/99-iscsi-root.rules
Harald Hoyer bb31e7
+    [ -n "$DRACUT_SYSTEMD" ] && systemctl is-active systemd-udevd && udevadm control --reload-rules
Harald Hoyer bb31e7
     root=/dev/root
Harald Hoyer bb31e7
 
Harald Hoyer bb31e7
     write_fs_tab /dev/root
Harald Hoyer bb31e7
@@ -53,6 +54,13 @@ for nroot in $(getargs netroot); do
Harald Hoyer bb31e7
     break
Harald Hoyer bb31e7
 done
Harald Hoyer bb31e7
 
Harald Hoyer bb31e7
+# Root takes precedence over netroot
Harald Hoyer bb31e7
+if [ "${root}" = "/dev/root" ] && getarg "netroot=dhcp" ; then
Harald Hoyer bb31e7
+    # if root is not specified try to mount the whole iSCSI LUN
Harald Hoyer bb31e7
+    printf 'ENV{DEVTYPE}!="partition", SYMLINK=="disk/by-path/*-iscsi-*-*", SYMLINK+="root"\n' >> /etc/udev/rules.d/99-iscsi-root.rules
Harald Hoyer bb31e7
+    [ -n "$DRACUT_SYSTEMD" ] && systemctl is-active systemd-udevd && udevadm control --reload-rules
Harald Hoyer bb31e7
+fi
Harald Hoyer bb31e7
+
Harald Hoyer bb31e7
 if [ -n "$iscsiroot" ] ; then
Harald Hoyer bb31e7
     [ -z "$netroot" ]  && netroot=$root
Harald Hoyer bb31e7