Blame SOURCES/0373-95iscsi-Autodetect-iSCSI-firmware.patch

a0a3b4
From f31220ec883956f459bc227d6fe35d3a581eb369 Mon Sep 17 00:00:00 2001
a0a3b4
From: Hannes Reinecke <hare@suse.de>
a0a3b4
Date: Thu, 25 Feb 2016 20:58:09 +0800
a0a3b4
Subject: [PATCH] 95iscsi: Autodetect iSCSI firmware
a0a3b4
a0a3b4
Some iSCSI initiator present firmware information in
a0a3b4
/sys/firmware/ibft or /sys/firmware/iscsi_bootX
a0a3b4
a0a3b4
Whenever we detect one of those directories we should assume
a0a3b4
that the iSCSI devices should be activated.
a0a3b4
a0a3b4
Also incorporates SUSE patches:
a0a3b4
0049:
a0a3b4
95iscsi: Use 'ip=ibft' for ibft autoconfiguration
a0a3b4
a0a3b4
For iBFT autoconfiguration we should be setting 'ip=ibft'
a0a3b4
instead of rd.neednet. This should instruct dracut to only
a0a3b4
enable the iBFT interfaces and leave the rest alone.
a0a3b4
a0a3b4
References: bnc#879038
a0a3b4
a0a3b4
0054:
a0a3b4
95iscsi: update commandline printing
a0a3b4
a0a3b4
dracut has a separate callout 'cmdline' which should be used
a0a3b4
for printing out the generated commandline.
a0a3b4
a0a3b4
Signed-off-by: Pavel Wieczorkiewicz <pwieczorkiewicz@suse.com>
a0a3b4
Signed-off-by: Hannes Reinecke <hare@suse.de>
a0a3b4
Signed-off-by: Thomas Renninger <trenn@suse.de>
a0a3b4
---
a0a3b4
 modules.d/95iscsi/module-setup.sh | 26 ++++++++++++++++++++++++++
a0a3b4
 1 file changed, 26 insertions(+)
a0a3b4
a0a3b4
diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh
a0a3b4
index 4ecba05..7ef0caa 100755
a0a3b4
--- a/modules.d/95iscsi/module-setup.sh
a0a3b4
+++ b/modules.d/95iscsi/module-setup.sh
a0a3b4
@@ -29,6 +29,21 @@ check() {
a0a3b4
     return 0
a0a3b4
 }
a0a3b4
 
a0a3b4
+install_ibft() {
a0a3b4
+    # When iBFT / iscsi_boot is detected:
a0a3b4
+    # - Use 'ip=ibft' to set up iBFT network interface
a0a3b4
+    # - specify firmware booting cmdline parameter
a0a3b4
+
a0a3b4
+    for d in /sys/firmware/* ; do
a0a3b4
+        if [ -d ${d}/initiator ] ; then
a0a3b4
+            if [ ${d##*/} = "ibft" ] ; then
a0a3b4
+                echo -n "ip=ibft "
a0a3b4
+            fi
a0a3b4
+            echo -n "rd.iscsi.firmware=1"
a0a3b4
+        fi
a0a3b4
+    done
a0a3b4
+}
a0a3b4
+
a0a3b4
 depends() {
a0a3b4
     echo network rootfs-block
a0a3b4
 }
a0a3b4
@@ -36,6 +51,12 @@ depends() {
a0a3b4
 installkernel() {
a0a3b4
     local _arch=$(uname -m)
a0a3b4
 
a0a3b4
+    # Detect iBFT and perform mandatory steps
a0a3b4
+    if [[ $hostonly_cmdline == "yes" ]] ; then
a0a3b4
+        install_ibft > "${initdir}/etc/cmdline.d/95iscsi.conf"
a0a3b4
+        echo >> "${initdir}/etc/cmdline.d/95iscsi.conf"
a0a3b4
+    fi
a0a3b4
+
a0a3b4
     instmods bnx2i qla4xxx cxgb3i cxgb4i be2iscsi
a0a3b4
     hostonly="" instmods iscsi_tcp iscsi_ibft crc32c iscsi_boot_sysfs
a0a3b4
     iscsi_module_filter() {
a0a3b4
@@ -75,6 +96,11 @@ installkernel() {
a0a3b4
     | iscsi_module_filter  |  instmods
a0a3b4
 }
a0a3b4
 
a0a3b4
+cmdline() {
a0a3b4
+    install_ibft
a0a3b4
+}
a0a3b4
+
a0a3b4
+# called by dracut
a0a3b4
 install() {
a0a3b4
     inst_multiple umount iscsistart hostname iscsi-iname
a0a3b4
     inst_multiple -o iscsiuio