ab0e4d
From 8680b657da61ce533f1c91e79eadd3c46f9e98d0 Mon Sep 17 00:00:00 2001
ab0e4d
From: "Eugene S. Sobolev" <sobolev@protei.ru>
ab0e4d
Date: Fri, 14 Feb 2020 11:49:06 +0300
ab0e4d
Subject: [PATCH] network/net-lib.sh: Configure all iBFT interfaces
ab0e4d
ab0e4d
Added boolean command line option rd.iscsi.mp
ab0e4d
ab0e4d
(cherry picked from commit c7ee6b3dbb8dfad61aa337b2ecf7e4eaeddc4b4b)
ab0e4d
ab0e4d
Resolves: #1851984
ab0e4d
---
ab0e4d
 dracut.cmdline.7.asc           | 3 +++
ab0e4d
 modules.d/40network/net-lib.sh | 6 ++++--
ab0e4d
 2 files changed, 7 insertions(+), 2 deletions(-)
ab0e4d
ab0e4d
diff --git a/dracut.cmdline.7.asc b/dracut.cmdline.7.asc
ab0e4d
index 19b5cc87..9003c430 100644
ab0e4d
--- a/dracut.cmdline.7.asc
ab0e4d
+++ b/dracut.cmdline.7.asc
ab0e4d
@@ -764,6 +764,9 @@ iscsistart -b --param node.session.timeo.replacement_timeout=30
ab0e4d
 **rd.iscsi.ibft** **rd.iscsi.ibft=1**:
ab0e4d
     Turn on iBFT autoconfiguration for the interfaces
ab0e4d
 
ab0e4d
+**rd.iscsi.mp** **rd.iscsi.mp=1**:
ab0e4d
+    Configure all iBFT interfaces, not only used for booting (multipath)
ab0e4d
+
ab0e4d
 **rd.iscsi.waitnet=0**:
ab0e4d
     Turn off waiting for all interfaces to be up before trying to login to the iSCSI targets.
ab0e4d
 
ab0e4d
diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh
ab0e4d
index fc914b30..f0c1c041 100755
ab0e4d
--- a/modules.d/40network/net-lib.sh
ab0e4d
+++ b/modules.d/40network/net-lib.sh
ab0e4d
@@ -251,8 +251,10 @@ ibft_to_cmdline() {
ab0e4d
             [ -e ${iface}/flags ] && flags=$(read a < ${iface}/flags; echo $a)
ab0e4d
             # Skip invalid interfaces
ab0e4d
             (( $flags & 1 )) || continue
ab0e4d
-            # Skip interfaces not used for booting
ab0e4d
-            (( $flags & 2 )) || continue
ab0e4d
+            # Skip interfaces not used for booting unless using multipath
ab0e4d
+            if ! getargbool 0 rd.iscsi.mp ; then
ab0e4d
+                (( $flags & 2 )) || continue
ab0e4d
+            fi
ab0e4d
             [ -e ${iface}/dhcp ] && dhcp=$(read a < ${iface}/dhcp; echo $a)
ab0e4d
             [ -e ${iface}/origin ] && origin=$(read a < ${iface}/origin; echo $a)
ab0e4d
             [ -e ${iface}/ip-addr ] && ip=$(read a < ${iface}/ip-addr; echo $a)
ab0e4d