dracut/0198-95iscsi-set-rd.iscsi.firmware-for-qla4xxx-sessions.patch

83 lines
2.6 KiB
Diff
Raw Normal View History

Accepting request 400457 from home:trenn - FCOE fix bsc#982588 * Add 0212-fcoe_reorder_init_path.patch - Port missing SLES patches * Add 0197-95iscsi-Do-not-require-network-for-qla4xxx-flash-ses.patch * Add 0198-95iscsi-set-rd.iscsi.firmware-for-qla4xxx-sessions.patch * Remove 0194-95iscsi-Do-not-require-network-for-qla4xxx-flash-ses.patch * Remove 0195-95iscsi-set-rd.iscsi.firmware-for-qla4xxx-sessions.patch - Rewrite patch: * Add 0302-Revert-90multipath-add-hostonly-multipath.conf-in-ca.patch * Remove 0001-multipath_revert_mpathconf_binary_use.patch - Update 0403-95lunmask-Add-module-to-handle-LUN-masking.patch to match upstream kernel submission (FATE#319786) - Add IFS restoring where it has been lost due to mainline merging (bsc#977117) *Add 0500-Reset-IFS-variable.patch - Make sure to install collect binary (bsc#976466) * Add: 0188-95dasd_rules-Install-collect-udev-helper-binary.patch - Remove version from requires on subpackage - Add a split provide because of the package split for SLE12 SP1 to SP2 upgrade * 0001-multipath_revert_mpathconf_binary_use.patch (fate#320499) * 0170-iscsi-skip-ibft-invalid-dhcp.patch (bsc#953361) * 0160-s390-update_active_devices_initrd.patch (bsc#939101) * 0161-95zfcp_rules-simplified-rd.zfcp-commandline-for-NPIV.patch (bsc#964456) * 0190-replace-iscsistart-with-systemd-service-files.patch (fate#319024) * 0191-static_network_setup_return_zero.patch (bsc#919179) OBS-URL: https://build.opensuse.org/request/show/400457 OBS-URL: https://build.opensuse.org/package/show/Base:System/dracut?expand=0&rev=258
2016-06-07 15:51:45 +02:00
From c56c855754914283bb930ef1a2b2dd5e8d5a6f25 Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
Date: Tue, 20 Oct 2015 07:59:43 +0200
Subject: 95iscsi: set 'rd.iscsi.firmware' for qla4xxx sessions
The qla4xxx driver can run with or without open-iscsi support,
depending on the setting of the 'ql4xdisablesysfsboot' module
parameter.
When the parameter is set to '0', dracut needs to call
'iscsiadm -m fw' to trigger iSCSI login, so we need to set
the 'rd.iscsi.firmware' dracut variable. But this will then
fail if the parameter is set to '1', as in these cases the
list of firmware targets is empty.
To cover both scenarios this patch reshuffles 'handle_firmware'
in iscsiroot.sh to continue if iscsiadm -m fw fails but iscsi
sessions are present.
References: bsc#951003
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
modules.d/95iscsi/iscsiroot.sh | 37 +++++++++++++++++++++----------------
1 file changed, 21 insertions(+), 16 deletions(-)
diff --git a/modules.d/95iscsi/iscsiroot.sh b/modules.d/95iscsi/iscsiroot.sh
index 6ef6276..77755fb 100755
--- a/modules.d/95iscsi/iscsiroot.sh
+++ b/modules.d/95iscsi/iscsiroot.sh
@@ -53,29 +53,34 @@ handle_firmware()
{
local ifaces retry
+ # Depending on the 'ql4xdisablesysfsboot' qla4xxx
+ # will be autostarting sessions without presenting
+ # them via the firmware interface.
+ # In these cases 'iscsiadm -m fw' will fail, but
+ # the iSCSI sessions will still be present.
if ! iscsiadm -m fw; then
warn "iscsiadm: Could not get list of targets from firmware."
- return 1
- fi
-
- ifaces=( $(echo /sys/firmware/ibft/ethernet*) )
- [ -f /tmp/session-retry ] || echo 1 > /tmp/session-retry
- retry=$(cat /tmp/session-retry)
-
- if [ $retry -lt ${#ifaces[*]} ]; then
- let retry++
- echo $retry > /tmp/session-retry
- return 1
- fi
+ else
+ ifaces=( $(echo /sys/firmware/ibft/ethernet*) )
+ [ -f /tmp/session-retry ] || echo 1 > /tmp/session-retry
+ retry=$(cat /tmp/session-retry)
+
+ 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"
+ if ! iscsiadm -m fw -l; then
+ warn "iscsiadm: Log-in to iscsi target failed"
+ else
+ need_shutdown
+ fi
fi
-
+ [ -d /sys/class/iscsi_session ] || return 1
echo 'started' > "/tmp/iscsistarted-iscsi:"
echo 'started' > "/tmp/iscsistarted-firmware"
- need_shutdown
return 0
}
--
2.6.6