Blob Blame History Raw
From 8dfe442d1ea9c418b1a2751040f89c6e0e0d30e6 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 17 Jan 2014 14:45:15 +0100
Subject: [PATCH] iscsi: call "iscsistart -b" until it succeeds

---
 modules.d/95iscsi/iscsiroot.sh       | 11 ++++++++++-
 modules.d/95iscsi/parse-iscsiroot.sh |  2 +-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/modules.d/95iscsi/iscsiroot.sh b/modules.d/95iscsi/iscsiroot.sh
index abdea5c..156003c 100755
--- a/modules.d/95iscsi/iscsiroot.sh
+++ b/modules.d/95iscsi/iscsiroot.sh
@@ -45,11 +45,20 @@ if getargbool 0 rd.iscsi.firmware -d -y iscsi_firmware ; then
     done
 
     if ! [ -e /tmp/iscsistarted-firmware ]; then
-        iscsistart -b $iscsi_param
+        if ! iscsistart -f | vinfo; then
+            warn "iscistart: Could not get list of targets from firmware."
+            exit 1
+        fi
+
+        if ! iscsistart -b $iscsi_param 2>&1 | vinfo; then
+            warn "\`iscsistart -b $iscsi_param\ยด failed"
+            exit 1
+        fi
         echo 'started' > "/tmp/iscsistarted-iscsi"
         echo 'started' > "/tmp/iscsistarted-firmware"
         need_shutdown
     fi
+
     [ "$netif" = dummy ] && exit 0
 fi
 
diff --git a/modules.d/95iscsi/parse-iscsiroot.sh b/modules.d/95iscsi/parse-iscsiroot.sh
index 77bd991..e463add 100755
--- a/modules.d/95iscsi/parse-iscsiroot.sh
+++ b/modules.d/95iscsi/parse-iscsiroot.sh
@@ -64,7 +64,7 @@ if [ -n "$iscsi_firmware" ] ; then
     netroot=${netroot:-iscsi}
     modprobe -q iscsi_boot_sysfs 2>/dev/null
     modprobe -q iscsi_ibft
-    initqueue --onetime --settled /sbin/iscsiroot dummy "$netroot" "$NEWROOT"
+    initqueue --settled /sbin/iscsiroot dummy "$netroot" "$NEWROOT"
 fi
 
 # If it's not iscsi we don't continue