Blob Blame History Raw
From 7391fef29ab9a4766b5eb04d05803f2ebaa95752 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Tue, 25 Aug 2015 11:14:38 +0200
Subject: [PATCH] iscsi/iscsiroot.sh: handle firmware in online queue

otherwise it does not get called, if no netroot is set

(cherry picked from commit 3bd3bbec319eccd28145f77e42b83b479286ff34)
---
 modules.d/95iscsi/iscsiroot.sh | 32 +++++++++++++++-----------------
 1 file changed, 15 insertions(+), 17 deletions(-)

diff --git a/modules.d/95iscsi/iscsiroot.sh b/modules.d/95iscsi/iscsiroot.sh
index ad95812..893f279 100755
--- a/modules.d/95iscsi/iscsiroot.sh
+++ b/modules.d/95iscsi/iscsiroot.sh
@@ -236,28 +236,26 @@ if [ "$netif" = "dummy" ] && all_ifaces_up; then
     sleep 2
 fi
 
-# loop over all netroot parameter
-netroot=$(getarg netroot)
-if [ $? -eq 0 ] && [ "$netroot" != "dhcp" ]; then
-    for nroot in $(getargs netroot); do
-        [ "${nroot%%:*}" = "iscsi" ] || continue
-        nroot="${nroot##iscsi:}"
-        if [ -n "$nroot" ]; then
-            handle_netroot "$nroot"
-            ret=$(($ret + $?))
-        fi
-    done
+if [ "$netif" = "online" ]; then
     if getargbool 0 rd.iscsi.firmware -d -y iscsi_firmware ; then
         handle_firmware
-        ret=$(($ret + $?))
+        ret=$?
     fi
 else
-    if [ -n "$iroot" ]; then
-        handle_netroot "$iroot"
-        ret=$?
+    # loop over all netroot parameter
+    nroot=$(getarg netroot)
+    if [ $? -eq 0 ] && [ "$nroot" != "dhcp" ]; then
+        for nroot in $(getargs netroot); do
+            [ "${nroot%%:*}" = "iscsi" ] || continue
+            nroot="${nroot##iscsi:}"
+            if [ -n "$nroot" ]; then
+                handle_netroot "$nroot"
+                ret=$(($ret + $?))
+            fi
+        done
     else
-        if getargbool 0 rd.iscsi.firmware -d -y iscsi_firmware ; then
-            handle_firmware
+        if [ -n "$iroot" ]; then
+            handle_netroot "$iroot"
             ret=$?
         fi
     fi