From 375fc509c559ff73812ab3f6ca5a66c9794c4e171f17e0e5a60a2d3ead860db6 Mon Sep 17 00:00:00 2001 From: Thomas Renninger Date: Mon, 14 Jul 2014 16:09:29 +0000 Subject: [PATCH] Accepting request 240885 from home:hreinecke:branches:Base:System - Mark all scripts as executable (bnc#887010) * Remove: 0116-81cio_ignore-Mark-scripts-as-executable * Add: 0116-Mark-scripts-as-executable.patch - 95dasd_rules: Enable device before checking type * Add: 0117-95dasd_rules-Enable-the-device-before-checking-devic.patch - 95zfcp_rules: Enable device before checking type * Add: 0118-95zfcp_rules-Enable-the-device-before-checking-devic.patch - Reset IFS variable * Add: 0119-Reset-IFS-variable.patch - Handle module alias properly (bnc#886839) * Add: 0115-Handle-module-alias-properly.patch - 81cio_ignore: Mark scripts as executable (bnc#887010) * Add: 0116-81cio_ignore-Mark-scripts-as-executable.patch - 91zipl: Translate 'ext2' into 'ext4' module * Add: 0114-91zipl-Translate-ext2-3-into-ext4.patch - Enable converting of directory /var/run /var/lock to symlinks (bnc#877680) * Add: 0106-dracut-Enable-converting-of-directory-var-run-var-lo.patch - Fixup typo 'firmare' instead of 'firmware' * Add: 0107-Fixup-typo-firmare-instead-of-firmware.patch - 91zipl: Store commandline correctly * Add: 0108-91zipl-Store-commandline-correctly.patch - 95dasd_rules: Store all devices in commandline * 0109-95dasd_rules-Store-all-devices-in-commandline.patch - 95zfcp_rules: Store all devices in commandline * Add: 0110-95zfcp_rules-Store-all-devices-in-commandline.patch - 90mdraid: Remove line for 'offroot' detection OBS-URL: https://build.opensuse.org/request/show/240885 OBS-URL: https://build.opensuse.org/package/show/Base:System/dracut?expand=0&rev=171 --- ...nverting-of-directory-var-run-var-lo.patch | 163 ++++++++++++++++++ ...xup-typo-firmare-instead-of-firmware.patch | 40 +++++ 0108-91zipl-Store-commandline-correctly.patch | 29 ++++ ...les-Store-all-devices-in-commandline.patch | 33 ++++ ...les-Store-all-devices-in-commandline.patch | 45 +++++ ...id-Remove-line-for-offroot-detection.patch | 25 +++ ...arn-on-invalid-command-for-initqueue.patch | 33 ++++ ...-91zipl-Install-script-as-executable.patch | 59 +++++++ 0114-91zipl-Translate-ext2-3-into-ext4.patch | 45 +++++ 0115-Handle-module-alias-properly.patch | 38 ++++ 0116-Mark-scripts-as-executable.patch | 47 +++++ ...ble-the-device-before-checking-devic.patch | 54 ++++++ ...ble-the-device-before-checking-devic.patch | 54 ++++++ 0119-Reset-IFS-variable.patch | 64 +++++++ dracut.changes | 50 +++++- dracut.spec | 28 +++ 16 files changed, 805 insertions(+), 2 deletions(-) create mode 100644 0106-dracut-Enable-converting-of-directory-var-run-var-lo.patch create mode 100644 0107-Fixup-typo-firmare-instead-of-firmware.patch create mode 100644 0108-91zipl-Store-commandline-correctly.patch create mode 100644 0109-95dasd_rules-Store-all-devices-in-commandline.patch create mode 100644 0110-95zfcp_rules-Store-all-devices-in-commandline.patch create mode 100644 0111-90mdraid-Remove-line-for-offroot-detection.patch create mode 100644 0112-99base-warn-on-invalid-command-for-initqueue.patch create mode 100644 0113-91zipl-Install-script-as-executable.patch create mode 100644 0114-91zipl-Translate-ext2-3-into-ext4.patch create mode 100644 0115-Handle-module-alias-properly.patch create mode 100644 0116-Mark-scripts-as-executable.patch create mode 100644 0117-95dasd_rules-Enable-the-device-before-checking-devic.patch create mode 100644 0118-95zfcp_rules-Enable-the-device-before-checking-devic.patch create mode 100644 0119-Reset-IFS-variable.patch diff --git a/0106-dracut-Enable-converting-of-directory-var-run-var-lo.patch b/0106-dracut-Enable-converting-of-directory-var-run-var-lo.patch new file mode 100644 index 0000000..8fee481 --- /dev/null +++ b/0106-dracut-Enable-converting-of-directory-var-run-var-lo.patch @@ -0,0 +1,163 @@ +From 6cadece6089ef4d4efbfebeb6b23ca3f2429b36c Mon Sep 17 00:00:00 2001 +From: Thomas Renninger +Date: Tue, 8 Jul 2014 17:34:08 +0200 +Subject: dracut: Enable converting of directory /var/run /var/lock to symlinks + to /run + +If /var/run is a directory this module will be added. +After reboot /var/run and /var/lock will be symlinks. +Another initrd re-creation will not include convertfs module anymore. + +bnc#877680 + +Signed-off-by: Thomas Renninger +--- + modules.d/30convertfs/convertfs.sh | 9 ------ + modules.d/30convertfs/convertrunfs.sh | 54 +++++++++++++++++++++++++++++++++++ + modules.d/30convertfs/do-convertfs.sh | 17 +++++++++++ + modules.d/30convertfs/module-setup.sh | 10 +++++-- + 4 files changed, 79 insertions(+), 11 deletions(-) + create mode 100755 modules.d/30convertfs/convertrunfs.sh + +diff --git a/modules.d/30convertfs/convertfs.sh b/modules.d/30convertfs/convertfs.sh +index d717c69..525b1e7 100755 +--- a/modules.d/30convertfs/convertfs.sh ++++ b/modules.d/30convertfs/convertfs.sh +@@ -64,15 +64,6 @@ if [[ ! -e "$testfile" ]]; then + fi + rm -f -- "$testfile" + +-testfile="$ROOT/usr/.usrmovecheck$$" +-rm -f -- "$testfile" +-> "$testfile" +-if [[ ! -e "$testfile" ]]; then +- echo "Cannot write to $ROOT/usr/" +- exit 1 +-fi +-rm -f -- "$testfile" +- + find_mount() { + local dev mnt etc wanted_dev + wanted_dev="$(readlink -e -q $1)" +diff --git a/modules.d/30convertfs/convertrunfs.sh b/modules.d/30convertfs/convertrunfs.sh +new file mode 100755 +index 0000000..52700cd +--- /dev/null ++++ b/modules.d/30convertfs/convertrunfs.sh +@@ -0,0 +1,54 @@ ++#!/bin/bash ++# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- ++# ex: ts=8 sw=4 sts=4 et filetype=sh ++ ++ROOT="$1" ++ ++if [[ ! -d "$ROOT" ]]; then ++ echo "Usage: $0 " ++ exit 1 ++fi ++ ++if [[ "$ROOT" -ef / ]]; then ++ echo "Can't convert the running system." ++ echo "Please boot with 'rd.convertfs' on the kernel command line," ++ echo "to update with the help of the initramfs," ++ echo "or run this script from a rescue system." ++ exit 1 ++fi ++ ++while [[ "$ROOT" != "${ROOT%/}" ]]; do ++ ROOT=${ROOT%/} ++done ++ ++if findmnt "$ROOT" -O ro;then ++ WAS_RO=1 ++ mount $ROOT -o remount,rw ++else ++ WAS_RO=0 ++fi ++ ++testfile="$ROOT/.usrmovecheck$$" ++rm -f -- "$testfile" ++> "$testfile" ++if [[ ! -e "$testfile" ]]; then ++ echo "Cannot write to $ROOT/" ++ exit 1 ++fi ++rm -f -- "$testfile" ++ ++if [ ! -L $ROOT/var/run -a -e $ROOT/var/run ]; then ++ echo "Converting /var/run to symlink" ++ mv -f $ROOT/var/run $ROOT/var/run.runmove~ ++ ln -sfn ../run $ROOT/var/run ++fi ++ ++if [ ! -L $ROOT/var/lock -a -e $ROOT/var/lock ]; then ++ echo "Converting /var/lock to symlink" ++ mv -f $ROOT/var/lock $ROOT/var/lock.lockmove~ ++ ln -sfn ../run/lock $ROOT/var/lock ++fi ++ ++if [ $WAR_RO -eq 1 ];then ++ mount $ROOT -o remount,ro ++fi +diff --git a/modules.d/30convertfs/do-convertfs.sh b/modules.d/30convertfs/do-convertfs.sh +index 99738e3..ef05a06 100755 +--- a/modules.d/30convertfs/do-convertfs.sh ++++ b/modules.d/30convertfs/do-convertfs.sh +@@ -2,10 +2,27 @@ + # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- + # ex: ts=8 sw=4 sts=4 et filetype=sh + ++# This converts all, /usr/bin -> /bin, ... and /var/run -> /run ++# Do not enable by default! + if getargbool 0 rd.convertfs; then ++ info "Converting both /var/run to /run tmpfs and /usr/bin -> /bin" + if getargbool 0 rd.debug; then + bash -x convertfs "$NEWROOT" 2>&1 | vinfo ++ exit 0 + else + convertfs "$NEWROOT" 2>&1 | vinfo ++ exit 0 ++ fi ++fi ++ ++# This only converts /var/run -> /run as tmpfs ++if ! test -L "$NEWROOT"/var/run;then ++ info "Converting /var/run to /run tmpfs" ++ if getargbool 0 rd.debug; then ++ bash -x convertrunfs "$NEWROOT" 2>&1 | vinfo ++ exit 0 ++ else ++ convertrunfs "$NEWROOT" 2>&1 | vinfo ++ exit 0 + fi + fi +diff --git a/modules.d/30convertfs/module-setup.sh b/modules.d/30convertfs/module-setup.sh +index 1e73455..5fead45 100755 +--- a/modules.d/30convertfs/module-setup.sh ++++ b/modules.d/30convertfs/module-setup.sh +@@ -4,8 +4,13 @@ + + # called by dracut + check() { +- [[ $mount_needs ]] && return 1 +- return 255 ++ # Only check for /var/run ++ if test -L /var/run;then ++ return 255 ++ else ++ require_binaries bash find ldconfig mv rm cp ln || return 1 ++ return 0 ++ fi + } + + # called by dracut +@@ -18,5 +23,6 @@ install() { + inst_multiple bash find ldconfig mv rm cp ln + inst_hook pre-pivot 99 "$moddir/do-convertfs.sh" + inst_script "$moddir/convertfs.sh" /usr/bin/convertfs ++ inst_script "$moddir/convertrunfs.sh" /usr/bin/convertrunfs + } + +-- +1.8.4.5 + diff --git a/0107-Fixup-typo-firmare-instead-of-firmware.patch b/0107-Fixup-typo-firmare-instead-of-firmware.patch new file mode 100644 index 0000000..e59ad54 --- /dev/null +++ b/0107-Fixup-typo-firmare-instead-of-firmware.patch @@ -0,0 +1,40 @@ +From b723f5fabf7ca5396fbd451e8b2d6ee6b82888c8 Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +Date: Wed, 9 Jul 2014 09:34:35 +0200 +Subject: Fixup typo 'firmare' instead of 'firmware' + +Signed-off-by: Hannes Reinecke +--- + modules.d/95dasd_rules/parse-dasd.sh | 2 +- + modules.d/95zfcp_rules/parse-zfcp.sh | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/modules.d/95dasd_rules/parse-dasd.sh b/modules.d/95dasd_rules/parse-dasd.sh +index 7b6a3d2..bafd053 100755 +--- a/modules.d/95dasd_rules/parse-dasd.sh ++++ b/modules.d/95dasd_rules/parse-dasd.sh +@@ -45,7 +45,7 @@ EOF + } + + if [[ -f /sys/firmware/ipl/ipl_type && +- $( +Date: Thu, 10 Jul 2014 14:55:50 +0200 +Subject: 91zipl: Store commandline correctly + +The 'rd.zipl' command was only printed and never stored in the +initramfs itself. + +Signed-off-by: Hannes Reinecke +--- + modules.d/91zipl/module-setup.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/91zipl/module-setup.sh b/modules.d/91zipl/module-setup.sh +index a8d95c5..84bb41d 100644 +--- a/modules.d/91zipl/module-setup.sh ++++ b/modules.d/91zipl/module-setup.sh +@@ -39,7 +39,7 @@ install() { + if [[ $hostonly_cmdline == "yes" ]] ; then + local _zipl=$(cmdline) + +- [[ $_zipl ]] && printf "%s\n" "$_zipl" ++ [[ $_zipl ]] && printf "%s\n" "$_zipl" > "${initdir}/etc/cmdline.d/91zipl.conf" + fi + dracut_need_initqueue + } +-- +1.8.4.5 + diff --git a/0109-95dasd_rules-Store-all-devices-in-commandline.patch b/0109-95dasd_rules-Store-all-devices-in-commandline.patch new file mode 100644 index 0000000..8394098 --- /dev/null +++ b/0109-95dasd_rules-Store-all-devices-in-commandline.patch @@ -0,0 +1,33 @@ +From 0299c9f31fb0c5794747a6a7f62c32abd9a49754 Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +Date: Thu, 10 Jul 2014 14:56:54 +0200 +Subject: 95dasd_rules: Store all devices in commandline + +'for_each_host_dev_and_slaves' would stop at the first found +device, so the cmdline() call would never list all required +devices. Use 'for_each_host_dev_and_slaves_all' instead and +filter out duplicates. + +Signed-off-by: Hannes Reinecke +--- + modules.d/95dasd_rules/module-setup.sh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/modules.d/95dasd_rules/module-setup.sh b/modules.d/95dasd_rules/module-setup.sh +index e4736a2..78a7a66 100755 +--- a/modules.d/95dasd_rules/module-setup.sh ++++ b/modules.d/95dasd_rules/module-setup.sh +@@ -14,8 +14,8 @@ cmdline() { + return 0 + } + [[ $hostonly ]] || [[ $mount_needs ]] && { +- for_each_host_dev_and_slaves is_dasd || return 255 +- } ++ for_each_host_dev_and_slaves_all is_dasd || return 255 ++ } | sort | uniq + } + + # called by dracut +-- +1.8.4.5 + diff --git a/0110-95zfcp_rules-Store-all-devices-in-commandline.patch b/0110-95zfcp_rules-Store-all-devices-in-commandline.patch new file mode 100644 index 0000000..6326196 --- /dev/null +++ b/0110-95zfcp_rules-Store-all-devices-in-commandline.patch @@ -0,0 +1,45 @@ +From 0be3d022964d54e8ab769ebed4006ba8b8d65078 Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +Date: Thu, 10 Jul 2014 14:56:54 +0200 +Subject: 95zfcp_rules: Store all devices in commandline + +'for_each_host_dev_and_slaves' would stop at the first found +device, so the cmdline() call would never list all required +devices. Use 'for_each_host_dev_and_slaves_all' instead and +filter out duplicates. + +Signed-off-by: Hannes Reinecke +--- + modules.d/95zfcp_rules/module-setup.sh | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/modules.d/95zfcp_rules/module-setup.sh b/modules.d/95zfcp_rules/module-setup.sh +index 3f80754..df13fa1 100755 +--- a/modules.d/95zfcp_rules/module-setup.sh ++++ b/modules.d/95zfcp_rules/module-setup.sh +@@ -16,11 +16,11 @@ cmdline() { + _wwpn=$(cat ${_sdev}/wwpn) + _ccw=$(cat ${_sdev}/hba_id) + echo "rd.zfcp=${_ccw},${_wwpn},${_lun}" +- return 1 ++ return 0 + } + [[ $hostonly ]] || [[ $mount_needs ]] && { +- for_each_host_dev_and_slaves is_zfcp +- } ++ for_each_host_dev_and_slaves_all is_zfcp ++ } | sort | uniq + } + + # called by dracut +@@ -31,6 +31,7 @@ check() { + require_binaries /usr/lib/udev/collect || return 1 + + [[ $hostonly ]] || [[ $mount_needs ]] && { ++ found=0 + for _ccw in /sys/bus/ccw/devices/*/host* ; do + [ -d "$_ccw" ] || continue + found=$(($found+1)); +-- +1.8.4.5 + diff --git a/0111-90mdraid-Remove-line-for-offroot-detection.patch b/0111-90mdraid-Remove-line-for-offroot-detection.patch new file mode 100644 index 0000000..b72a4fb --- /dev/null +++ b/0111-90mdraid-Remove-line-for-offroot-detection.patch @@ -0,0 +1,25 @@ +From 73c11cd35b563f94b65058aa8b4e01ce3ff6ef8a Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +Date: Thu, 10 Jul 2014 15:52:37 +0200 +Subject: 90mdraid: Remove line for 'offroot' detection + +Feature is not present in SLE12, so remove this line. + +Signed-off-by: Hannes Reinecke +--- + modules.d/90mdraid/parse-md.sh | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/modules.d/90mdraid/parse-md.sh b/modules.d/90mdraid/parse-md.sh +index dd7bda2..947dbd4 100755 +--- a/modules.d/90mdraid/parse-md.sh ++++ b/modules.d/90mdraid/parse-md.sh +@@ -52,5 +52,3 @@ if ! getargbool 1 rd.md.ddf -n rd_NO_MDDDF -n noddfmd -n nodmraid; then + info "no MD RAID for SNIA ddf raids" + udevproperty rd_NO_MDDDF=1 + fi +- +-strstr "$(mdadm --help-options 2>&1)" offroot && udevproperty rd_MD_OFFROOT=--offroot +-- +1.8.4.5 + diff --git a/0112-99base-warn-on-invalid-command-for-initqueue.patch b/0112-99base-warn-on-invalid-command-for-initqueue.patch new file mode 100644 index 0000000..9bf89f3 --- /dev/null +++ b/0112-99base-warn-on-invalid-command-for-initqueue.patch @@ -0,0 +1,33 @@ +From 6d4c7a328cab1c6cda1aedb4a2149e9227c108f0 Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +Date: Thu, 10 Jul 2014 15:56:53 +0200 +Subject: 99base: warn on invalid command for initqueue + +When 'initqueue' is called with an invalid command it'll generate +invalid job scripts. This will lead to confusing error messages +later on. +So abort in these cases and print out a warning. + +Signed-off-by: Hannes Reinecke +--- + modules.d/99base/initqueue.sh | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/modules.d/99base/initqueue.sh b/modules.d/99base/initqueue.sh +index 854a36a..cbf6fa2 100755 +--- a/modules.d/99base/initqueue.sh ++++ b/modules.d/99base/initqueue.sh +@@ -44,6 +44,10 @@ exe=$1 + shift + + [ -x "$exe" ] || exe=$(command -v $exe) ++if [ -z "$exe" ] ; then ++ echo "Invalid command" ++ exit 1 ++fi + + { + [ -n "$onetime" ] && echo '[ -e "$job" ] && rm -f -- "$job"' +-- +1.8.4.5 + diff --git a/0113-91zipl-Install-script-as-executable.patch b/0113-91zipl-Install-script-as-executable.patch new file mode 100644 index 0000000..6674116 --- /dev/null +++ b/0113-91zipl-Install-script-as-executable.patch @@ -0,0 +1,59 @@ +From 488cf7ad86eee4cd9138d5e58c1baefeeb5e8c98 Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +Date: Thu, 10 Jul 2014 15:58:24 +0200 +Subject: 91zipl: Install script as executable + +initqueue will only work with executable scripts, so we need to +mark it as such. + +Signed-off-by: Hannes Reinecke +--- + modules.d/91zipl/install_zipl_cmdline.sh | 2 +- + modules.d/91zipl/module-setup.sh | 2 +- + modules.d/91zipl/parse-zipl.sh | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + mode change 100644 => 100755 modules.d/91zipl/install_zipl_cmdline.sh + +diff --git a/modules.d/91zipl/install_zipl_cmdline.sh b/modules.d/91zipl/install_zipl_cmdline.sh +old mode 100644 +new mode 100755 +index 8b454b8..3e939c1 +--- a/modules.d/91zipl/install_zipl_cmdline.sh ++++ b/modules.d/91zipl/install_zipl_cmdline.sh +@@ -1,6 +1,6 @@ + #!/bin/bash + +-DEV=$1 ++DEV="$1" + MNT=/boot/zipl + + if [ -z "$DEV" ] ; then +diff --git a/modules.d/91zipl/module-setup.sh b/modules.d/91zipl/module-setup.sh +index 84bb41d..eda4c32 100644 +--- a/modules.d/91zipl/module-setup.sh ++++ b/modules.d/91zipl/module-setup.sh +@@ -35,7 +35,7 @@ install() { + inst_multiple mount umount + + inst_hook cmdline 91 "$moddir/parse-zipl.sh" +- inst "${moddir}/install_zipl_cmdline.sh" /sbin/install_zipl_cmdline.sh ++ inst_script "${moddir}/install_zipl_cmdline.sh" /sbin/install_zipl_cmdline.sh + if [[ $hostonly_cmdline == "yes" ]] ; then + local _zipl=$(cmdline) + +diff --git a/modules.d/91zipl/parse-zipl.sh b/modules.d/91zipl/parse-zipl.sh +index f8c2ca4..308f228 100644 +--- a/modules.d/91zipl/parse-zipl.sh ++++ b/modules.d/91zipl/parse-zipl.sh +@@ -31,7 +31,7 @@ if [ -n "$zipl_arg" ] ; then + esac + if [ "$zipl_env" ] ; then + { +- printf 'ACTION=="add|change", SUBSYSTEM=="block", %s=="%s", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/install_zipl_cmdline.sh %s"\n' \ ++ printf 'ACTION=="add|change", SUBSYSTEM=="block", %s=="%s", RUN+="/sbin/initqueue --settled --onetime --unique --name install_zipl_cmdline /sbin/install_zipl_cmdline.sh %s"\n' \ + ${zipl_env} ${zipl_val} ${zipl_arg} + echo "[ -f /tmp/install.zipl.cmdline-done ]" >$hookdir/initqueue/finished/wait-zipl-conf.sh + } >> /etc/udev/rules.d/99zipl-conf.rules +-- +1.8.4.5 + diff --git a/0114-91zipl-Translate-ext2-3-into-ext4.patch b/0114-91zipl-Translate-ext2-3-into-ext4.patch new file mode 100644 index 0000000..b1d1c6e --- /dev/null +++ b/0114-91zipl-Translate-ext2-3-into-ext4.patch @@ -0,0 +1,45 @@ +From 12131d99811c9829ed1c19e164f2ef22634ba4e5 Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +Date: Fri, 11 Jul 2014 12:55:55 +0200 +Subject: 91zipl: Translate 'ext2/3' into ext4 + +91zipl tries to read the filesystem for the /boot/zipl device. +On SLE12, however, the ext2 and ext3 filesystems are handled +by the ext4 module. +And due to bug#886839 no error is registered and booting fails. +So implement a band-aid to translate it into ext4. + +Signed-off-by: Hannes Reinecke +--- + modules.d/91zipl/module-setup.sh | 15 ++++++++++++++- + 1 file changed, 14 insertions(+), 1 deletion(-) + +diff --git a/modules.d/91zipl/module-setup.sh b/modules.d/91zipl/module-setup.sh +index eda4c32..9fe6acc 100644 +--- a/modules.d/91zipl/module-setup.sh ++++ b/modules.d/91zipl/module-setup.sh +@@ -17,7 +17,20 @@ depends() { + + # called by dracut + installkernel() { +- instmods ext2 ++ local _boot_zipl ++ ++ _boot_zipl=$(sed -n 's/\(.*\)\w*\/boot\/zipl.*/\1/p' /etc/fstab) ++ if [ -n "$_boot_zipl" ] ; then ++ eval $(blkid -s TYPE -o udev ${_boot_zipl}) ++ if [ -n "$ID_FS_TYPE" ] ; then ++ case "$ID_FS_TYPE" in ++ ext?) ++ ID_FS_TYPE=ext4 ++ ;; ++ esac ++ instmods ${ID_FS_TYPE} ++ fi ++ fi + } + + # called by dracut +-- +1.8.4.5 + diff --git a/0115-Handle-module-alias-properly.patch b/0115-Handle-module-alias-properly.patch new file mode 100644 index 0000000..e270134 --- /dev/null +++ b/0115-Handle-module-alias-properly.patch @@ -0,0 +1,38 @@ +From 40556c48da1f7f15ad0eb727013589f6f45596f8 Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +Date: Sat, 12 Jul 2014 14:53:00 +0200 +Subject: Handle module alias properly + +Some modules (like ext4) provide aliases by which the modules +can be accessed, too. But when using aliases directly dracut +fails to include the correct module. So translate the alias +into the correct module name before checking the module. + +References: bnc#886839 + +Signed-off-by: Hannes Reinecke +--- + dracut-functions.sh | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/dracut-functions.sh b/dracut-functions.sh +index b6247f5..22e16ff 100755 +--- a/dracut-functions.sh ++++ b/dracut-functions.sh +@@ -1666,6 +1666,13 @@ instmods() { + --*) _mpargs+=" $_mod" ;; + *) + _mod=${_mod##*/} ++ # Check for aliased modules ++ _modalias=$(modinfo -k $kernel -F filename $_mod 2> /dev/null) ++ _modalias=${_modalias%.ko} ++ if [ "${_modalias##*/}" != "$_mod" ] ; then ++ _mod=${_modalias##*/} ++ fi ++ + # if we are already installed, skip this module and go on + # to the next one. + if [[ $DRACUT_KERNEL_LAZY_HASHDIR ]] && \ +-- +1.8.4.5 + diff --git a/0116-Mark-scripts-as-executable.patch b/0116-Mark-scripts-as-executable.patch new file mode 100644 index 0000000..bce5f39 --- /dev/null +++ b/0116-Mark-scripts-as-executable.patch @@ -0,0 +1,47 @@ +From 941b55f8d9d50b3ba20ba0a2bb64c7509d38ee72 Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +Date: Sat, 12 Jul 2014 14:55:35 +0200 +Subject: Mark scripts as executable + +All scripts need to be marked as executable, otherwise dracut +won't be running them. + +References: bnc#887010 + +Signed-off-by: Hannes Reinecke +--- + modules.d/81cio_ignore/module-setup.sh | 0 + modules.d/81cio_ignore/parse-cio_accept.sh | 0 + modules.d/91crypt-loop/module-setup.sh | 0 + modules.d/91zipl/module-setup.sh | 0 + modules.d/91zipl/parse-zipl.sh | 0 + modules.d/95fcoe/lldpad.sh | 0 + 6 files changed, 0 insertions(+), 0 deletions(-) + mode change 100644 => 100755 modules.d/81cio_ignore/module-setup.sh + mode change 100644 => 100755 modules.d/81cio_ignore/parse-cio_accept.sh + mode change 100644 => 100755 modules.d/91crypt-loop/module-setup.sh + mode change 100644 => 100755 modules.d/91zipl/module-setup.sh + mode change 100644 => 100755 modules.d/91zipl/parse-zipl.sh + mode change 100644 => 100755 modules.d/95fcoe/lldpad.sh + +diff --git a/modules.d/81cio_ignore/module-setup.sh b/modules.d/81cio_ignore/module-setup.sh +old mode 100644 +new mode 100755 +diff --git a/modules.d/81cio_ignore/parse-cio_accept.sh b/modules.d/81cio_ignore/parse-cio_accept.sh +old mode 100644 +new mode 100755 +diff --git a/modules.d/91crypt-loop/module-setup.sh b/modules.d/91crypt-loop/module-setup.sh +old mode 100644 +new mode 100755 +diff --git a/modules.d/91zipl/module-setup.sh b/modules.d/91zipl/module-setup.sh +old mode 100644 +new mode 100755 +diff --git a/modules.d/91zipl/parse-zipl.sh b/modules.d/91zipl/parse-zipl.sh +old mode 100644 +new mode 100755 +diff --git a/modules.d/95fcoe/lldpad.sh b/modules.d/95fcoe/lldpad.sh +old mode 100644 +new mode 100755 +-- +1.8.4.5 + diff --git a/0117-95dasd_rules-Enable-the-device-before-checking-devic.patch b/0117-95dasd_rules-Enable-the-device-before-checking-devic.patch new file mode 100644 index 0000000..bb21f5c --- /dev/null +++ b/0117-95dasd_rules-Enable-the-device-before-checking-devic.patch @@ -0,0 +1,54 @@ +From 22c039c79eb496af10fbc811854e07822b063616 Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +Date: Mon, 14 Jul 2014 10:13:53 +0200 +Subject: 95dasd_rules: Enable the device before checking device type + +For creating dynamic udev rules parse-dasd.sh look for the device +type in sysfs, which of course does not exist if cio_ignore is +active. So first enable the device before checking. + +Signed-off-by: Hannes Reinecke +--- + modules.d/95dasd_rules/parse-dasd.sh | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/modules.d/95dasd_rules/parse-dasd.sh b/modules.d/95dasd_rules/parse-dasd.sh +index bafd053..0c297e5 100755 +--- a/modules.d/95dasd_rules/parse-dasd.sh ++++ b/modules.d/95dasd_rules/parse-dasd.sh +@@ -7,6 +7,10 @@ create_udev_rule() { + local _drv _cu_type _dev_type + local _rule=/etc/udev/rules.d/51-dasd-${ccw}.rules + ++ if [ -x /sbin/cio_ignore ] && cio_ignore -i $ccw > /dev/null ; then ++ cio_ignore -r $ccw ++ fi ++ + if [ -e /sys/bus/ccw/devices/${ccw} ] ; then + read _cu_type < /sys/bus/ccw/devices/${ccw}/cutype + read _dev_type < /sys/bus/ccw/devices/${ccw}/devtype +@@ -31,10 +35,6 @@ create_udev_rule() { + esac + [ -z "${_drv}" ] && return 0 + +- if [ -x /sbin/cio_ignore ] && cio_ignore -i $ccw > /dev/null ; then +- cio_ignore -r $ccw +- fi +- + [ -e ${_rule} ] && return 0 + + cat > $_rule < 0)); do + case $1 in + autodetect|probeonly) +-- +1.8.4.5 + diff --git a/0118-95zfcp_rules-Enable-the-device-before-checking-devic.patch b/0118-95zfcp_rules-Enable-the-device-before-checking-devic.patch new file mode 100644 index 0000000..eb04f2c --- /dev/null +++ b/0118-95zfcp_rules-Enable-the-device-before-checking-devic.patch @@ -0,0 +1,54 @@ +From d4245680ba1cd00a15b86f5ccecd4b8be124f6e5 Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +Date: Mon, 14 Jul 2014 10:17:07 +0200 +Subject: 95zfcp_rules: Enable the device before checking device type + +For creating dynamic udev rules parse-dasd.sh look for the device +type in sysfs, which of course does not exist if cio_ignore is +active. So first enable the device before checking. + +Signed-off-by: Hannes Reinecke +--- + modules.d/95zfcp_rules/parse-zfcp.sh | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/modules.d/95zfcp_rules/parse-zfcp.sh b/modules.d/95zfcp_rules/parse-zfcp.sh +index 00f530f..8db3d9a 100755 +--- a/modules.d/95zfcp_rules/parse-zfcp.sh ++++ b/modules.d/95zfcp_rules/parse-zfcp.sh +@@ -9,6 +9,10 @@ create_udev_rule() { + local _rule=/etc/udev/rules.d/51-zfcp-${ccw}.rules + local _cu_type _dev_type + ++ if [ -x /sbin/cio_ignore ] && cio_ignore -i $ccw > /dev/null ; then ++ cio_ignore -r $ccw ++ fi ++ + if [ -e /sys/bus/ccw/devices/${ccw} ] ; then + read _cu_type < /sys/bus/ccw/devices/${ccw}/cutype + read _dev_type < /sys/bus/ccw/devices/${ccw}/devtype +@@ -20,10 +24,6 @@ create_udev_rule() { + return 0; + fi + +- if [ -x /sbin/cio_ignore ] && cio_ignore -i $ccw > /dev/null ; then +- cio_ignore -r $ccw +- fi +- + [ -e ${_rule} ] && return 0 + + if [ ! -f "$_rule" ] ; then +@@ -54,8 +54,10 @@ fi + + for zfcp_arg in $(getargs rd.zfcp); do + ( ++ local OLDIFS="$IFS" + local IFS="," + set $zfcp_arg ++ IFS="$OLDIFS" + create_udev_rule $1 $2 $3 + ) + done +-- +1.8.4.5 + diff --git a/0119-Reset-IFS-variable.patch b/0119-Reset-IFS-variable.patch new file mode 100644 index 0000000..93df261 --- /dev/null +++ b/0119-Reset-IFS-variable.patch @@ -0,0 +1,64 @@ +From bcfdc4522d2f04d0a1fd46d80a8ac7ff357b8bc5 Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +Date: Mon, 14 Jul 2014 10:22:31 +0200 +Subject: Reset IFS variable + +Setting and unsetting the IFS variable is tricky. To be on the +safe side we should always reset the IFS variable to its original +value after parsing. + +Signed-off-by: Hannes Reinecke +--- + modules.d/95dasd/parse-dasd.sh | 2 ++ + modules.d/95fcoe/parse-fcoe.sh | 2 ++ + modules.d/95zfcp/parse-zfcp.sh | 2 ++ + 3 files changed, 6 insertions(+) + +diff --git a/modules.d/95dasd/parse-dasd.sh b/modules.d/95dasd/parse-dasd.sh +index aba720b..e0d4a9c 100755 +--- a/modules.d/95dasd/parse-dasd.sh ++++ b/modules.d/95dasd/parse-dasd.sh +@@ -3,8 +3,10 @@ + # ex: ts=8 sw=4 sts=4 et filetype=sh + for dasd_arg in $(getargs rd.dasd= -d rd_DASD= DASD=); do + ( ++ local OLDIFS="$IFS" + local IFS="," + set -- $dasd_arg ++ IFS="$OLDIFS" + echo "$@" | normalize_dasd_arg >> /etc/dasd.conf + ) + done +diff --git a/modules.d/95fcoe/parse-fcoe.sh b/modules.d/95fcoe/parse-fcoe.sh +index 8e08303..4ee13cb 100755 +--- a/modules.d/95fcoe/parse-fcoe.sh ++++ b/modules.d/95fcoe/parse-fcoe.sh +@@ -28,8 +28,10 @@ modprobe bnx2fc >/dev/null 2>&1 + udevadm settle --timeout=30 + + parse_fcoe_opts() { ++ local OLDIFS="$IFS" + local IFS=: + set $fcoe ++ IFS="$OLDIFS" + + case $# in + 2) +diff --git a/modules.d/95zfcp/parse-zfcp.sh b/modules.d/95zfcp/parse-zfcp.sh +index 1d21472..df29fb2 100755 +--- a/modules.d/95zfcp/parse-zfcp.sh ++++ b/modules.d/95zfcp/parse-zfcp.sh +@@ -6,8 +6,10 @@ getargbool 1 rd.zfcp.conf -d -n rd_NO_ZFCPCONF || rm /etc/zfcp.conf + + for zfcp_arg in $(getargs rd.zfcp -d 'rd_ZFCP='); do + ( ++ local OLDIFS="$IFS" + local IFS="," + set $zfcp_arg ++ IFS="$OLDIFS" + echo "$@" >> /etc/zfcp.conf + ) + done +-- +1.8.4.5 + diff --git a/dracut.changes b/dracut.changes index bd2df07..fd59eb8 100644 --- a/dracut.changes +++ b/dracut.changes @@ -1,3 +1,51 @@ +------------------------------------------------------------------- +Mon Jul 14 10:35:51 CEST 2014 - hare@suse.de + +- Mark all scripts as executable (bnc#887010) + * Remove: 0116-81cio_ignore-Mark-scripts-as-executable + * Add: 0116-Mark-scripts-as-executable.patch +- 95dasd_rules: Enable device before checking type + * Add: 0117-95dasd_rules-Enable-the-device-before-checking-devic.patch +- 95zfcp_rules: Enable device before checking type + * Add: 0118-95zfcp_rules-Enable-the-device-before-checking-devic.patch +- Reset IFS variable + * Add: 0119-Reset-IFS-variable.patch + +------------------------------------------------------------------- +Sat Jul 12 15:01:04 CEST 2014 - hare@suse.de + +- Handle module alias properly (bnc#886839) + * Add: 0115-Handle-module-alias-properly.patch +- 81cio_ignore: Mark scripts as executable (bnc#887010) + * Add: 0116-81cio_ignore-Mark-scripts-as-executable.patch + +------------------------------------------------------------------- +Fri Jul 11 13:01:08 CEST 2014 - hare@suse.de + +- 91zipl: Translate 'ext2' into 'ext4' module + * Add: 0114-91zipl-Translate-ext2-3-into-ext4.patch + +------------------------------------------------------------------- +Thu Jul 10 13:30:51 CEST 2014 - hare@suse.de + +- Enable converting of directory /var/run /var/lock to symlinks + (bnc#877680) + * Add: 0106-dracut-Enable-converting-of-directory-var-run-var-lo.patch +- Fixup typo 'firmare' instead of 'firmware' + * Add: 0107-Fixup-typo-firmare-instead-of-firmware.patch +- 91zipl: Store commandline correctly + * Add: 0108-91zipl-Store-commandline-correctly.patch +- 95dasd_rules: Store all devices in commandline + * 0109-95dasd_rules-Store-all-devices-in-commandline.patch +- 95zfcp_rules: Store all devices in commandline + * Add: 0110-95zfcp_rules-Store-all-devices-in-commandline.patch +- 90mdraid: Remove line for 'offroot' detection + * Add: 0111-90mdraid-Remove-line-for-offroot-detection.patch +- 99base: warn on invalid command for initqueue + * Add: 0112-99base-warn-on-invalid-command-for-initqueue.patch +- 91zipl: Install script as executable + * Add: 0113-91zipl-Install-script-as-executable.patch + ------------------------------------------------------------------- Tue Jul 8 13:21:14 CEST 2014 - hare@suse.de @@ -11,8 +59,6 @@ Tue Jul 8 13:21:14 CEST 2014 - hare@suse.de * Add: 0104-Generate-fallback-mount-unit-for-root-filesystem.patch - 95iscsi: parse output from iscsiadm correctly (bnc#886199) * Add: 0105-95iscsi-parse-output-from-iscsiadm-correctly.patch -- Add btrfs rescue utilities: - * Add: 0100-Add-btrfs-rescue-utilities.patch ------------------------------------------------------------------- Thu Jul 3 18:16:11 CEST 2014 - dsterba@suse.cz diff --git a/dracut.spec b/dracut.spec index 410be08..ef0a1dc 100644 --- a/dracut.spec +++ b/dracut.spec @@ -126,6 +126,20 @@ Patch102: 0102-Align-dev_unit_name-with-systemd-s-function.patch Patch103: 0103-Fixup-missing-separators-in-rootfs-block-cmdline.patch Patch104: 0104-Generate-fallback-mount-unit-for-root-filesystem.patch Patch105: 0105-95iscsi-parse-output-from-iscsiadm-correctly.patch +Patch106: 0106-dracut-Enable-converting-of-directory-var-run-var-lo.patch +Patch107: 0107-Fixup-typo-firmare-instead-of-firmware.patch +Patch108: 0108-91zipl-Store-commandline-correctly.patch +Patch109: 0109-95dasd_rules-Store-all-devices-in-commandline.patch +Patch110: 0110-95zfcp_rules-Store-all-devices-in-commandline.patch +Patch111: 0111-90mdraid-Remove-line-for-offroot-detection.patch +Patch112: 0112-99base-warn-on-invalid-command-for-initqueue.patch +Patch113: 0113-91zipl-Install-script-as-executable.patch +Patch114: 0114-91zipl-Translate-ext2-3-into-ext4.patch +Patch115: 0115-Handle-module-alias-properly.patch +Patch116: 0116-Mark-scripts-as-executable.patch +Patch117: 0117-95dasd_rules-Enable-the-device-before-checking-devic.patch +Patch118: 0118-95zfcp_rules-Enable-the-device-before-checking-devic.patch +Patch119: 0119-Reset-IFS-variable.patch BuildRequires: asciidoc BuildRequires: bash @@ -272,6 +286,20 @@ and its cryptography during startup. %patch103 -p1 %patch104 -p1 %patch105 -p1 +%patch106 -p1 +%patch107 -p1 +%patch108 -p1 +%patch109 -p1 +%patch110 -p1 +%patch111 -p1 +%patch112 -p1 +%patch113 -p1 +%patch114 -p1 +%patch115 -p1 +%patch116 -p1 +%patch117 -p1 +%patch118 -p1 +%patch119 -p1 %build %configure\