From: Harald Hoyer Date: Fri, 13 Nov 2015 15:37:48 +0000 (+0100) Subject: iscsi/parse-iscsiroot.sh: reload udev rules X-Git-Tag: 044~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=602dce9ff2f865038e8e6c618a24b04157809026;p=thirdparty%2Fdracut.git iscsi/parse-iscsiroot.sh: reload udev rules in the DHCP case udev is already running, so reload the rules before continuing. --- diff --git a/modules.d/95iscsi/parse-iscsiroot.sh b/modules.d/95iscsi/parse-iscsiroot.sh index 1d62b03ea..43b2e088d 100755 --- a/modules.d/95iscsi/parse-iscsiroot.sh +++ b/modules.d/95iscsi/parse-iscsiroot.sh @@ -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