Blame SOURCES/0065-iscsi-do-iscsi_firmware-regardless-of-network.patch

712866
From 937456c65b0e641a6494a39acb5a001b2c9ed992 Mon Sep 17 00:00:00 2001
712866
From: Harald Hoyer <harald@redhat.com>
712866
Date: Wed, 18 Dec 2013 12:26:05 +0100
712866
Subject: [PATCH] iscsi: do iscsi_firmware regardless of network
712866
712866
Do the iscsi_firmware iscsistart at least once, even if the network is
712866
not up, to activate offload HBA iSCSI.
712866
712866
https://bugzilla.redhat.com/show_bug.cgi?id=1031160
712866
---
712866
 modules.d/95iscsi/iscsiroot.sh       | 12 +++++++-----
712866
 modules.d/95iscsi/parse-iscsiroot.sh |  2 +-
712866
 test/TEST-30-ISCSI/test.sh           |  2 +-
712866
 3 files changed, 9 insertions(+), 7 deletions(-)
712866
712866
diff --git a/modules.d/95iscsi/iscsiroot.sh b/modules.d/95iscsi/iscsiroot.sh
712866
index 738fff4..ef090f7 100755
712866
--- a/modules.d/95iscsi/iscsiroot.sh
712866
+++ b/modules.d/95iscsi/iscsiroot.sh
712866
@@ -44,13 +44,15 @@ if getargbool 0 rd.iscsi.firmware -d -y iscsi_firmware ; then
712866
 	iscsi_param="$iscsi_param --param $p"
712866
     done
712866
 
712866
-    iscsistart -b $iscsi_param
712866
-    echo 'started' > "/tmp/iscsistarted-iscsi"
712866
-    echo 'started' > "/tmp/iscsistarted-firmware"
712866
-    need_shutdown
712866
-    exit 0
712866
+    if ! [ -e /tmp/iscsistarted-firmware ] && iscsistart -b $iscsi_param; then
712866
+        echo 'started' > "/tmp/iscsistarted-iscsi"
712866
+        echo 'started' > "/tmp/iscsistarted-firmware"
712866
+        need_shutdown
712866
+    fi
712866
+    [ "$netif" = dummy ] && exit 0
712866
 fi
712866
 
712866
+
712866
 handle_netroot()
712866
 {
712866
     local iscsi_initiator iscsi_target_name iscsi_target_ip iscsi_target_port
712866
diff --git a/modules.d/95iscsi/parse-iscsiroot.sh b/modules.d/95iscsi/parse-iscsiroot.sh
712866
index 0c8b524..77bd991 100755
712866
--- a/modules.d/95iscsi/parse-iscsiroot.sh
712866
+++ b/modules.d/95iscsi/parse-iscsiroot.sh
712866
@@ -64,7 +64,7 @@ if [ -n "$iscsi_firmware" ] ; then
712866
     netroot=${netroot:-iscsi}
712866
     modprobe -q iscsi_boot_sysfs 2>/dev/null
712866
     modprobe -q iscsi_ibft
712866
-    echo "[ -f '/tmp/iscsistarted-firmware' ]" > $hookdir/initqueue/finished/iscsi_firmware_started.sh
712866
+    initqueue --onetime --settled /sbin/iscsiroot dummy "$netroot" "$NEWROOT"
712866
 fi
712866
 
712866
 # If it's not iscsi we don't continue
712866
diff --git a/test/TEST-30-ISCSI/test.sh b/test/TEST-30-ISCSI/test.sh
712866
index 4c29956..f597783 100755
712866
--- a/test/TEST-30-ISCSI/test.sh
712866
+++ b/test/TEST-30-ISCSI/test.sh
712866
@@ -69,7 +69,7 @@ do_test_run() {
712866
 	|| return 1
712866
 
712866
     run_client "netroot=iscsi" \
712866
-	"root=LABEL=sysroot ip=192.168.50.101::192.168.50.1:255.255.255.0:iscsi-1:ens3:off" \
712866
+	"iscsi_firmware root=LABEL=sysroot ip=192.168.50.101::192.168.50.1:255.255.255.0:iscsi-1:ens3:off" \
712866
 	"netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target1 netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target2" \
712866
 	|| return 1
712866
     return 0