From 2f8fa9a4826d739acf39764ce407d2d4399e91581d577a1a561d6ee06b81ecff Mon Sep 17 00:00:00 2001 From: Thomas Renninger Date: Tue, 6 May 2014 11:22:17 +0000 Subject: [PATCH] Accepting request 232828 from home:trenn:branches:Base:System - Update add_dracuts_network_params_for_iscsi.patch to detect be2iscsi firmware devices - Remove obsolete patch fix-iscsi-firmware.sh - Fixup iscsi firmware booting with be2iscsi (bnc#873448): Added 0024-95iscsi-Set-correct-iscsi_started-value-for-iSCSI-fi.patch - Renamed mkinird_differ_host_and_cmdline_only_properly.patch to 0023-mkinitrd-suse.sh-Use-hostonly-and-hostonly-cmdline-c.patch OBS-URL: https://build.opensuse.org/request/show/232828 OBS-URL: https://build.opensuse.org/package/show/Base:System/dracut?expand=0&rev=140 --- ...-Use-hostonly-and-hostonly-cmdline-c.patch | 51 +++++++++++++ ...ect-iscsi_started-value-for-iSCSI-fi.patch | 37 ++++++++++ add_dracuts_network_params_for_iscsi.patch | 71 +++++++++++++++---- change_write_ifcfg_to_suse.patch | 5 +- dracut.changes | 11 +++ dracut.spec | 6 +- fix-iscsi-firmware.patch | 31 -------- ...iffer_host_and_cmdline_only_properly.patch | 33 --------- 8 files changed, 163 insertions(+), 82 deletions(-) create mode 100644 0023-mkinitrd-suse.sh-Use-hostonly-and-hostonly-cmdline-c.patch create mode 100644 0024-95iscsi-Set-correct-iscsi_started-value-for-iSCSI-fi.patch delete mode 100644 fix-iscsi-firmware.patch delete mode 100644 mkinird_differ_host_and_cmdline_only_properly.patch diff --git a/0023-mkinitrd-suse.sh-Use-hostonly-and-hostonly-cmdline-c.patch b/0023-mkinitrd-suse.sh-Use-hostonly-and-hostonly-cmdline-c.patch new file mode 100644 index 0000000..319115c --- /dev/null +++ b/0023-mkinitrd-suse.sh-Use-hostonly-and-hostonly-cmdline-c.patch @@ -0,0 +1,51 @@ +From c99348f3337fde44a98abf5946b7cbf36bce1b0e Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +Date: Mon, 5 May 2014 08:38:44 +0200 +Subject: mkinitrd-suse.sh: Use '--hostonly' and '--hostonly-cmdline' correctly + +LVM and other systems might not be working properly as the +--hostonly-cmdline flag has to be active by default. + +References: bnc#874000,bnc#874905,bnc#874363 + +Signed-off-by: Thomas Renninger +--- + mkinitrd-suse.8.asc | 4 +++- + mkinitrd-suse.sh | 6 +++++- + 2 files changed, 8 insertions(+), 2 deletions(-) + +diff --git a/mkinitrd-suse.8.asc b/mkinitrd-suse.8.asc +index 9eb8fc9..a181b75 100644 +--- a/mkinitrd-suse.8.asc ++++ b/mkinitrd-suse.8.asc +@@ -76,7 +76,9 @@ OPTIONS + + **-A**:: + Create a so called "monster initrd" which includes all available +- features and modules. ++ features and modules. This calls dracut with --no-hostonly and ++ --no-hostonly-cmdline parameters internally, instead of the default ++ --hostonly and --hostonly-cmdline. + + **-v, --verbose**:: + increase verbosity level +diff --git a/mkinitrd-suse.sh b/mkinitrd-suse.sh +index 1c2634f..c02062d 100755 +--- a/mkinitrd-suse.sh ++++ b/mkinitrd-suse.sh +@@ -297,7 +297,11 @@ targets=( $targets ) + [[ $kernels ]] && kernels=( $kernels ) + + [[ $logfile ]] && dracut_args="${dracut_args} --logfile $logfile" +-[[ $host_only == 1 ]] && dracut_args="${dracut_args} --hostonly" ++if [[ $host_only == 1 ]];then ++ dracut_args="${dracut_args} --hostonly --hostonly-cmdline" ++else ++ dracut_args="${dracut_args} --no-hostonly --no-hostonly-cmdline" ++fi + [[ $force == 1 ]] && dracut_args="${dracut_args} --force" + [[ $dracut_cmdline ]] && dracut_args="${dracut_args} --kernel-cmdline ${dracut_cmdline}" + [ -z "$(type -p update-bootloader)" ] && skip_update_bootloader=1 +-- +1.8.5.2 + diff --git a/0024-95iscsi-Set-correct-iscsi_started-value-for-iSCSI-fi.patch b/0024-95iscsi-Set-correct-iscsi_started-value-for-iSCSI-fi.patch new file mode 100644 index 0000000..5b9dc84 --- /dev/null +++ b/0024-95iscsi-Set-correct-iscsi_started-value-for-iSCSI-fi.patch @@ -0,0 +1,37 @@ +From 2a30da782e48d953507ca793ab0bc7f78b37db9f Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +Date: Mon, 5 May 2014 08:48:35 +0200 +Subject: 95iscsi: Set correct iscsi_started value for iSCSI firmware + +When iSCSI firmware booting is selected we should not rely on +'netroot' or 'iscsiroot' variables to be set. + +References: bnc#873448 + +Signed-off-by: Hannes Reinecke +--- + modules.d/95iscsi/parse-iscsiroot.sh | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/modules.d/95iscsi/parse-iscsiroot.sh b/modules.d/95iscsi/parse-iscsiroot.sh +index a965cc6..c1a47d2 100755 +--- a/modules.d/95iscsi/parse-iscsiroot.sh ++++ b/modules.d/95iscsi/parse-iscsiroot.sh +@@ -98,8 +98,12 @@ if [ -n "$netroot" ] && [ "$root" != "/dev/root" ] && [ "$root" != "dhcp" ]; the + fi + fi + +-netroot_enc=$(str_replace "$netroot" '/' '\2f') +-echo "[ -f '/tmp/iscsistarted-$netroot_enc' ]" > $hookdir/initqueue/finished/iscsi_started.sh ++if [ -n "$iscsi_firmware" ] ; then ++ echo "[ -f '/tmp/iscsistarted-firmware' ]" > $hookdir/initqueue/finished/iscsi_started.sh ++else ++ netroot_enc=$(str_replace "$netroot" '/' '\2f') ++ echo "[ -f '/tmp/iscsistarted-$netroot_enc' ]" > $hookdir/initqueue/finished/iscsi_started.sh ++fi + + # Done, all good! + rootok=1 +-- +1.8.5.2 + diff --git a/add_dracuts_network_params_for_iscsi.patch b/add_dracuts_network_params_for_iscsi.patch index 8f77669..2b38196 100644 --- a/add_dracuts_network_params_for_iscsi.patch +++ b/add_dracuts_network_params_for_iscsi.patch @@ -1,22 +1,40 @@ -Index: dracut-037/modules.d/95iscsi/module-setup.sh -=================================================================== ---- dracut-037.orig/modules.d/95iscsi/module-setup.sh 2014-03-19 17:16:08.000000000 +0100 -+++ dracut-037/modules.d/95iscsi/module-setup.sh 2014-04-14 13:40:02.560200357 +0200 +From c1db8b0b1a7545c9edf2b0b2328733c44ba4e8f1 Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +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 +Signed-off-by: Hannes Reinecke +--- + 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() { -+ local IBFT_NICS="ethernet" -+ local IBFT_ROOT="/sys/firmware/ibft" ++ # When iBFT / iscsi_boot is detected: ++ # - mark network as mandatory ++ # - specify firmware booting cmdline parameter + -+ # When iBFT is detected: -+ # - mark network as mandatory -+ # - specify firmware booting cmdline parameter -+ if [ -d "${IBFT_ROOT}/${IBFT_NICS}"* ]; then -+ echo "rd.neednet=1" >> "${initdir}/etc/cmdline.d/95iscsi.conf" -+ echo "rd.iscsi.firmware=1" >> "${initdir}/etc/cmdline.d/95iscsi.conf" -+ fi ++ 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 @@ -25,3 +43,30 @@ Index: dracut-037/modules.d/95iscsi/module-setup.sh 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 + diff --git a/change_write_ifcfg_to_suse.patch b/change_write_ifcfg_to_suse.patch index c9d375e..710a0c6 100644 --- a/change_write_ifcfg_to_suse.patch +++ b/change_write_ifcfg_to_suse.patch @@ -5,11 +5,12 @@ Subject: [PATCH] 45ifcfg: use distro-specific scripts Detect the system flavor and write the ifcfg files accordingly. -Signed-off-by: Hannes Reinecke -Modified-by: Thomas Rennigner - Do not move ifcfg to -suse and -redhat files to avoid re-diffing after each upgrade. Handle this in the spec file and a separate write-ifcfg-suse.sh source file + +Signed-off-by: Hannes Reinecke +Modified-by: Thomas Rennigner --- modules.d/40network/ifup.sh | 1 + modules.d/45ifcfg/module-setup.sh | 8 +- diff --git a/dracut.changes b/dracut.changes index e113676..cd03111 100644 --- a/dracut.changes +++ b/dracut.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Mon May 5 08:55:37 CEST 2014 - hare@suse.de + +- Update add_dracuts_network_params_for_iscsi.patch to detect + be2iscsi firmware devices +- Remove obsolete patch fix-iscsi-firmware.sh +- Fixup iscsi firmware booting with be2iscsi (bnc#873448): + Added 0024-95iscsi-Set-correct-iscsi_started-value-for-iSCSI-fi.patch +- Renamed mkinird_differ_host_and_cmdline_only_properly.patch to + 0023-mkinitrd-suse.sh-Use-hostonly-and-hostonly-cmdline-c.patch + ------------------------------------------------------------------- Wed Apr 30 15:18:45 UTC 2014 - trenn@suse.de diff --git a/dracut.spec b/dracut.spec index 5fbdd35..76712ad 100644 --- a/dracut.spec +++ b/dracut.spec @@ -42,7 +42,6 @@ Patch12: 0014-Check-for-plymouth-lib-directories.patch Patch13: dracut_do_not_update_booloader_if_no_kernel_is_found.patch Patch14: suse_grub_manpage.patch Patch15: replace_dhclient_with_wickedd_dhcp_supplicants.patch -Patch16: fix-iscsi-firmware.patch Patch18: 0015-add-new-s390x-specific-rule-files.patch Patch19: change_write_ifcfg_to_suse.patch Patch20: dracut-fix-whitespace-add-drivers_call.patch @@ -59,7 +58,8 @@ Patch32: 0020-95udev-rules-Include-correct-sg3_utils-rules.patch Patch33: 0021-90multipath-install-correct-multipath-rules.patch Patch34: add_dracuts_network_params_for_iscsi.patch Patch35: 0022-90multipath-Fixup-service-file-for-booting.patch -Patch36: mkinird_differ_host_and_cmdline_only_properly.patch +Patch36: 0023-mkinitrd-suse.sh-Use-hostonly-and-hostonly-cmdline-c.patch +Patch37: 0024-95iscsi-Set-correct-iscsi_started-value-for-iSCSI-fi.patch BuildRequires: asciidoc BuildRequires: bash BuildRequires: docbook-xsl-stylesheets @@ -116,7 +116,6 @@ and its cryptography during startup. %patch13 -p1 %patch14 -p1 %patch15 -p1 -%patch16 -p1 %patch18 -p1 %patch19 -p1 %patch20 -p1 @@ -134,6 +133,7 @@ and its cryptography during startup. %patch34 -p1 %patch35 -p1 %patch36 -p1 +%patch37 -p1 %build %configure\ diff --git a/fix-iscsi-firmware.patch b/fix-iscsi-firmware.patch deleted file mode 100644 index cbb939f..0000000 --- a/fix-iscsi-firmware.patch +++ /dev/null @@ -1,31 +0,0 @@ -From af3c6eb8a04c2e526061f1dc82a94f01408bb415 Mon Sep 17 00:00:00 2001 -From: Hannes Reinecke -Date: Mon, 7 Apr 2014 16:28:34 +0200 -Subject: [PATCH] 95iscsi: Fix iSCSI firmware path - -Signed-off-by: Hannes Reinecke ---- - modules.d/95iscsi/parse-iscsiroot.sh | 5 ++--- - 1 file changed, 2 insertions(+), 3 deletions(-) - -Index: dracut-037/modules.d/95iscsi/parse-iscsiroot.sh -=================================================================== ---- dracut-037.orig/modules.d/95iscsi/parse-iscsiroot.sh 2014-03-19 17:16:08.000000000 +0100 -+++ dracut-037/modules.d/95iscsi/parse-iscsiroot.sh 2014-04-15 11:49:40.922075002 +0200 -@@ -64,7 +64,6 @@ 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 - - # If it's not iscsi we don't continue -@@ -88,7 +87,7 @@ fi - - if [ -n "$netroot" ] && [ "$root" != "/dev/root" ] && [ "$root" != "dhcp" ]; then - if ! getargbool 1 rd.neednet >/dev/null || ! getarg "ip="; then -- initqueue --onetime --settled "/sbin/iscsiroot dummy '$netroot' '$NEWROOT'" -+ initqueue --settled /sbin/iscsiroot dummy "$netroot" "$NEWROOT" - fi - fi - diff --git a/mkinird_differ_host_and_cmdline_only_properly.patch b/mkinird_differ_host_and_cmdline_only_properly.patch deleted file mode 100644 index abbc40b..0000000 --- a/mkinird_differ_host_and_cmdline_only_properly.patch +++ /dev/null @@ -1,33 +0,0 @@ -Index: dracut-037/mkinitrd-suse.sh -=================================================================== ---- dracut-037.orig/mkinitrd-suse.sh -+++ dracut-037/mkinitrd-suse.sh -@@ -297,7 +297,11 @@ targets=( $targets ) - [[ $kernels ]] && kernels=( $kernels ) - - [[ $logfile ]] && dracut_args="${dracut_args} --logfile $logfile" --[[ $host_only == 1 ]] && dracut_args="${dracut_args} --hostonly" -+if [[ $host_only == 1 ]];then -+ dracut_args="${dracut_args} --hostonly --hostonly-cmdline" -+else -+ dracut_args="${dracut_args} --no-hostonly --no-hostonly-cmdline" -+fi - [[ $force == 1 ]] && dracut_args="${dracut_args} --force" - [[ $dracut_cmdline ]] && dracut_args="${dracut_args} --kernel-cmdline ${dracut_cmdline}" - [ -z "$(type -p update-bootloader)" ] && skip_update_bootloader=1 -Index: dracut-037/mkinitrd-suse.8 -=================================================================== ---- dracut-037.orig/mkinitrd-suse.8 -+++ dracut-037/mkinitrd-suse.8 -@@ -139,7 +139,10 @@ script after the initrd(s) have been cre - .PP - \fB\-A\fR - .RS 4 --Create a so called "monster initrd" which includes all available features and modules\&. -+Create a so called "monster initrd" which includes all available features and -+modules. This calls dracut with \-\-no\-hostonly and \-\-no-hostonly\-cmdline -+parameters internally (instead of \-\-hostonly, \-\-hostonly\-cmdline by -+default).\&. - .RE - .PP - \fB\-v, \-\-verbose\fR