]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
iscsi: don't continue waiting if the root device is present
authorMartin Wilck <mwilck@suse.com>
Thu, 21 Mar 2019 15:27:04 +0000 (16:27 +0100)
committerDaniel Molkentin <dmolkentin@suse.com>
Wed, 24 Apr 2019 09:32:45 +0000 (11:32 +0200)
dracut waits for every iscsiroot connection to be established
before switching root. This is not necessary in multipath scenarios,
where a single path is usually sufficient to set up the root device,
and where users expect booting to succeed unless all paths are down.

Don't wait for the iscsi portal to start if the root device has
already been found.

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

index f00a83bb62a6012430865c26136367791ff6a144..8d6e3e8cd2dc2f3b3bd4c889ff13aba5ee10b8a1 100755 (executable)
@@ -84,7 +84,7 @@ if [ -n "$iscsi_firmware" ]; then
     modprobe -b -q iscsi_boot_sysfs 2>/dev/null
     modprobe -b -q iscsi_ibft
     # if no ip= is given, but firmware
-    echo "[ -f '/tmp/iscsistarted-firmware' ]" > $hookdir/initqueue/finished/iscsi_started.sh
+    echo "${DRACUT_SYSTEMD+systemctl is-active initrd-root-device.target || }[ -f '/tmp/iscsistarted-firmware' ]" > $hookdir/initqueue/finished/iscsi_started.sh
     initqueue --unique --online /sbin/iscsiroot online "iscsi:" "$NEWROOT"
     initqueue --unique --onetime --timeout /sbin/iscsiroot timeout "iscsi:" "$NEWROOT"
     initqueue --unique --onetime --settled /sbin/iscsiroot online "iscsi:" "'$NEWROOT'"
@@ -145,7 +145,7 @@ for nroot in $(getargs netroot); do
     type parse_iscsi_root >/dev/null 2>&1 || . /lib/net-lib.sh
     parse_iscsi_root "$nroot" || return 1
     netroot_enc=$(str_replace "$nroot" '/' '\2f')
-    echo "[ -f '/tmp/iscsistarted-$netroot_enc' ]" > $hookdir/initqueue/finished/iscsi_started.sh
+    echo "${DRACUT_SYSTEMD+systemctl is-active initrd-root-device.target || }[ -f '/tmp/iscsistarted-$netroot_enc' ]" > $hookdir/initqueue/finished/iscsi_started.sh
 done
 
 # Done, all good!