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

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