Blame SOURCES/0080-iscsi-call-iscsistart-b-until-it-succeeds.patch

18971c
From 9bdbbe90efb11dfb840f9e9de0daf6388fa0f47f Mon Sep 17 00:00:00 2001
18971c
From: Harald Hoyer <harald@redhat.com>
18971c
Date: Fri, 17 Jan 2014 14:45:15 +0100
18971c
Subject: [PATCH] iscsi: call "iscsistart -b" until it succeeds
18971c
18971c
---
18971c
 modules.d/95iscsi/iscsiroot.sh       | 11 ++++++++++-
18971c
 modules.d/95iscsi/parse-iscsiroot.sh |  2 +-
18971c
 2 files changed, 11 insertions(+), 2 deletions(-)
18971c
18971c
diff --git a/modules.d/95iscsi/iscsiroot.sh b/modules.d/95iscsi/iscsiroot.sh
18971c
index abdea5cf..156003c0 100755
18971c
--- a/modules.d/95iscsi/iscsiroot.sh
18971c
+++ b/modules.d/95iscsi/iscsiroot.sh
18971c
@@ -45,11 +45,20 @@ if getargbool 0 rd.iscsi.firmware -d -y iscsi_firmware ; then
18971c
     done
18971c
 
18971c
     if ! [ -e /tmp/iscsistarted-firmware ]; then
18971c
-        iscsistart -b $iscsi_param
18971c
+        if ! iscsistart -f | vinfo; then
18971c
+            warn "iscistart: Could not get list of targets from firmware."
18971c
+            exit 1
18971c
+        fi
18971c
+
18971c
+        if ! iscsistart -b $iscsi_param 2>&1 | vinfo; then
18971c
+            warn "\`iscsistart -b $iscsi_param\ยด failed"
18971c
+            exit 1
18971c
+        fi
18971c
         echo 'started' > "/tmp/iscsistarted-iscsi"
18971c
         echo 'started' > "/tmp/iscsistarted-firmware"
18971c
         need_shutdown
18971c
     fi
18971c
+
18971c
     [ "$netif" = dummy ] && exit 0
18971c
 fi
18971c
 
18971c
diff --git a/modules.d/95iscsi/parse-iscsiroot.sh b/modules.d/95iscsi/parse-iscsiroot.sh
18971c
index 77bd9913..e463addb 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
-    initqueue --onetime --settled /sbin/iscsiroot dummy "$netroot" "$NEWROOT"
18971c
+    initqueue --settled /sbin/iscsiroot dummy "$netroot" "$NEWROOT"
18971c
 fi
18971c
 
18971c
 # If it's not iscsi we don't continue