File 0313-ibft-wait-for-session-on-all-paths.patch of Package dracut.4406

Index: dracut-037/modules.d/95iscsi/iscsiroot.sh
===================================================================
--- dracut-037.orig/modules.d/95iscsi/iscsiroot.sh
+++ dracut-037/modules.d/95iscsi/iscsiroot.sh
@@ -54,6 +54,8 @@ set_login_retries() {
 handle_firmware()
 {
     if ! [ -e /tmp/iscsistarted-firmware ]; then
+        local ifaces retry
+
         # Depending on the 'ql4xdisablesysfsboot' qla4xxx
         # will be autostarting sessions without presenting
         # them via the firmware interface.
@@ -62,10 +64,15 @@ handle_firmware()
         if ! iscsiadm -m fw; then
             warn "iscsiadm: Could not get list of targets from firmware."
         else
+            ifaces=( $(echo /sys/firmware/ibft/ethernet*) )
+            [ -f /tmp/session-retry ] || echo 1 > /tmp/session-retry
+            retry=$(cat /tmp/session-retry)
 
-            for p in $(getargs rd.iscsi.param -d iscsi_param); do
-                iscsi_param="$iscsi_param --param $p"
-            done
+            if [ $retry -lt ${#ifaces[*]} ]; then
+                let retry++
+                echo $retry > /tmp/session-retry
+                return 1
+            fi
 
             if ! iscsiadm -m fw -l; then
                 warn "iscsiadm: Log-in to iscsi target failed"
openSUSE Build Service is sponsored by