]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
iscsi/parse-iscsiroot.sh: reload udev rules
authorHarald Hoyer <harald@redhat.com>
Fri, 13 Nov 2015 15:37:48 +0000 (16:37 +0100)
committerHarald Hoyer <harald@redhat.com>
Fri, 13 Nov 2015 15:37:48 +0000 (16:37 +0100)
in the DHCP case udev is already running, so reload the rules before
continuing.

modules.d/95iscsi/parse-iscsiroot.sh

index 1d62b03ea02bd3d80ceb531f3ec9f1c35c8f0b11..43b2e088d521e16f767bb8b049f0465621d94518 100755 (executable)
@@ -41,6 +41,7 @@ if [ "${root%%:*}" = "iscsi" ] ; then
     netroot=$root
     # if root is not specified try to mount the whole iSCSI LUN
     printf 'ENV{DEVTYPE}!="partition", SYMLINK=="disk/by-path/*-iscsi-*-*", SYMLINK+="root"\n' >> /etc/udev/rules.d/99-iscsi-root.rules
+    [ -n "$DRACUT_SYSTEMD" ] && systemctl is-active systemd-udevd && udevadm control --reload-rules
     root=/dev/root
 
     write_fs_tab /dev/root
@@ -53,6 +54,13 @@ for nroot in $(getargs netroot); do
     break
 done
 
+# Root takes precedence over netroot
+if [ "${root}" = "/dev/root" ] && getarg "netroot=dhcp" ; then
+    # if root is not specified try to mount the whole iSCSI LUN
+    printf 'ENV{DEVTYPE}!="partition", SYMLINK=="disk/by-path/*-iscsi-*-*", SYMLINK+="root"\n' >> /etc/udev/rules.d/99-iscsi-root.rules
+    [ -n "$DRACUT_SYSTEMD" ] && systemctl is-active systemd-udevd && udevadm control --reload-rules
+fi
+
 if [ -n "$iscsiroot" ] ; then
     [ -z "$netroot" ]  && netroot=$root