dracut/0030-95iscsi-Autodetect-iSCSI-firmware.patch
Hannes Reinecke 3f26422f3a Accepting request 236221 from home:hreinecke:branches:Base:System
- Rename patches to match git repository:
  * old: 0013-Correct-paths-for-openSUSE.patch
    new: 0011-Correct-paths-for-openSUSE.patch
  * old: 0014-Check-for-plymouth-lib-directories.patch
    new: 0012-Check-for-plymouth-lib-directories.patch
  * old: dracut_do_not_update_booloader_if_no_kernel_is_found.patch
    new: 0013-mkinitrd-suse-do-not-update-bootloader-if-no-kernel-.patch
  * old: suse_grub_manpage.patch
    new: 0014-Update-dracut-manpage-for-GRUB-Legacy-and-GRUB2.patch
  * old: replace_dhclient_with_wickedd_dhcp_supplicants.patch
    new: 0015-40network-replace-dhclient-with-wickedd-dhcp-supplic.patch
  * old: 0015-add-new-s390x-specific-rule-files.patch
    new: 0016-Add-new-s390x-specific-rule-files.patch
  * old: change_write_ifcfg_to_suse.patch
    new: 0017-45ifcfg-use-distro-specific-scripts.patch
  * old: dracut-fix-whitespace-add-drivers_call.patch
    new: 0018-mkinitrd-suse-Fix-whitespaces-when-adding-drivers.patch
  * old: wait_for_network_race_condition_fix.patch
    new: 0019-40network-Fix-race-condition-when-wait-for-networks.patch
  * old: dracut-warpclock_module.patch
    new: 0020-00warpclock-Set-correct-timezone.patch
  * old: s390-dcssblk.patch
    new: 0021-95dcssblk-Add-new-module-for-DCSS-block-devices.patch
  * old: dracut-install-persistent-rule.patch
    new: 0022-95udev-rules-add-persistent-network-rule.patch
  * old: dracut-really-always-add-autofs4.patch
    new: 0023-systemd-always-tries-to-load-autofs4.patch
  * old: mdraid-setup.patch
    new: 0024-Fixup-mdraid-setup.patch
  * old: 0015-95udev-rules-Add-59-scsi-sg_utils.rules.patch

OBS-URL: https://build.opensuse.org/request/show/236221
OBS-URL: https://build.opensuse.org/package/show/Base:System/dracut?expand=0&rev=156
2014-06-04 12:38:30 +00:00

73 lines
2.4 KiB
Diff

From c1db8b0b1a7545c9edf2b0b2328733c44ba4e8f1 Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
Date: Mon, 5 May 2014 08:32:16 +0200
Subject: 95iscsi: Autodetect iSCSI firmware
Some iSCSI initiator present firmware information in
/sys/firmware/ibft or /sys/firmware/iscsi_bootX
Whenever we detect one of those directories we should assume
that the iSCSI devices should be activated.
Signed-off-by: Pavel Wieczorkiewicz <pwieczorkiewicz@suse.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
modules.d/95iscsi/module-setup.sh | 16 ++++++++++++++++
modules.d/95iscsi/parse-iscsiroot.sh | 10 ++++++++--
2 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh
index 1b0f292..97e6e81 100755
--- a/modules.d/95iscsi/module-setup.sh
+++ b/modules.d/95iscsi/module-setup.sh
@@ -39,6 +39,22 @@ depends() {
installkernel() {
local _arch=$(uname -m)
+ install_ibft() {
+ # When iBFT / iscsi_boot is detected:
+ # - mark network as mandatory
+ # - specify firmware booting cmdline parameter
+
+ for d in /sys/firmware/* ; do
+ if [ -d ${d}/initiator ] ; then
+ echo "rd.neednet=1" >> "${initdir}/etc/cmdline.d/95iscsi.conf"
+ echo "rd.iscsi.firmware=1" >> "${initdir}/etc/cmdline.d/95iscsi.conf"
+ fi
+ done
+ }
+
+ # Detect iBFT and perform mandatory steps
+ install_ibft
+
instmods bnx2i qla4xxx cxgb3i cxgb4i be2iscsi
hostonly="" instmods iscsi_tcp iscsi_ibft crc32c iscsi_boot_sysfs
iscsi_module_filter() {
diff --git a/modules.d/95iscsi/parse-iscsiroot.sh b/modules.d/95iscsi/parse-iscsiroot.sh
index 4be9d56..a965cc6 100755
--- a/modules.d/95iscsi/parse-iscsiroot.sh
+++ b/modules.d/95iscsi/parse-iscsiroot.sh
@@ -59,11 +59,17 @@ if [ -n "$iscsiroot" ] ; then
[ -z "$netroot" ] || [ "$netroot" = "iscsi" ] && netroot=iscsi:$iscsiroot
fi
+# Autodetect iSCSI firmware targets
+if [ -z "$iscsiroot" ] ; then
+ modprobe -q iscsi_boot_sysfs
+ modprobe -q iscsi_ibft
+ [ -d /sys/firmware/ibft ] && iscsi_firmware="1"
+ [ -d /sys/firmware/iscsi_boot1 ] && iscsi_firmware="1"
+fi
+
# iscsi_firmware does not need argument checking
if [ -n "$iscsi_firmware" ] ; then
netroot=${netroot:-iscsi:}
- modprobe -q iscsi_boot_sysfs 2>/dev/null
- modprobe -q iscsi_ibft
initqueue --onetime --timeout "/sbin/iscsiroot dummy '$netroot' '$NEWROOT'"
fi
--
1.8.5.2