]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
iscsi: do iscsi_firmware regardless of network
authorHarald Hoyer <harald@redhat.com>
Wed, 18 Dec 2013 11:26:05 +0000 (12:26 +0100)
committerHarald Hoyer <harald@redhat.com>
Wed, 18 Dec 2013 14:22:24 +0000 (15:22 +0100)
Do the iscsi_firmware iscsistart at least once, even if the network is
not up, to activate offload HBA iSCSI.

https://bugzilla.redhat.com/show_bug.cgi?id=1031160

modules.d/95iscsi/iscsiroot.sh
modules.d/95iscsi/parse-iscsiroot.sh
test/TEST-30-ISCSI/test.sh

index 738fff44972fbddde60243bd88040f0d11eb5003..ef090f7f551923069d97675284f2b0ab6b3ff9e3 100755 (executable)
@@ -44,13 +44,15 @@ if getargbool 0 rd.iscsi.firmware -d -y iscsi_firmware ; then
        iscsi_param="$iscsi_param --param $p"
     done
 
-    iscsistart -b $iscsi_param
-    echo 'started' > "/tmp/iscsistarted-iscsi"
-    echo 'started' > "/tmp/iscsistarted-firmware"
-    need_shutdown
-    exit 0
+    if ! [ -e /tmp/iscsistarted-firmware ] && iscsistart -b $iscsi_param; then
+        echo 'started' > "/tmp/iscsistarted-iscsi"
+        echo 'started' > "/tmp/iscsistarted-firmware"
+        need_shutdown
+    fi
+    [ "$netif" = dummy ] && exit 0
 fi
 
+
 handle_netroot()
 {
     local iscsi_initiator iscsi_target_name iscsi_target_ip iscsi_target_port
index 0c8b524b6b8e0fc6ed8ebb975b812edf46d6983a..77bd99131cdcf206ac51bc2ed546ee9c5801194f 100755 (executable)
@@ -64,7 +64,7 @@ if [ -n "$iscsi_firmware" ] ; then
     netroot=${netroot:-iscsi}
     modprobe -q iscsi_boot_sysfs 2>/dev/null
     modprobe -q iscsi_ibft
-    echo "[ -f '/tmp/iscsistarted-firmware' ]" > $hookdir/initqueue/finished/iscsi_firmware_started.sh
+    initqueue --onetime --settled /sbin/iscsiroot dummy "$netroot" "$NEWROOT"
 fi
 
 # If it's not iscsi we don't continue
index 4c29956491beda72f564e12ee6155ffdaf09aa57..f597783951e6158c65345a817bf04ba7a5f846ad 100755 (executable)
@@ -69,7 +69,7 @@ do_test_run() {
        || return 1
 
     run_client "netroot=iscsi" \
-       "root=LABEL=sysroot ip=192.168.50.101::192.168.50.1:255.255.255.0:iscsi-1:ens3:off" \
+       "iscsi_firmware root=LABEL=sysroot ip=192.168.50.101::192.168.50.1:255.255.255.0:iscsi-1:ens3:off" \
        "netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target1 netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target2" \
        || return 1
     return 0