From fe48c9c4e590d7ab905da3307e021b9c48545a9a Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Wed, 4 Sep 2013 13:43:12 +0200 Subject: [PATCH] dracut-032-23.git20130904 - fixed curl error with zero size kickstart file Resolves: rhbz#989133 - fixed systemd-cat failure, when systemd is installed but not actually running Resolves: rhbz#1002021 - do not fail on empty dracut module directories Resolves: rhbz#1003153 --- 0001-network-do-not-depend-on-ifcfg.patch | 35 + ...nctions.sh-add-expand_persistent_dev.patch | 80 + ...lib.sh-handle-0-size-files-with-curl.patch | 23 + 0004-add-dracut.css-for-dracut.html.patch | 1587 +++++++++++++++++ ...ocument-debugging-dracut-on-shutdown.patch | 37 + 0006-freenode-IRC-dracut-verification.patch | 17 + 0007-removed-freenode.txt.patch | 17 + ....sh-use-builtin-bash-functions-rathe.patch | 30 + ....sh-inst_rules-do-not-install-from-e.patch | 34 + 0010-use-var-val-rather-than-var-val.patch | 293 +++ ....sh-get_persistent_dev-do-not-check-.patch | 22 + ...t-parsing-before-all-other-network-c.patch | 64 + ...ck-for-setfont-and-loadkeys-binaries.patch | 25 + ...sh-if-rd.md-0-use-dmraid-for-imsm-an.patch | 32 + ...-mdraid-improve-hostonly-recognition.patch | 108 ++ ....sh-get_devpath_block-make-local-var.patch | 22 + ...ebian-s-resume-is-in-usr-lib-uswsusp.patch | 23 + ...h-check-is-journald.socket-is-active.patch | 26 + ....sh-for_each_module_dir-skip-empty-m.patch | 26 + ...rse-iscsi-parameter-even-if-rootok-1.patch | 23 + 0021-net-lib-ibft_to_cmdline-fixes.patch | 57 + 0022-Rewrite-rootok-and-netroot-logic.patch | 190 ++ dracut.spec | 33 +- 23 files changed, 2803 insertions(+), 1 deletion(-) create mode 100644 0001-network-do-not-depend-on-ifcfg.patch create mode 100644 0002-dracut-functions.sh-add-expand_persistent_dev.patch create mode 100644 0003-url-lib.sh-handle-0-size-files-with-curl.patch create mode 100644 0004-add-dracut.css-for-dracut.html.patch create mode 100644 0005-dracut.asc-document-debugging-dracut-on-shutdown.patch create mode 100644 0006-freenode-IRC-dracut-verification.patch create mode 100644 0007-removed-freenode.txt.patch create mode 100644 0008-dracut-functions.sh-use-builtin-bash-functions-rathe.patch create mode 100644 0009-dracut-functions.sh-inst_rules-do-not-install-from-e.patch create mode 100644 0010-use-var-val-rather-than-var-val.patch create mode 100644 0011-dracut-functions.sh-get_persistent_dev-do-not-check-.patch create mode 100644 0012-network-move-ibft-parsing-before-all-other-network-c.patch create mode 100644 0013-i18n-check-for-setfont-and-loadkeys-binaries.patch create mode 100644 0014-dmraid-parse-dm.sh-if-rd.md-0-use-dmraid-for-imsm-an.patch create mode 100644 0015-dmraid-mdraid-improve-hostonly-recognition.patch create mode 100644 0016-dracut-functions.sh-get_devpath_block-make-local-var.patch create mode 100644 0017-resume-debian-s-resume-is-in-usr-lib-uswsusp.patch create mode 100644 0018-dracut-logger.sh-check-is-journald.socket-is-active.patch create mode 100644 0019-dracut-functions.sh-for_each_module_dir-skip-empty-m.patch create mode 100644 0020-iscsi-parse-iscsi-parameter-even-if-rootok-1.patch create mode 100644 0021-net-lib-ibft_to_cmdline-fixes.patch create mode 100644 0022-Rewrite-rootok-and-netroot-logic.patch diff --git a/0001-network-do-not-depend-on-ifcfg.patch b/0001-network-do-not-depend-on-ifcfg.patch new file mode 100644 index 0000000..d8de123 --- /dev/null +++ b/0001-network-do-not-depend-on-ifcfg.patch @@ -0,0 +1,35 @@ +From f34e1d6b0ecf907066b6083e70d5eac84c2ba2f5 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Tue, 20 Aug 2013 15:09:33 +0200 +Subject: [PATCH] network: do not depend on ifcfg + +rather let ifcfg return 0 if /etc/sysconfig/network-scripts exists +--- + modules.d/40network/module-setup.sh | 1 - + modules.d/45ifcfg/module-setup.sh | 1 + + 2 files changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/40network/module-setup.sh b/modules.d/40network/module-setup.sh +index a5f635d..464e0cb 100755 +--- a/modules.d/40network/module-setup.sh ++++ b/modules.d/40network/module-setup.sh +@@ -16,7 +16,6 @@ check() { + } + + depends() { +- [ -d /etc/sysconfig/network-scripts/ ] && echo ifcfg + return 0 + } + +diff --git a/modules.d/45ifcfg/module-setup.sh b/modules.d/45ifcfg/module-setup.sh +index 3cd0c48..ce53e5e 100755 +--- a/modules.d/45ifcfg/module-setup.sh ++++ b/modules.d/45ifcfg/module-setup.sh +@@ -3,6 +3,7 @@ + # ex: ts=8 sw=4 sts=4 et filetype=sh + + check() { ++ [[ -d /etc/sysconfig/network-scripts ]] && return 0 + return 255 + } + diff --git a/0002-dracut-functions.sh-add-expand_persistent_dev.patch b/0002-dracut-functions.sh-add-expand_persistent_dev.patch new file mode 100644 index 0000000..9962a55 --- /dev/null +++ b/0002-dracut-functions.sh-add-expand_persistent_dev.patch @@ -0,0 +1,80 @@ +From c82a11334d53f26ac158df9bcfca1a4e2ad39ae0 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Tue, 20 Aug 2013 16:01:10 +0200 +Subject: [PATCH] dracut-functions.sh: add expand_persistent_dev() + +also fixes missing '{' for LABEL=... swaps +--- + dracut-functions.sh | 38 +++++++++++++++++++++++++++++++------- + dracut.sh | 3 +-- + 2 files changed, 32 insertions(+), 9 deletions(-) + +diff --git a/dracut-functions.sh b/dracut-functions.sh +index 1d70bd0..6c7e693 100755 +--- a/dracut-functions.sh ++++ b/dracut-functions.sh +@@ -323,19 +323,43 @@ get_persistent_dev() { + done + } + ++expand_persistent_dev() { ++ local _dev=$1 ++ ++ case "$_dev" in ++ LABEL=*) ++ _dev="/dev/disk/by-label/${_dev#LABEL=}" ++ ;; ++ UUID=*) ++ _dev="${_dev#UUID=}" ++ _dev="$(tr "[:upper:]" "[:lower:]" <<< "$_dev" )" ++ _dev="/dev/disk/by-uuid/${_dev}" ++ ;; ++ PARTUUID=*) ++ _dev="${_dev#PARTUUID=}" ++ _dev="$(tr "[:upper:]" "[:lower:]" <<< "$_dev" )" ++ _dev="/dev/disk/by-partuuid/${_dev}" ++ ;; ++ PARTLABEL=*) ++ _dev="/dev/disk/by-partlabel/${_dev#PARTLABEL=}" ++ ;; ++ esac ++ printf "%s" "$_dev" ++} ++ + shorten_persistent_dev() { +- local dev="$1" +- case "$dev" in ++ local _dev="$1" ++ case "$_dev" in + /dev/disk/by-uuid/*) +- printf "%s" "UUID=${dev##*/}";; ++ printf "%s" "UUID=${_dev##*/}";; + /dev/disk/by-label/*) +- printf "%s" "LABEL=${dev##*/}";; ++ printf "%s" "LABEL=${_dev##*/}";; + /dev/disk/by-partuuid/*) +- printf "%s" "PARTUUID=${dev##*/}";; ++ printf "%s" "PARTUUID=${_dev##*/}";; + /dev/disk/by-partlabel/*) +- printf "%s" "PARTLABEL=${dev##*/}";; ++ printf "%s" "PARTLABEL=${_dev##*/}";; + *) +- printf "%s" "$dev";; ++ printf "%s" "$_dev";; + esac + } + +diff --git a/dracut.sh b/dracut.sh +index 117f877..0c42958 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -913,8 +913,7 @@ if [[ $hostonly ]]; then + [[ $_t != "swap" ]] && continue + [[ $_m != "swap" ]] && [[ $_m != "none" ]] && continue + [[ "$_o" == *noauto* ]] && continue +- [[ "$_d" == UUID\=* ]] && _d="/dev/disk/by-uuid/${_d#UUID=}" +- [[ "$_d" == LABEL\=* ]] && _d="/dev/disk/by-label/$_d#LABEL=}" ++ _d=$(expand_persistent_dev "$_d") + [[ "$_d" -ef "$dev" ]] || continue + + if [[ -f /etc/crypttab ]]; then diff --git a/0003-url-lib.sh-handle-0-size-files-with-curl.patch b/0003-url-lib.sh-handle-0-size-files-with-curl.patch new file mode 100644 index 0000000..97cf1a0 --- /dev/null +++ b/0003-url-lib.sh-handle-0-size-files-with-curl.patch @@ -0,0 +1,23 @@ +From 5c274467d6a4959b7f451f9a211ffbb38d69b641 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Tue, 20 Aug 2013 16:15:17 +0200 +Subject: [PATCH] url-lib.sh: handle 0-size files with curl + +https://bugzilla.redhat.com/show_bug.cgi?id=989133#c9 +--- + modules.d/45url-lib/url-lib.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/45url-lib/url-lib.sh b/modules.d/45url-lib/url-lib.sh +index 34d42ba..12df9b4 100755 +--- a/modules.d/45url-lib/url-lib.sh ++++ b/modules.d/45url-lib/url-lib.sh +@@ -64,7 +64,7 @@ curl_fetch_url() { + local url="$1" outloc="$2" + echo "$url" > /proc/self/fd/0 + if [ -n "$outloc" ]; then +- curl $curl_args --output "$outloc" -- "$url" || return $? ++ curl $curl_args --output - -- "$url" > "$outloc" || return $? + else + local outdir="$(mkuniqdir /tmp curl_fetch_url)" + ( cd "$outdir"; curl $curl_args --remote-name "$url" || return $? ) diff --git a/0004-add-dracut.css-for-dracut.html.patch b/0004-add-dracut.css-for-dracut.html.patch new file mode 100644 index 0000000..5d6d630 --- /dev/null +++ b/0004-add-dracut.css-for-dracut.html.patch @@ -0,0 +1,1587 @@ +From bae44febb513a7888f738c9adf5415dd370018e2 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Wed, 21 Aug 2013 13:12:55 +0200 +Subject: [PATCH] add dracut.css for dracut.html + +--- + Makefile | 6 +- + dracut.css | 1550 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 1553 insertions(+), 3 deletions(-) + create mode 100644 dracut.css + +diff --git a/Makefile b/Makefile +index bfd1320..0c4ebc5 100644 +--- a/Makefile ++++ b/Makefile +@@ -76,11 +76,11 @@ endif + %.xml: %.asc + asciidoc -d manpage -b docbook -o $@ $< + +-dracut.html: dracut.asc $(manpages) ++dracut.html: dracut.asc $(manpages) dracut.css + asciidoc -a numbered -d book -b docbook -o dracut.xml dracut.asc + xsltproc -o dracut.html --xinclude -nonet \ +- --stringparam html.stylesheet \ +- http://docs.fedoraproject.org/en-US/Common_Content/css/default.css \ ++ --stringparam custom.css.source dracut.css \ ++ --stringparam generate.css.header 1 \ + http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl dracut.xml + rm -f -- dracut.xml + +diff --git a/dracut.css b/dracut.css +new file mode 100644 +index 0000000..e419a06 +--- /dev/null ++++ b/dracut.css +@@ -0,0 +1,1550 @@ ++ ++ +\ No newline at end of file diff --git a/0005-dracut.asc-document-debugging-dracut-on-shutdown.patch b/0005-dracut.asc-document-debugging-dracut-on-shutdown.patch new file mode 100644 index 0000000..429a531 --- /dev/null +++ b/0005-dracut.asc-document-debugging-dracut-on-shutdown.patch @@ -0,0 +1,37 @@ +From 39fe00ef600879279f01289007433bd7f9b84dd9 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Thu, 22 Aug 2013 09:39:38 +0200 +Subject: [PATCH] dracut.asc: document debugging dracut on shutdown + +--- + dracut.asc | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +diff --git a/dracut.asc b/dracut.asc +index e0431dc..c011658 100644 +--- a/dracut.asc ++++ b/dracut.asc +@@ -744,6 +744,23 @@ the dracut shell + ==== Additional dracut boot parameters + For more debugging options, see <> in <>. + ++ ++[[debugging-dracut-on-shutdown]] ++==== Debugging dracut on shutdown ++ ++To debug the shutdown sequence on systemd systems, you can _rd.break_ ++on _pre-shutdown_ or _shutdown_. ++ ++To do this from an already booted system: ++---- ++# mkdir -p /run/initramfs/etc/cmdline.d ++# echo "rd.break=pre-shutdown" > /run/initramfs/etc/cmdline.d/debug.conf ++# touch /run/initramfs/.need_shutdown ++---- ++ ++This will give you a dracut shell after the system pivot'ed back in the initramfs. ++ ++ + = Developer Manual + + == dracut Components diff --git a/0006-freenode-IRC-dracut-verification.patch b/0006-freenode-IRC-dracut-verification.patch new file mode 100644 index 0000000..85cc2f7 --- /dev/null +++ b/0006-freenode-IRC-dracut-verification.patch @@ -0,0 +1,17 @@ +From c504d8b4351a5becceec28d98376a301e02ce824 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Thu, 22 Aug 2013 10:14:24 +0200 +Subject: [PATCH] freenode IRC #dracut verification + +--- + freenode.txt | 1 + + 1 file changed, 1 insertion(+) + create mode 100644 freenode.txt + +diff --git a/freenode.txt b/freenode.txt +new file mode 100644 +index 0000000..3ed8941 +--- /dev/null ++++ b/freenode.txt +@@ -0,0 +1 @@ ++bzMuf3ty diff --git a/0007-removed-freenode.txt.patch b/0007-removed-freenode.txt.patch new file mode 100644 index 0000000..790cb37 --- /dev/null +++ b/0007-removed-freenode.txt.patch @@ -0,0 +1,17 @@ +From 49c062821a481ff409ac2d53ed9dd3ed7331eefb Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Thu, 22 Aug 2013 10:24:15 +0200 +Subject: [PATCH] removed freenode.txt + +--- + freenode.txt | 1 - + 1 file changed, 1 deletion(-) + delete mode 100644 freenode.txt + +diff --git a/freenode.txt b/freenode.txt +deleted file mode 100644 +index 3ed8941..0000000 +--- a/freenode.txt ++++ /dev/null +@@ -1 +0,0 @@ +-bzMuf3ty diff --git a/0008-dracut-functions.sh-use-builtin-bash-functions-rathe.patch b/0008-dracut-functions.sh-use-builtin-bash-functions-rathe.patch new file mode 100644 index 0000000..76e5cc2 --- /dev/null +++ b/0008-dracut-functions.sh-use-builtin-bash-functions-rathe.patch @@ -0,0 +1,30 @@ +From 93b02f502e81bf41b7f77b546e3358521b08cd43 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Thu, 22 Aug 2013 10:52:49 +0200 +Subject: [PATCH] dracut-functions.sh: use builtin bash functions rather than + tr + +convert uppercase to lowercase using bash syntax +--- + dracut-functions.sh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/dracut-functions.sh b/dracut-functions.sh +index 6c7e693..87b9769 100755 +--- a/dracut-functions.sh ++++ b/dracut-functions.sh +@@ -332,12 +332,12 @@ expand_persistent_dev() { + ;; + UUID=*) + _dev="${_dev#UUID=}" +- _dev="$(tr "[:upper:]" "[:lower:]" <<< "$_dev" )" ++ _dev="${_dev,,}" + _dev="/dev/disk/by-uuid/${_dev}" + ;; + PARTUUID=*) + _dev="${_dev#PARTUUID=}" +- _dev="$(tr "[:upper:]" "[:lower:]" <<< "$_dev" )" ++ _dev="${_dev,,}" + _dev="/dev/disk/by-partuuid/${_dev}" + ;; + PARTLABEL=*) diff --git a/0009-dracut-functions.sh-inst_rules-do-not-install-from-e.patch b/0009-dracut-functions.sh-inst_rules-do-not-install-from-e.patch new file mode 100644 index 0000000..8b3bebe --- /dev/null +++ b/0009-dracut-functions.sh-inst_rules-do-not-install-from-e.patch @@ -0,0 +1,34 @@ +From ace51ef520090e214bac2f6d98f772da0e36376a Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Thu, 22 Aug 2013 10:53:43 +0200 +Subject: [PATCH] dracut-functions.sh:inst_rules() do not install from /etc in + generic mode + +In generic mode, local configuration should not be part of the image. + +Also handle symlinks for rule files. +--- + dracut-functions.sh | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/dracut-functions.sh b/dracut-functions.sh +index 87b9769..8f32f07 100755 +--- a/dracut-functions.sh ++++ b/dracut-functions.sh +@@ -850,12 +850,14 @@ inst_rule_initqueue() { + inst_rules() { + local _target=/etc/udev/rules.d _rule _found + ++ [[ $hostonly ]] || unset hostonly ++ + inst_dir "${udevdir}/rules.d" + inst_dir "$_target" + for _rule in "$@"; do + if [ "${_rule#/}" = "$_rule" ]; then +- for r in ${udevdir}/rules.d /etc/udev/rules.d; do +- if [[ -f $r/$_rule ]]; then ++ for r in ${udevdir}/rules.d ${hostonly+/etc/udev/rules.d}; do ++ if [[ -e $r/$_rule ]]; then + _found="$r/$_rule" + inst_rule_programs "$_found" + inst_rule_group_owner "$_found" diff --git a/0010-use-var-val-rather-than-var-val.patch b/0010-use-var-val-rather-than-var-val.patch new file mode 100644 index 0000000..2aa1258 --- /dev/null +++ b/0010-use-var-val-rather-than-var-val.patch @@ -0,0 +1,293 @@ +From ffc68f357e95f7c8e9240e45dee2a46a3df567d7 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Thu, 22 Aug 2013 11:24:01 +0200 +Subject: [PATCH] use ${var:+val} rather than ${var+val} + +${var:+val} also catches var="" +--- + 50-dracut.install | 2 +- + dracut-functions.sh | 42 ++++++++++++++++------------------ + dracut.sh | 4 ++-- + modules.d/40network/dhclient-script.sh | 2 +- + modules.d/40network/ifup.sh | 4 ++-- + modules.d/95iscsi/iscsiroot.sh | 14 ++++++------ + modules.d/95nbd/nbdroot.sh | 4 ++-- + modules.d/95nfs/nfs-lib.sh | 2 +- + test/TEST-04-FULL-SYSTEMD/test.sh | 2 +- + test/TEST-50-MULTINIC/test.sh | 2 +- + 10 files changed, 38 insertions(+), 40 deletions(-) + +diff --git a/50-dracut.install b/50-dracut.install +index a0623a1..0282741 100755 +--- a/50-dracut.install ++++ b/50-dracut.install +@@ -22,7 +22,7 @@ done + ret=0 + case "$1" in + add) +- dracut ${noimageifnotneeded+--noimageifnotneeded} "$3"/initrd "$2" ++ dracut ${noimageifnotneeded:+--noimageifnotneeded} "$3"/initrd "$2" + ret=$? + ;; + remove) +diff --git a/dracut-functions.sh b/dracut-functions.sh +index 8f32f07..8a1b73f 100755 +--- a/dracut-functions.sh ++++ b/dracut-functions.sh +@@ -688,37 +688,37 @@ fi + [[ $DRACUT_RESOLVE_LAZY ]] || export DRACUT_RESOLVE_DEPS=1 + inst_dir() { + [[ -e ${initdir}/"$1" ]] && return 0 # already there +- $DRACUT_INSTALL ${initdir+-D "$initdir"} -d "$@" +- (($? != 0)) && derror $DRACUT_INSTALL ${initdir+-D "$initdir"} -d "$@" || : ++ $DRACUT_INSTALL ${initdir:+-D "$initdir"} -d "$@" ++ (($? != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} -d "$@" || : + } + + inst() { + [[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there + #dinfo "$DRACUT_INSTALL -l $@" +- $DRACUT_INSTALL ${initdir+-D "$initdir"} ${DRACUT_RESOLVE_DEPS+-l} ${DRACUT_FIPS_MODE+-H} "$@" +- (($? != 0)) && derror $DRACUT_INSTALL ${initdir+-D "$initdir"} ${DRACUT_RESOLVE_DEPS+-l} ${DRACUT_FIPS_MODE+-H} "$@" || : ++ $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-H} "$@" ++ (($? != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-H} "$@" || : + } + + inst_simple() { + [[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there + [[ -e $1 ]] || return 1 # no source +- $DRACUT_INSTALL ${initdir+-D "$initdir"} "$@" +- (($? != 0)) && derror $DRACUT_INSTALL ${initdir+-D "$initdir"} "$@" || : ++ $DRACUT_INSTALL ${initdir:+-D "$initdir"} "$@" ++ (($? != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} "$@" || : + } + + inst_symlink() { + [[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there + [[ -L $1 ]] || return 1 +- $DRACUT_INSTALL ${initdir+-D "$initdir"} ${DRACUT_RESOLVE_DEPS+-l} ${DRACUT_FIPS_MODE+-H} "$@" +- (($? != 0)) && derror $DRACUT_INSTALL ${initdir+-D "$initdir"} ${DRACUT_RESOLVE_DEPS+-l} ${DRACUT_FIPS_MODE+-H} "$@" || : ++ $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-H} "$@" ++ (($? != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-H} "$@" || : + } + + inst_multiple() { + local ret + #dinfo "initdir=$initdir $DRACUT_INSTALL -l $@" +- $DRACUT_INSTALL ${initdir+-D "$initdir"} -a ${DRACUT_RESOLVE_DEPS+-l} ${DRACUT_FIPS_MODE+-H} "$@" ++ $DRACUT_INSTALL ${initdir:+-D "$initdir"} -a ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-H} "$@" + ret=$? +- (($ret != 0)) && derror $DRACUT_INSTALL ${initdir+-D "$initdir"} -a ${DRACUT_RESOLVE_DEPS+-l} ${DRACUT_FIPS_MODE+-H} "$@" || : ++ (($ret != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} -a ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-H} "$@" || : + return $ret + } + +@@ -729,18 +729,18 @@ dracut_install() { + inst_library() { + [[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there + [[ -e $1 ]] || return 1 # no source +- $DRACUT_INSTALL ${initdir+-D "$initdir"} ${DRACUT_RESOLVE_DEPS+-l} ${DRACUT_FIPS_MODE+-H} "$@" +- (($? != 0)) && derror $DRACUT_INSTALL ${initdir+-D "$initdir"} ${DRACUT_RESOLVE_DEPS+-l} ${DRACUT_FIPS_MODE+-H} "$@" || : ++ $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-H} "$@" ++ (($? != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-H} "$@" || : + } + + inst_binary() { +- $DRACUT_INSTALL ${initdir+-D "$initdir"} ${DRACUT_RESOLVE_DEPS+-l} ${DRACUT_FIPS_MODE+-H} "$@" +- (($? != 0)) && derror $DRACUT_INSTALL ${initdir+-D "$initdir"} ${DRACUT_RESOLVE_DEPS+-l} ${DRACUT_FIPS_MODE+-H} "$@" || : ++ $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-H} "$@" ++ (($? != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-H} "$@" || : + } + + inst_script() { +- $DRACUT_INSTALL ${initdir+-D "$initdir"} ${DRACUT_RESOLVE_DEPS+-l} ${DRACUT_FIPS_MODE+-H} "$@" +- (($? != 0)) && derror $DRACUT_INSTALL ${initdir+-D "$initdir"} ${DRACUT_RESOLVE_DEPS+-l} ${DRACUT_FIPS_MODE+-H} "$@" || : ++ $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-H} "$@" ++ (($? != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-H} "$@" || : + } + + # find symlinks linked to given library file +@@ -850,13 +850,11 @@ inst_rule_initqueue() { + inst_rules() { + local _target=/etc/udev/rules.d _rule _found + +- [[ $hostonly ]] || unset hostonly +- + inst_dir "${udevdir}/rules.d" + inst_dir "$_target" + for _rule in "$@"; do + if [ "${_rule#/}" = "$_rule" ]; then +- for r in ${udevdir}/rules.d ${hostonly+/etc/udev/rules.d}; do ++ for r in ${udevdir}/rules.d ${hostonly:+/etc/udev/rules.d}; do + if [[ -e $r/$_rule ]]; then + _found="$r/$_rule" + inst_rule_programs "$_found" +@@ -1388,7 +1386,7 @@ dracut_kernel_post() { + local _pid + + if [[ $DRACUT_KERNEL_LAZY_HASHDIR ]] && [[ -f "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist" ]]; then +- xargs -r modprobe -a ${_moddirname+-d ${_moddirname}/} \ ++ xargs -r modprobe -a ${_moddirname:+-d ${_moddirname}/} \ + --ignore-install --show-depends --set-version $kernel \ + < "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist" 2>/dev/null \ + | sort -u \ +@@ -1399,7 +1397,7 @@ dracut_kernel_post() { + + ( + if [[ $DRACUT_INSTALL ]] && [[ -z $_moddirname ]]; then +- xargs -r $DRACUT_INSTALL ${initdir+-D "$initdir"} -a < "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist.dep" ++ xargs -r $DRACUT_INSTALL ${initdir:+-D "$initdir"} -a < "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist.dep" + else + while read _modpath; do + local _destpath=$_modpath +@@ -1418,7 +1416,7 @@ dracut_kernel_post() { + for _fwdir in $fw_dir; do + echo $_fwdir/$line; + done; +- done | xargs -r $DRACUT_INSTALL ${initdir+-D "$initdir"} -a -o ++ done | xargs -r $DRACUT_INSTALL ${initdir:+-D "$initdir"} -a -o + else + for _fw in $(xargs -r modinfo -k $kernel -F firmware < "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist.dep"); do + for _fwdir in $fw_dir; do +diff --git a/dracut.sh b/dracut.sh +index 0c42958..7ad9d1e 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -729,7 +729,7 @@ fi + + if ! [[ $print_cmdline ]]; then + inst /bin/sh +- if ! $DRACUT_INSTALL ${initdir+-D "$initdir"} -R "$initdir/bin/sh" &>/dev/null; then ++ if ! $DRACUT_INSTALL ${initdir:+-D "$initdir"} -R "$initdir/bin/sh" &>/dev/null; then + unset DRACUT_RESOLVE_LAZY + export DRACUT_RESOLVE_DEPS=1 + fi +@@ -1184,7 +1184,7 @@ if [[ $kernel_only != yes ]]; then + find "$initdir" -type f \ + '(' -perm -0100 -or -perm -0010 -or -perm -0001 ')' \ + -not -path '*.ko' -print0 \ +- | xargs -r -0 $DRACUT_INSTALL ${initdir+-D "$initdir"} -R ${DRACUT_FIPS_MODE+-H} -- ++ | xargs -r -0 $DRACUT_INSTALL ${initdir:+-D "$initdir"} -R ${DRACUT_FIPS_MODE:+-H} -- + dinfo "*** Resolving executable dependencies done***" + fi + fi +diff --git a/modules.d/40network/dhclient-script.sh b/modules.d/40network/dhclient-script.sh +index f04b83d..07c3d9b 100755 +--- a/modules.d/40network/dhclient-script.sh ++++ b/modules.d/40network/dhclient-script.sh +@@ -42,7 +42,7 @@ setup_interface() { + + # Note: hostname can be fqdn OR short hostname, so chop off any + # trailing domain name and explicity add any domain if set. +- [ -n "$hostname" ] && echo "echo ${hostname%.$domain}${domain+.$domain} > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname ++ [ -n "$hostname" ] && echo "echo ${hostname%.$domain}${domain:+.$domain} > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname + } + + PATH=/usr/sbin:/usr/bin:/sbin:/bin +diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh +index 32f0ff2..f9e1669 100755 +--- a/modules.d/40network/ifup.sh ++++ b/modules.d/40network/ifup.sh +@@ -124,10 +124,10 @@ do_static() { + [ -n "$mtu" ] && ip link set mtu $mtu dev $netif + if strstr $ip '*:*:*'; then + # note no ip addr flush for ipv6 +- ip addr add $ip/$mask ${srv+peer $srv} dev $netif ++ ip addr add $ip/$mask ${srv:+peer $srv} dev $netif + else + ip addr flush dev $netif +- ip addr add $ip/$mask ${srv+peer $srv} brd + dev $netif ++ ip addr add $ip/$mask ${srv:+peer $srv} brd + dev $netif + fi + + [ -n "$gw" ] && echo ip route add default via $gw dev $netif > /tmp/net.$netif.gw +diff --git a/modules.d/95iscsi/iscsiroot.sh b/modules.d/95iscsi/iscsiroot.sh +index 0c04219..5181f52 100755 +--- a/modules.d/95iscsi/iscsiroot.sh ++++ b/modules.d/95iscsi/iscsiroot.sh +@@ -96,7 +96,7 @@ handle_netroot() + # XXX is this needed? + getarg ro && iscsirw=ro + getarg rw && iscsirw=rw +- fsopts=${fsopts+$fsopts,}${iscsirw} ++ fsopts=${fsopts:+$fsopts,}${iscsirw} + + if [ -z $iscsi_initiator ]; then + # XXX Where are these from? +@@ -155,12 +155,12 @@ handle_netroot() + iscsistart -i $iscsi_initiator -t $iscsi_target_name \ + -g $iscsi_target_group -a $iscsi_target_ip \ + -p $iscsi_target_port \ +- ${iscsi_username+-u $iscsi_username} \ +- ${iscsi_password+-w $iscsi_password} \ +- ${iscsi_in_username+-U $iscsi_in_username} \ +- ${iscsi_in_password+-W $iscsi_in_password} \ +- ${iscsi_iface_name+--param iface.iscsi_ifacename=$iscsi_iface_name} \ +- ${iscsi_netdev_name+--param iface.net_ifacename=$iscsi_netdev_name} \ ++ ${iscsi_username:+-u $iscsi_username} \ ++ ${iscsi_password:+-w $iscsi_password} \ ++ ${iscsi_in_username:+-U $iscsi_in_username} \ ++ ${iscsi_in_password:+-W $iscsi_in_password} \ ++ ${iscsi_iface_name:+--param iface.iscsi_ifacename=$iscsi_iface_name} \ ++ ${iscsi_netdev_name:+--param iface.net_ifacename=$iscsi_netdev_name} \ + ${iscsi_param} \ + || : + +diff --git a/modules.d/95nbd/nbdroot.sh b/modules.d/95nbd/nbdroot.sh +index 1a1ed54..823da0e 100755 +--- a/modules.d/95nbd/nbdroot.sh ++++ b/modules.d/95nbd/nbdroot.sh +@@ -76,12 +76,12 @@ while [ -n "$nbdflags" ]; do + nbdrw=$f + continue + fi +- fsopts=${fsopts+$fsopts,}$f ++ fsopts=${fsopts:+$fsopts,}$f + done + + getarg ro && nbdrw=ro + getarg rw && nbdrw=rw +-fsopts=${fsopts+$fsopts,}${nbdrw} ++fsopts=${fsopts:+$fsopts,}${nbdrw} + + # XXX better way to wait for the device to be made? + i=0 +diff --git a/modules.d/95nfs/nfs-lib.sh b/modules.d/95nfs/nfs-lib.sh +index 628996c..f5fc56d 100755 +--- a/modules.d/95nfs/nfs-lib.sh ++++ b/modules.d/95nfs/nfs-lib.sh +@@ -128,7 +128,7 @@ mount_nfs() { + nfs_to_var $nfsroot $netif + munge_nfs_options + if [ "$nfs" = "nfs4" ]; then +- options=$options${nfslock+,$nfslock} ++ options=$options${nfslock:+,$nfslock} + else + # NFSv{2,3} doesn't support using locks as it requires a helper to + # transfer the rpcbind state to the new root +diff --git a/test/TEST-04-FULL-SYSTEMD/test.sh b/test/TEST-04-FULL-SYSTEMD/test.sh +index d4998d8..3eeb840 100755 +--- a/test/TEST-04-FULL-SYSTEMD/test.sh ++++ b/test/TEST-04-FULL-SYSTEMD/test.sh +@@ -82,7 +82,7 @@ test_setup() { + inst "$basedir/modules.d/40network/ifup.sh" "/sbin/ifup" + inst_multiple grep + inst_simple ./fstab /etc/fstab +- rpm -ql systemd | xargs -r $DRACUT_INSTALL ${initdir+-D "$initdir"} -o -a -l ++ rpm -ql systemd | xargs -r $DRACUT_INSTALL ${initdir:+-D "$initdir"} -o -a -l + inst /lib/systemd/system/systemd-remount-fs.service + inst /lib/systemd/systemd-remount-fs + inst /lib/systemd/system/systemd-journal-flush.service +diff --git a/test/TEST-50-MULTINIC/test.sh b/test/TEST-50-MULTINIC/test.sh +index b616e6b..7c9d544 100755 +--- a/test/TEST-50-MULTINIC/test.sh ++++ b/test/TEST-50-MULTINIC/test.sh +@@ -20,7 +20,7 @@ run_server() { + -display none \ + -net socket,listen=127.0.0.1:12350 \ + -net nic,macaddr=52:54:01:12:34:56,model=e1000 \ +- ${SERIAL+-serial "$SERIAL"} \ ++ ${SERIAL:+-serial "$SERIAL"} \ + -watchdog i6300esb -watchdog-action poweroff \ + -kernel /boot/vmlinuz-"$KVERSION" \ + -append "loglevel=7 root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0" \ diff --git a/0011-dracut-functions.sh-get_persistent_dev-do-not-check-.patch b/0011-dracut-functions.sh-get_persistent_dev-do-not-check-.patch new file mode 100644 index 0000000..da73854 --- /dev/null +++ b/0011-dracut-functions.sh-get_persistent_dev-do-not-check-.patch @@ -0,0 +1,22 @@ +From 2b9d8f65a6f3fb8141701753ee5cd75f80849cf8 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Fri, 23 Aug 2013 19:04:12 +0200 +Subject: [PATCH] dracut-functions.sh:get_persistent_dev() do not check + non-existent dirs + +--- + dracut-functions.sh | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/dracut-functions.sh b/dracut-functions.sh +index 8a1b73f..c89d816 100755 +--- a/dracut-functions.sh ++++ b/dracut-functions.sh +@@ -313,6 +313,7 @@ get_persistent_dev() { + /dev/disk/by-id/* \ + /dev/disk/by-path/* \ + ; do ++ [[ -e "$i" ]] || continue + [[ $i == /dev/mapper/control ]] && continue + [[ $i == /dev/mapper/mpath* ]] && continue + _tmp=$(get_maj_min "$i") diff --git a/0012-network-move-ibft-parsing-before-all-other-network-c.patch b/0012-network-move-ibft-parsing-before-all-other-network-c.patch new file mode 100644 index 0000000..b3e5166 --- /dev/null +++ b/0012-network-move-ibft-parsing-before-all-other-network-c.patch @@ -0,0 +1,64 @@ +From a242ef13e0c2f5982708d898e063f02e1aa027c5 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Mon, 26 Aug 2013 10:18:47 +0200 +Subject: [PATCH] network: move ibft parsing before all other network cmdline + parser + +otherwise the config produced by ibft will not get processed +--- + modules.d/40network/module-setup.sh | 1 + + modules.d/40network/parse-ibft.sh | 10 ++++++++++ + modules.d/40network/parse-ip-opts.sh | 4 ---- + 3 files changed, 11 insertions(+), 4 deletions(-) + create mode 100755 modules.d/40network/parse-ibft.sh + +diff --git a/modules.d/40network/module-setup.sh b/modules.d/40network/module-setup.sh +index 464e0cb..d2833d0 100755 +--- a/modules.d/40network/module-setup.sh ++++ b/modules.d/40network/module-setup.sh +@@ -82,6 +82,7 @@ install() { + inst_hook pre-udev 50 "$moddir/ifname-genrules.sh" + inst_hook pre-udev 60 "$moddir/net-genrules.sh" + inst_hook cmdline 91 "$moddir/dhcp-root.sh" ++ inst_hook cmdline 92 "$moddir/parse-ibft.sh" + inst_hook cmdline 95 "$moddir/parse-vlan.sh" + inst_hook cmdline 96 "$moddir/parse-bond.sh" + inst_hook cmdline 96 "$moddir/parse-team.sh" +diff --git a/modules.d/40network/parse-ibft.sh b/modules.d/40network/parse-ibft.sh +new file mode 100755 +index 0000000..9776c75 +--- /dev/null ++++ b/modules.d/40network/parse-ibft.sh +@@ -0,0 +1,10 @@ ++#!/bin/sh ++# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- ++# ex: ts=8 sw=4 sts=4 et filetype=sh ++ ++command -v getarg >/dev/null || . /lib/dracut-lib.sh ++command -v ibft_to_cmdline >/dev/null || . /lib/net-lib.sh ++ ++# If ibft is requested, read ibft vals and write ip=XXX cmdline args ++[ "ibft" = "$(getarg ip=)" ] && ibft_to_cmdline ++ +diff --git a/modules.d/40network/parse-ip-opts.sh b/modules.d/40network/parse-ip-opts.sh +index 4ca5098..4bf286d 100755 +--- a/modules.d/40network/parse-ip-opts.sh ++++ b/modules.d/40network/parse-ip-opts.sh +@@ -15,7 +15,6 @@ + # + + command -v getarg >/dev/null || . /lib/dracut-lib.sh +-command -v ibft_to_cmdline >/dev/null || . /lib/net-lib.sh + + if [ -n "$netroot" ] && [ -z "$(getarg ip=)" ] && [ -z "$(getarg BOOTIF=)" ]; then + # No ip= argument(s) for netroot provided, defaulting to DHCP +@@ -39,9 +38,6 @@ if [ -n "$NEEDBOOTDEV" ] ; then + [ -z "$BOOTDEV" ] && warn "Please supply bootdev argument for multiple ip= lines" + fi + +-# If ibft is requested, read ibft vals and write ip=XXX cmdline args +-[ "ibft" = "$(getarg ip=)" ] && ibft_to_cmdline +- + # Check ip= lines + # XXX Would be nice if we could errorcheck ip addresses here as well + for p in $(getargs ip=); do diff --git a/0013-i18n-check-for-setfont-and-loadkeys-binaries.patch b/0013-i18n-check-for-setfont-and-loadkeys-binaries.patch new file mode 100644 index 0000000..3a871f9 --- /dev/null +++ b/0013-i18n-check-for-setfont-and-loadkeys-binaries.patch @@ -0,0 +1,25 @@ +From 87bd8907a64991445af552740806d3949fc6d6ca Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Mon, 26 Aug 2013 10:19:49 +0200 +Subject: [PATCH] i18n: check for setfont and loadkeys binaries + +--- + modules.d/10i18n/module-setup.sh | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/modules.d/10i18n/module-setup.sh b/modules.d/10i18n/module-setup.sh +index be9d90b..2a83728 100755 +--- a/modules.d/10i18n/module-setup.sh ++++ b/modules.d/10i18n/module-setup.sh +@@ -4,6 +4,11 @@ + + check() { + [[ "$mount_needs" ]] && return 1 ++ ++ for i in setfont loadkeys kbd_mode; do ++ type -P "$i" >/dev/null || return 1 ++ done ++ + return 0 + } + diff --git a/0014-dmraid-parse-dm.sh-if-rd.md-0-use-dmraid-for-imsm-an.patch b/0014-dmraid-parse-dm.sh-if-rd.md-0-use-dmraid-for-imsm-an.patch new file mode 100644 index 0000000..aab195b --- /dev/null +++ b/0014-dmraid-parse-dm.sh-if-rd.md-0-use-dmraid-for-imsm-an.patch @@ -0,0 +1,32 @@ +From da119ab18c4813b543f16303a62a6b718c6abcb3 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Mon, 26 Aug 2013 12:46:51 +0200 +Subject: [PATCH] dmraid/parse-dm.sh: if rd.md=0, use dmraid for imsm and ddf + +--- + modules.d/90dmraid/parse-dm.sh | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/modules.d/90dmraid/parse-dm.sh b/modules.d/90dmraid/parse-dm.sh +index 76dfb5d..6d21d4f 100755 +--- a/modules.d/90dmraid/parse-dm.sh ++++ b/modules.d/90dmraid/parse-dm.sh +@@ -7,12 +7,16 @@ if ! getargbool 1 rd.dm -d -n rd_NO_DM || getarg "rd.dm=0" -d nodmraid; then + udevproperty rd_NO_DM=1 + fi + +-if ! command -v mdadm >/dev/null || ! getargbool 1 rd.md.imsm -d -n rd_NO_MDIMSM -n noiswmd; then ++if ! command -v mdadm >/dev/null \ ++ || ! getargbool 1 rd.md.imsm -d -n rd_NO_MDIMSM -n noiswmd \ ++ || ! getargbool 1 rd.md -d -n rd_NO_MD; then + info "rd.md.imsm=0: no MD RAID for imsm/isw raids" + udevproperty rd_NO_MDIMSM=1 + fi + +-if ! command -v mdadm >/dev/null || ! getargbool 1 rd.md.ddf -n rd_NO_MDDDF -n noddfmd; then ++if ! command -v mdadm >/dev/null \ ++ || ! getargbool 1 rd.md.ddf -n rd_NO_MDDDF -n noddfmd \ ++ || ! getargbool 1 rd.md -d -n rd_NO_MD; then + info "rd.md.ddf=0: no MD RAID for SNIA ddf raids" + udevproperty rd_NO_MDDDF=1 + fi diff --git a/0015-dmraid-mdraid-improve-hostonly-recognition.patch b/0015-dmraid-mdraid-improve-hostonly-recognition.patch new file mode 100644 index 0000000..5f3a132 --- /dev/null +++ b/0015-dmraid-mdraid-improve-hostonly-recognition.patch @@ -0,0 +1,108 @@ +From 281327f72cfc4c9ef6308039c7e1da82f79b139f Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Mon, 26 Aug 2013 14:04:56 +0200 +Subject: [PATCH] dmraid/mdraid: improve hostonly recognition + +Factor out get_devpath_block(), which also fixes a dmraid hostonly bug. + +Also only include dmraid and mdraid, if they are actually in use. +--- + dracut-functions.sh | 17 +++++++++++++++++ + modules.d/90dmraid/module-setup.sh | 24 ++++++++++++------------ + modules.d/90mdraid/module-setup.sh | 13 +++++++++++-- + 3 files changed, 40 insertions(+), 14 deletions(-) + +diff --git a/dracut-functions.sh b/dracut-functions.sh +index c89d816..9b24419 100755 +--- a/dracut-functions.sh ++++ b/dracut-functions.sh +@@ -296,6 +296,23 @@ get_maj_min() { + printf "%s" "$((0x${_majmin%:*})):$((0x${_majmin#*:}))" + } + ++ ++# get_devpath_block ++# get the DEVPATH in /sys of a block device ++get_devpath_block() { ++ local majmin i ++ _majmin=$(get_maj_min "$1") ++ ++ for _i in /sys/block/*/dev /sys/block/*/*/dev; do ++ [[ -e "$_i" ]] || continue ++ if [[ "$_majmin" == "$(<"$_i")" ]]; then ++ printf "%s" "${_i%/dev}" ++ return 0 ++ fi ++ done ++ return 1 ++} ++ + # get a persistent path from a device + get_persistent_dev() { + local i _tmp _dev +diff --git a/modules.d/90dmraid/module-setup.sh b/modules.d/90dmraid/module-setup.sh +index 2d73963..11181cf 100755 +--- a/modules.d/90dmraid/module-setup.sh ++++ b/modules.d/90dmraid/module-setup.sh +@@ -9,8 +9,17 @@ check() { + type -P dmraid >/dev/null || return 1 + + [[ $hostonly ]] || [[ $mount_needs ]] && { +- for fs in "${host_fs_types[@]}"; do +- [[ $fs = *_raid_member ]] && return 0 ++ for dev in "${!host_fs_types[@]}"; do ++ [[ "${host_fs_types[$dev]}" != *_raid_member ]] && continue ++ ++ DEVPATH=$(get_devpath_block "$dev") ++ ++ for holder in "$DEVPATH"/holders/*; do ++ [[ -e "$holder" ]] || continue ++ [[ -e "$holder/dm" ]] && return 0 ++ break ++ done ++ + done + return 255 + } +@@ -31,16 +40,7 @@ cmdline() { + local holder DEVPATH DM_NAME majmin + [[ "${host_fs_types[$dev]}" != *_raid_member ]] && continue + +- majmin=$(get_maj_min $dev) +- DEVPATH=$( +- for i in /sys/block/*; do +- [[ -e "$i/dev" ]] || continue +- if [[ $a == $(<"$i/dev") ]]; then +- printf "%s" "$i" +- break +- fi +- done +- ) ++ DEVPATH=$(get_devpath_block "$dev") + + for holder in "$DEVPATH"/holders/*; do + [[ -e "$holder" ]] || continue +diff --git a/modules.d/90mdraid/module-setup.sh b/modules.d/90mdraid/module-setup.sh +index 2bedbfd..5df2274 100755 +--- a/modules.d/90mdraid/module-setup.sh ++++ b/modules.d/90mdraid/module-setup.sh +@@ -8,8 +8,17 @@ check() { + type -P mdadm >/dev/null || return 1 + + [[ $hostonly ]] || [[ $mount_needs ]] && { +- for fs in "${host_fs_types[@]}"; do +- [[ "$fs" == *_raid_member ]] && return 0 ++ for dev in "${!host_fs_types[@]}"; do ++ [[ "${host_fs_types[$dev]}" != *_raid_member ]] && continue ++ ++ DEVPATH=$(get_devpath_block "$dev") ++ ++ for holder in "$DEVPATH"/holders/*; do ++ [[ -e "$holder" ]] || continue ++ [[ -e "$holder/md" ]] && return 0 ++ break ++ done ++ + done + return 255 + } diff --git a/0016-dracut-functions.sh-get_devpath_block-make-local-var.patch b/0016-dracut-functions.sh-get_devpath_block-make-local-var.patch new file mode 100644 index 0000000..e74d5f0 --- /dev/null +++ b/0016-dracut-functions.sh-get_devpath_block-make-local-var.patch @@ -0,0 +1,22 @@ +From 8552a3270caeec41f4610f0081c3d550cb4054eb Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Tue, 27 Aug 2013 11:34:39 +0200 +Subject: [PATCH] dracut-functions.sh:get_devpath_block() make local vars local + +--- + dracut-functions.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dracut-functions.sh b/dracut-functions.sh +index 9b24419..4c62d6b 100755 +--- a/dracut-functions.sh ++++ b/dracut-functions.sh +@@ -300,7 +300,7 @@ get_maj_min() { + # get_devpath_block + # get the DEVPATH in /sys of a block device + get_devpath_block() { +- local majmin i ++ local _majmin _i + _majmin=$(get_maj_min "$1") + + for _i in /sys/block/*/dev /sys/block/*/*/dev; do diff --git a/0017-resume-debian-s-resume-is-in-usr-lib-uswsusp.patch b/0017-resume-debian-s-resume-is-in-usr-lib-uswsusp.patch new file mode 100644 index 0000000..5628487 --- /dev/null +++ b/0017-resume-debian-s-resume-is-in-usr-lib-uswsusp.patch @@ -0,0 +1,23 @@ +From cb73315dd618b828d8d4e395772a05e4835842ab Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Wed, 28 Aug 2013 10:57:23 +0200 +Subject: [PATCH] resume: debian's resume is in /usr/lib/uswsusp + +Hurray! Everybody reinvents the wheel! +--- + modules.d/95resume/module-setup.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/95resume/module-setup.sh b/modules.d/95resume/module-setup.sh +index 7f81049..518ebf0 100755 +--- a/modules.d/95resume/module-setup.sh ++++ b/modules.d/95resume/module-setup.sh +@@ -17,7 +17,7 @@ check() { + install() { + local _bin + # Optional uswsusp support +- for _bin in /usr/sbin/resume /usr/lib/suspend/resume ++ for _bin in /usr/sbin/resume /usr/lib/suspend/resume /usr/lib/uswsusp/resume + do + [[ -x "${_bin}" ]] && { + inst "${_bin}" /usr/sbin/resume diff --git a/0018-dracut-logger.sh-check-is-journald.socket-is-active.patch b/0018-dracut-logger.sh-check-is-journald.socket-is-active.patch new file mode 100644 index 0000000..831cc79 --- /dev/null +++ b/0018-dracut-logger.sh-check-is-journald.socket-is-active.patch @@ -0,0 +1,26 @@ +From 6a877a79c4c94d4e6752c981559ac85f21073973 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Wed, 28 Aug 2013 20:01:54 +0200 +Subject: [PATCH] dracut-logger.sh: check is journald.socket is active + +before using systemd-cat, make sure someone is listening +--- + dracut-logger.sh | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/dracut-logger.sh b/dracut-logger.sh +index 0c505e2..b052581 100755 +--- a/dracut-logger.sh ++++ b/dracut-logger.sh +@@ -141,7 +141,10 @@ dlog_init() { + fi + + if (( $sysloglvl > 0 )); then +- if [[ -d /run/systemd/journal ]] && type -P systemd-cat &>/dev/null && (( $UID == 0 )) ; then ++ if [[ -d /run/systemd/journal ]] \ ++ && type -P systemd-cat &>/dev/null \ ++ && (( $UID == 0 )) \ ++ && systemctl is-active systemd-journald.socket &>/dev/null; then + readonly _dlogdir="$(mktemp --tmpdir="$TMPDIR/" -d -t dracut-log.XXXXXX)" + readonly _systemdcatfile="$_dlogdir/systemd-cat" + mkfifo "$_systemdcatfile" diff --git a/0019-dracut-functions.sh-for_each_module_dir-skip-empty-m.patch b/0019-dracut-functions.sh-for_each_module_dir-skip-empty-m.patch new file mode 100644 index 0000000..8fa9c36 --- /dev/null +++ b/0019-dracut-functions.sh-for_each_module_dir-skip-empty-m.patch @@ -0,0 +1,26 @@ +From 00ed3ccfd910c84d5236f899ccf4fd45fc714197 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Mon, 2 Sep 2013 10:27:46 +0200 +Subject: [PATCH] dracut-functions.sh:for_each_module_dir() skip empty modules + +skip modules, which have no module-setup.sh, install or installkernel + +https://bugzilla.redhat.com/show_bug.cgi?id=1003153 +--- + dracut-functions.sh | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/dracut-functions.sh b/dracut-functions.sh +index 4c62d6b..1d39a6d 100755 +--- a/dracut-functions.sh ++++ b/dracut-functions.sh +@@ -1302,6 +1302,9 @@ for_each_module_dir() { + local _func + _func=$1 + for _moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do ++ [[ -d $_moddir ]] || continue; ++ [[ -e $_moddir/install || -e $_moddir/installkernel || \ ++ -e $_moddir/module-setup.sh ]] || continue + _mod=${_moddir##*/}; _mod=${_mod#[0-9][0-9]} + $_func $_mod 1 + done diff --git a/0020-iscsi-parse-iscsi-parameter-even-if-rootok-1.patch b/0020-iscsi-parse-iscsi-parameter-even-if-rootok-1.patch new file mode 100644 index 0000000..994fc2d --- /dev/null +++ b/0020-iscsi-parse-iscsi-parameter-even-if-rootok-1.patch @@ -0,0 +1,23 @@ +From 5ecc117a25db5d8d1d61953d86f0cbbc0b5e0ef3 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Tue, 3 Sep 2013 15:23:28 +0200 +Subject: [PATCH] iscsi: parse iscsi parameter, even if rootok=1 + +--- + modules.d/95iscsi/parse-iscsiroot.sh | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/modules.d/95iscsi/parse-iscsiroot.sh b/modules.d/95iscsi/parse-iscsiroot.sh +index 286e3dc..e83ef32 100755 +--- a/modules.d/95iscsi/parse-iscsiroot.sh ++++ b/modules.d/95iscsi/parse-iscsiroot.sh +@@ -13,9 +13,6 @@ + # root= takes precedence over netroot= if root=iscsi[...] + # + +-# Don't continue if root is ok +-[ -n "$rootok" ] && return +- + # This script is sourced, so root should be set. But let's be paranoid + [ -z "$root" ] && root=$(getarg root=) + [ -z "$netroot" ] && netroot=$(getarg netroot=) diff --git a/0021-net-lib-ibft_to_cmdline-fixes.patch b/0021-net-lib-ibft_to_cmdline-fixes.patch new file mode 100644 index 0000000..5d4c681 --- /dev/null +++ b/0021-net-lib-ibft_to_cmdline-fixes.patch @@ -0,0 +1,57 @@ +From f2cbd4cbd639df9b0f3d9320df491bf23c109edb Mon Sep 17 00:00:00 2001 +From: WANG Chao +Date: Wed, 4 Sep 2013 01:29:58 +0800 +Subject: [PATCH] net-lib: ibft_to_cmdline() fixes + +Fix 3 issues in ibft_to_cmdline(): +- unset local variables at the beginning of each loop +- only write vlan.conf when we write out ip=xxx +- when vlan id is 0, don't write out vlan.conf. Because 0 means untagged + and we don't actually need vlan interface. +--- + modules.d/40network/net-lib.sh | 15 +++++++++------ + 1 file changed, 9 insertions(+), 6 deletions(-) + +diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh +index ca4b393..82c4f72 100644 +--- a/modules.d/40network/net-lib.sh ++++ b/modules.d/40network/net-lib.sh +@@ -203,11 +203,13 @@ fix_bootif() { + } + + ibft_to_cmdline() { +- local iface="" mac="" dev="" +- local dhcp="" ip="" gw="" mask="" hostname="" ++ local iface="" + modprobe -q iscsi_ibft + ( + for iface in /sys/firmware/ibft/ethernet*; do ++ local mac="" dev="" ++ local dhcp="" ip="" gw="" mask="" hostname="" ++ + [ -e ${iface}/mac ] || continue + mac=$(read a < ${iface}/mac; echo $a) + [ -z "$mac" ] && continue +@@ -216,10 +218,6 @@ ibft_to_cmdline() { + [ -e /tmp/net.${dev}.has_ibft_config ] && continue + + [ -e ${iface}/dhcp ] && dhcp=$(read a < ${iface}/dhcp; echo $a) +- if [ -e ${iface}/vlan ]; then +- vlan=$(read a < ${iface}/vlan; echo $a) +- echo "vlan=$vlan:$dev" +- fi + + if [ -n "$dhcp" ]; then + echo "ip=$dev:dhcp" +@@ -244,6 +242,11 @@ ibft_to_cmdline() { + ls -l ${iface} | vinfo + fi + ++ if [ -e ${iface}/vlan ]; then ++ vlan=$(read a < ${iface}/vlan; echo $a) ++ [ "$vlan" -ne "0" ] && echo "vlan=$vlan:$dev" ++ fi ++ + echo $mac > /tmp/net.${dev}.has_ibft_config + done + ) >> /etc/cmdline.d/40-ibft.conf diff --git a/0022-Rewrite-rootok-and-netroot-logic.patch b/0022-Rewrite-rootok-and-netroot-logic.patch new file mode 100644 index 0000000..49fc29b --- /dev/null +++ b/0022-Rewrite-rootok-and-netroot-logic.patch @@ -0,0 +1,190 @@ +From de74e1ef41148f72b572252eaa5a8e4859cfa929 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Wed, 4 Sep 2013 09:45:04 +0200 +Subject: [PATCH] Rewrite "rootok" and "netroot" logic + +Previously if "$rootok" = 1, parsing of netroot command line arguments +was skipped. For multiple netroot arguments, all parse scripts have to +run. + +Previously only the first netroot argument was taken into account for +the parsing scripts. Now every netroot argument is processed. +--- + modules.d/40network/dhcp-root.sh | 16 ++++++++++------ + modules.d/40network/netroot.sh | 1 + + modules.d/95cifs/parse-cifsroot.sh | 16 +++++++--------- + modules.d/95iscsi/parse-iscsiroot.sh | 7 ++++++- + modules.d/95nbd/parse-nbdroot.sh | 12 +++++++----- + modules.d/95nfs/parse-nfsroot.sh | 20 ++++++++++++++------ + 6 files changed, 45 insertions(+), 27 deletions(-) + +diff --git a/modules.d/40network/dhcp-root.sh b/modules.d/40network/dhcp-root.sh +index 85c7f08..f2a04e0 100755 +--- a/modules.d/40network/dhcp-root.sh ++++ b/modules.d/40network/dhcp-root.sh +@@ -2,20 +2,24 @@ + # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- + # ex: ts=8 sw=4 sts=4 et filetype=sh + +-# Don't continue if root is ok +-[ -n "$rootok" ] && return +- + # This script is sourced, so root should be set. But let's be paranoid + [ -z "$root" ] && root=$(getarg root=) +-[ -z "$netroot" ] && netroot=$(getarg netroot=) + +-if [ "$root" = "dhcp" ] || [ "$root" = "dhcp6" ] || [ "$netroot" = "dhcp" ] ; then ++if [ -z "$netroot" ]; then ++ for netroot in $(getargs netroot=); do ++ [ "$netroot" = "dhcp" ] && break ++ [ "$netroot" = "dhcp6" ] && break ++ done ++ [ "$netroot" = "dhcp" ] || [ "$netroot" = "dhcp6" ] || unset netroot ++fi ++ ++if [ "$root" = "dhcp" ] || [ "$root" = "dhcp6" ] || [ "$netroot" = "dhcp" ] || [ "$netroot" = "dhcp6" ]; then + # Tell ip= checker that we need dhcp + NEEDDHCP="1" + + # Done, all good! + rootok=1 +- if [ "$netroot" != "dhcp" ] ; then ++ if [ "$netroot" != "dhcp" ] && [ "$netroot" != "dhcp6" ]; then + netroot=$root + fi + +diff --git a/modules.d/40network/netroot.sh b/modules.d/40network/netroot.sh +index daeb14c..8f6945f 100755 +--- a/modules.d/40network/netroot.sh ++++ b/modules.d/40network/netroot.sh +@@ -51,6 +51,7 @@ if [ -z "$2" ]; then + netroot=$new_root_path + + # FIXME! ++ unset rootok + for f in $hookdir/cmdline/90*.sh; do + [ -f "$f" ] && . "$f"; + done +diff --git a/modules.d/95cifs/parse-cifsroot.sh b/modules.d/95cifs/parse-cifsroot.sh +index f376b16..52d5809 100755 +--- a/modules.d/95cifs/parse-cifsroot.sh ++++ b/modules.d/95cifs/parse-cifsroot.sh +@@ -14,22 +14,20 @@ + type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh + . /lib/cifs-lib.sh + +-#Don't continue if root is ok +-[ -n "$rootok" ] && return +- + # This script is sourced, so root should be set. But let's be paranoid + [ -z "$root" ] && root=$(getarg root=) +-[ -z "$netroot" ] && netroot=$(getarg netroot=) ++ ++if [ -z "$netroot" ]; then ++ for netroot in $(getargs netroot=); do ++ [ "${netroot%%:*}" = "cifs" ] && break ++ done ++ [ "${netroot%%:*}" = "cifs" ] || unset netroot ++fi + + # Root takes precedence over netroot + if [ "${root%%:*}" = "cifs" ] ; then +- +- # Don't continue if root is ok +- [ -n "$rootok" ] && return +- + if [ -n "$netroot" ] ; then + warn "root takes precedence over netroot. Ignoring netroot" +- + fi + netroot=$root + unset root +diff --git a/modules.d/95iscsi/parse-iscsiroot.sh b/modules.d/95iscsi/parse-iscsiroot.sh +index e83ef32..0c8b524 100755 +--- a/modules.d/95iscsi/parse-iscsiroot.sh ++++ b/modules.d/95iscsi/parse-iscsiroot.sh +@@ -15,7 +15,12 @@ + + # This script is sourced, so root should be set. But let's be paranoid + [ -z "$root" ] && root=$(getarg root=) +-[ -z "$netroot" ] && netroot=$(getarg netroot=) ++if [ -z "$netroot" ]; then ++ for netroot in $(getargs netroot=); do ++ [ "${netroot%%:*}" = "iscsi" ] && break ++ done ++ [ "${netroot%%:*}" = "iscsi" ] || unset netroot ++fi + [ -z "$iscsiroot" ] && iscsiroot=$(getarg iscsiroot=) + [ -z "$iscsi_firmware" ] && getargbool 0 rd.iscsi.firmware -y iscsi_firmware && iscsi_firmware="1" + +diff --git a/modules.d/95nbd/parse-nbdroot.sh b/modules.d/95nbd/parse-nbdroot.sh +index ec9e1f6..49c44b6 100755 +--- a/modules.d/95nbd/parse-nbdroot.sh ++++ b/modules.d/95nbd/parse-nbdroot.sh +@@ -26,14 +26,16 @@ netroot_to_var() { + + # This script is sourced, so root should be set. But let's be paranoid + [ -z "$root" ] && root=$(getarg root=) +-[ -z "$netroot" ] && netroot=$(getarg netroot=) ++ ++if [ -z "$netroot" ]; then ++ for netroot in $(getargs netroot=); do ++ [ "${netroot%%:*}" = "nbd" ] && break ++ done ++ [ "${netroot%%:*}" = "nbd" ] || unset netroot ++fi + + # Root takes precedence over netroot + if [ "${root%%:*}" = "nbd" ] ; then +- +- # Don't continue if root is ok +- [ -n "$rootok" ] && return +- + if [ -n "$netroot" ] ; then + warn "root takes precedence over netroot. Ignoring netroot" + +diff --git a/modules.d/95nfs/parse-nfsroot.sh b/modules.d/95nfs/parse-nfsroot.sh +index 283420a..9fc2a8c 100755 +--- a/modules.d/95nfs/parse-nfsroot.sh ++++ b/modules.d/95nfs/parse-nfsroot.sh +@@ -27,18 +27,19 @@ + + type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh + +-#Don't continue if root is ok +-[ -n "$rootok" ] && return +- + # This script is sourced, so root should be set. But let's be paranoid + [ -z "$root" ] && root=$(getarg root=) +-[ -z "$netroot" ] && netroot=$(getarg netroot=) + [ -z "$nfsroot" ] && nfsroot=$(getarg nfsroot=) + ++[ -n "$netroot" ] && oldnetroot="$netroot" ++ + # netroot= cmdline argument must be ignored, but must be used if + # we're inside netroot to parse dhcp root-path + if [ -n "$netroot" ] ; then +- if [ "$netroot" = "$(getarg netroot=)" ] ; then ++ for n in $(getargs netroot=); do ++ [ "$n" = "$netroot" ] && break ++ done ++ if [ "$n" = "$netroot" ]; then + warn "Ignoring netroot argument for NFS" + netroot=$root + fi +@@ -67,7 +68,14 @@ esac + # Continue if nfs + case "${netroot%%:*}" in + nfs|nfs4|/dev/nfs);; +- *) unset netroot; return;; ++ *) ++ if [ -n "$oldnetroot" ]; then ++ netroot="$oldnetroot" ++ else ++ unset netroot ++ fi ++ return ++ ;; + esac + + # Check required arguments diff --git a/dracut.spec b/dracut.spec index 5ece848..5e6f0d4 100644 --- a/dracut.spec +++ b/dracut.spec @@ -10,7 +10,7 @@ Name: dracut Version: 032 -Release: 1%{?dist} +Release: 23.git20130904%{?dist} Summary: Initramfs generator using udev %if 0%{?fedora} || 0%{?rhel} @@ -29,6 +29,28 @@ URL: https://dracut.wiki.kernel.org/ # Source can be generated by # http://git.kernel.org/?p=boot/dracut/dracut.git;a=snapshot;h=%{version};sf=tgz Source0: http://www.kernel.org/pub/linux/utils/boot/dracut/dracut-%{version}.tar.bz2 +Patch1: 0001-network-do-not-depend-on-ifcfg.patch +Patch2: 0002-dracut-functions.sh-add-expand_persistent_dev.patch +Patch3: 0003-url-lib.sh-handle-0-size-files-with-curl.patch +Patch4: 0004-add-dracut.css-for-dracut.html.patch +Patch5: 0005-dracut.asc-document-debugging-dracut-on-shutdown.patch +Patch6: 0006-freenode-IRC-dracut-verification.patch +Patch7: 0007-removed-freenode.txt.patch +Patch8: 0008-dracut-functions.sh-use-builtin-bash-functions-rathe.patch +Patch9: 0009-dracut-functions.sh-inst_rules-do-not-install-from-e.patch +Patch10: 0010-use-var-val-rather-than-var-val.patch +Patch11: 0011-dracut-functions.sh-get_persistent_dev-do-not-check-.patch +Patch12: 0012-network-move-ibft-parsing-before-all-other-network-c.patch +Patch13: 0013-i18n-check-for-setfont-and-loadkeys-binaries.patch +Patch14: 0014-dmraid-parse-dm.sh-if-rd.md-0-use-dmraid-for-imsm-an.patch +Patch15: 0015-dmraid-mdraid-improve-hostonly-recognition.patch +Patch16: 0016-dracut-functions.sh-get_devpath_block-make-local-var.patch +Patch17: 0017-resume-debian-s-resume-is-in-usr-lib-uswsusp.patch +Patch18: 0018-dracut-logger.sh-check-is-journald.socket-is-active.patch +Patch19: 0019-dracut-functions.sh-for_each_module_dir-skip-empty-m.patch +Patch20: 0020-iscsi-parse-iscsi-parameter-even-if-rootok-1.patch +Patch21: 0021-net-lib-ibft_to_cmdline-fixes.patch +Patch22: 0022-Rewrite-rootok-and-netroot-logic.patch BuildRequires: bash git @@ -446,6 +468,15 @@ rm -rf -- $RPM_BUILD_ROOT %endif %changelog +* Wed Sep 04 2013 Harald Hoyer 032-23.git20130904 +- fixed curl error with zero size kickstart file +Resolves: rhbz#989133 +- fixed systemd-cat failure, when systemd is installed + but not actually running +Resolves: rhbz#1002021 +- do not fail on empty dracut module directories +Resolves: rhbz#1003153 + * Tue Aug 20 2013 Harald Hoyer 032-1 - fix for kdump in FIPS mode Resolves: rhbz#920931