From 414eba6e7584576e71bc7eb9966dfbd422d0a142 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Aug 18 2016 11:30:10 +0000 Subject: dracut-044-109 - git snapshot --- diff --git a/0068-ensure-parent-dir-for-usr-lib-initrd-release-exists.patch b/0068-ensure-parent-dir-for-usr-lib-initrd-release-exists.patch deleted file mode 100644 index 7db08c6..0000000 --- a/0068-ensure-parent-dir-for-usr-lib-initrd-release-exists.patch +++ /dev/null @@ -1,21 +0,0 @@ -From bb44294b62b9469aebaeac8533569ac24b208a45 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= -Date: Wed, 27 Apr 2016 13:08:42 +0300 -Subject: [PATCH] ensure parent dir for /usr/lib/initrd-release exists - ---- - modules.d/99base/module-setup.sh | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/modules.d/99base/module-setup.sh b/modules.d/99base/module-setup.sh -index 5fbf6f7..b03772e 100755 ---- a/modules.d/99base/module-setup.sh -+++ b/modules.d/99base/module-setup.sh -@@ -77,6 +77,7 @@ install() { - VERSION_ID=$DRACUT_VERSION - ANSI_COLOR="0;34" - -+ [ -e "${initdir}/usr/lib" ] || mkdir -m 0755 -p ${initdir}/usr/lib - { - echo NAME=\"$NAME\" - echo VERSION=\"$VERSION\" diff --git a/0068-network-dhcp-before-parsing-specified-dns-through-cm.patch b/0068-network-dhcp-before-parsing-specified-dns-through-cm.patch new file mode 100644 index 0000000..7a2f32c --- /dev/null +++ b/0068-network-dhcp-before-parsing-specified-dns-through-cm.patch @@ -0,0 +1,86 @@ +From cf376023e6d0d4abd9816fa954bb917fc2557713 Mon Sep 17 00:00:00 2001 +From: Xunlei Pang +Date: Tue, 26 Apr 2016 18:05:10 +0800 +Subject: [PATCH] network: dhcp before parsing specified dns through cmdline + +I met a problem when passing kdump dns to dracut via "nameserver=x.x.x.x", +the dns I provided didn't appear in the "/etc/resolv.conf". + +After some debugging, found that when setup dhcp DNS, in setup_interface() +and setup_interface6(), it has: + echo "search $search $domain" > /tmp/net.$netif.resolv.conf + +So if "$search $domain" isn't NULL(this is ture in my kdump environment), +the dns contents(that is, dns1, dns2, nameserver) in "ifup" before dhcp +will be discarded. + +This patch addresses it by handling dhcp first. In fact this is also the +way the NetworkManager in 1st kernel works. + +Signed-off-by: Xunlei Pang +--- + modules.d/40network/ifup.sh | 32 ++++++++++++++++---------------- + 1 file changed, 16 insertions(+), 16 deletions(-) + +diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh +index 1185523..41282e7 100755 +--- a/modules.d/40network/ifup.sh ++++ b/modules.d/40network/ifup.sh +@@ -321,16 +321,16 @@ fi + ip=$(getarg ip) + + if [ -z "$NO_AUTO_DHCP" ] && [ -z "$ip" ]; then +- for s in $(getargs nameserver); do +- [ -n "$s" ] || continue +- echo nameserver $s >> /tmp/net.$netif.resolv.conf +- done +- + if [ "$netroot" = "dhcp6" ]; then + do_dhcp -6 + else + do_dhcp -4 + fi ++ ++ for s in $(getargs nameserver); do ++ [ -n "$s" ] || continue ++ echo nameserver $s >> /tmp/net.$netif.resolv.conf ++ done + fi + + +@@ -355,17 +355,6 @@ for p in $(getargs ip=); do + # If this option isn't directed at our interface, skip it + [ -n "$dev" ] && [ "$dev" != "$netif" ] && continue + +- # setup nameserver +- for s in "$dns1" "$dns2" $(getargs nameserver); do +- [ -n "$s" ] || continue +- echo nameserver $s >> /tmp/net.$netif.resolv.conf +- done +- +- # Store config for later use +- for i in ip srv gw mask hostname macaddr mtu dns1 dns2; do +- eval '[ "$'$i'" ] && echo '$i'="$'$i'"' +- done > /tmp/net.$netif.override +- + for autoopt in $(str_replace "$autoconf" "," " "); do + case $autoopt in + dhcp|on|any) +@@ -381,6 +370,17 @@ for p in $(getargs ip=); do + done + ret=$? + ++ # setup nameserver ++ for s in "$dns1" "$dns2" $(getargs nameserver); do ++ [ -n "$s" ] || continue ++ echo nameserver $s >> /tmp/net.$netif.resolv.conf ++ done ++ ++ # Store config for later use ++ for i in ip srv gw mask hostname macaddr mtu dns1 dns2; do ++ eval '[ "$'$i'" ] && echo '$i'="$'$i'"' ++ done > /tmp/net.$netif.override ++ + if [ $ret -eq 0 ]; then + > /tmp/net.${netif}.up + diff --git a/0069-Fix-small-typo-in-dracut.cmdline-7.patch b/0069-Fix-small-typo-in-dracut.cmdline-7.patch deleted file mode 100644 index daa35b0..0000000 --- a/0069-Fix-small-typo-in-dracut.cmdline-7.patch +++ /dev/null @@ -1,22 +0,0 @@ -From ae753baec0ae5b3c3eeabbe4f70c54cc3c24c292 Mon Sep 17 00:00:00 2001 -From: Ruben Kerkhof -Date: Fri, 29 Apr 2016 15:34:47 +0200 -Subject: [PATCH] Fix small typo in dracut.cmdline(7) - ---- - dracut.cmdline.7.asc | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/dracut.cmdline.7.asc b/dracut.cmdline.7.asc -index c4c5588..bf00719 100644 ---- a/dracut.cmdline.7.asc -+++ b/dracut.cmdline.7.asc -@@ -32,7 +32,7 @@ line is the value, which is honored. - Standard - ~~~~~~~~ - **init=**____:: -- specify the path to the init programm to be started after the initramfs has -+ specify the path to the init program to be started after the initramfs has - finished - - **root=**____:: diff --git a/0069-network-net-lib.sh-delete-duplicated-DNS-items-from-.patch b/0069-network-net-lib.sh-delete-duplicated-DNS-items-from-.patch new file mode 100644 index 0000000..8a338e0 --- /dev/null +++ b/0069-network-net-lib.sh-delete-duplicated-DNS-items-from-.patch @@ -0,0 +1,46 @@ +From 4fa5c235a76c085f5958002826436ed9c40e5034 Mon Sep 17 00:00:00 2001 +From: Xunlei Pang +Date: Tue, 26 Apr 2016 18:05:11 +0800 +Subject: [PATCH] network/net-lib.sh: delete duplicated DNS items from + "/etc/resolv.conf" + +Users can pass the DNS information throught "nameserver=" cmdline, +there maybe duplicated inputs. + +"/etc/resolv.conf" have some restrictions on the number of DNS items +effective, so make sure that this file contains no duplicated items. + +We achieve this by simply making the file have no duplicated lines. + +Signed-off-by: Xunlei Pang +--- + modules.d/40network/module-setup.sh | 2 +- + modules.d/40network/net-lib.sh | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/modules.d/40network/module-setup.sh b/modules.d/40network/module-setup.sh +index 4bf93cc..53b4b60 100755 +--- a/modules.d/40network/module-setup.sh ++++ b/modules.d/40network/module-setup.sh +@@ -23,7 +23,7 @@ installkernel() { + # called by dracut + install() { + local _arch _i _dir +- inst_multiple ip arping dhclient sed ++ inst_multiple ip arping dhclient sed awk + inst_multiple -o ping ping6 + inst_multiple -o brctl + inst_multiple -o teamd teamdctl teamnl +diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh +index 31f1a56..005ad1b 100755 +--- a/modules.d/40network/net-lib.sh ++++ b/modules.d/40network/net-lib.sh +@@ -120,7 +120,7 @@ setup_net() { + [ -e /tmp/dhclient.$netif.dhcpopts ] && . /tmp/dhclient.$netif.dhcpopts + # set up resolv.conf + [ -e /tmp/net.$netif.resolv.conf ] && \ +- cp -f /tmp/net.$netif.resolv.conf /etc/resolv.conf ++ awk '!array[$0]++' /tmp/net.$netif.resolv.conf > /etc/resolv.conf + [ -e /tmp/net.$netif.gw ] && . /tmp/net.$netif.gw + + # add static route diff --git a/0070-ensure-parent-dir-for-usr-lib-initrd-release-exists.patch b/0070-ensure-parent-dir-for-usr-lib-initrd-release-exists.patch new file mode 100644 index 0000000..7db08c6 --- /dev/null +++ b/0070-ensure-parent-dir-for-usr-lib-initrd-release-exists.patch @@ -0,0 +1,21 @@ +From bb44294b62b9469aebaeac8533569ac24b208a45 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= +Date: Wed, 27 Apr 2016 13:08:42 +0300 +Subject: [PATCH] ensure parent dir for /usr/lib/initrd-release exists + +--- + modules.d/99base/module-setup.sh | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/modules.d/99base/module-setup.sh b/modules.d/99base/module-setup.sh +index 5fbf6f7..b03772e 100755 +--- a/modules.d/99base/module-setup.sh ++++ b/modules.d/99base/module-setup.sh +@@ -77,6 +77,7 @@ install() { + VERSION_ID=$DRACUT_VERSION + ANSI_COLOR="0;34" + ++ [ -e "${initdir}/usr/lib" ] || mkdir -m 0755 -p ${initdir}/usr/lib + { + echo NAME=\"$NAME\" + echo VERSION=\"$VERSION\" diff --git a/0070-systemd-ensure-journal-is-volatile.patch b/0070-systemd-ensure-journal-is-volatile.patch deleted file mode 100644 index 5c69f09..0000000 --- a/0070-systemd-ensure-journal-is-volatile.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 5dea430e087ec7749080547a6a6fe5b152f665ef Mon Sep 17 00:00:00 2001 -From: Michael Chapman -Date: Wed, 4 May 2016 10:49:56 +1000 -Subject: [PATCH] systemd: ensure journal is volatile - -If journald.conf already contains Storage=persistent, journald will -write to /var/log/journal/, which ends up at /run/initramfs/log/journal/ -after switching root. We want to make sure early boot logs are written -to /run/log/journal/ so they can be flushed to /var/log/journal/ after -switching root. ---- - modules.d/00systemd/module-setup.sh | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/modules.d/00systemd/module-setup.sh b/modules.d/00systemd/module-setup.sh -index deb5e06..951a5be 100755 ---- a/modules.d/00systemd/module-setup.sh -+++ b/modules.d/00systemd/module-setup.sh -@@ -210,9 +210,10 @@ install() { - done - - mkdir -p "$initdir/etc/systemd" -- # turn off RateLimit for journal -+ # We must use a volatile journal, and we don't want rate-limiting - { - echo "[Journal]" -+ echo "Storage=volatile" - echo "RateLimitInterval=0" - echo "RateLimitBurst=0" - } >> "$initdir/etc/systemd/journald.conf" diff --git a/0071-Fix-small-typo-in-dracut.cmdline-7.patch b/0071-Fix-small-typo-in-dracut.cmdline-7.patch new file mode 100644 index 0000000..daa35b0 --- /dev/null +++ b/0071-Fix-small-typo-in-dracut.cmdline-7.patch @@ -0,0 +1,22 @@ +From ae753baec0ae5b3c3eeabbe4f70c54cc3c24c292 Mon Sep 17 00:00:00 2001 +From: Ruben Kerkhof +Date: Fri, 29 Apr 2016 15:34:47 +0200 +Subject: [PATCH] Fix small typo in dracut.cmdline(7) + +--- + dracut.cmdline.7.asc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dracut.cmdline.7.asc b/dracut.cmdline.7.asc +index c4c5588..bf00719 100644 +--- a/dracut.cmdline.7.asc ++++ b/dracut.cmdline.7.asc +@@ -32,7 +32,7 @@ line is the value, which is honored. + Standard + ~~~~~~~~ + **init=**____:: +- specify the path to the init programm to be started after the initramfs has ++ specify the path to the init program to be started after the initramfs has + finished + + **root=**____:: diff --git a/0071-configure-don-t-hardcode-pkg-config.patch b/0071-configure-don-t-hardcode-pkg-config.patch deleted file mode 100644 index b3b825d..0000000 --- a/0071-configure-don-t-hardcode-pkg-config.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 699414f5a518f039fa74fd314d21994849a90625 Mon Sep 17 00:00:00 2001 -From: Marc-Antoine Perennou -Date: Wed, 4 May 2016 10:18:54 +0200 -Subject: [PATCH] configure: don't hardcode pkg-config - -Signed-off-by: Marc-Antoine Perennou ---- - configure | 8 +++++--- - 1 file changed, 5 insertions(+), 3 deletions(-) - -diff --git a/configure b/configure -index c92cb99..2368680 100755 ---- a/configure -+++ b/configure -@@ -7,6 +7,8 @@ prefix=/usr - - enable_documentation=yes - -+PKG_CONFIG="${PKG_CONFIG:-pkg-config}" -+ - # Little helper function for reading args from the commandline. - # it automatically handles -a b and -a=b variants, and returns 1 if - # we need to shift $3. -@@ -50,7 +52,7 @@ while (($# > 0)); do - shift - done - --if ! pkg-config --exists --print-errors " libkmod >= 15 "; then -+if ! ${PKG_CONFIG} --exists --print-errors " libkmod >= 15 "; then - echo "dracut needs pkg-config and libkmod >= 15." >&2 - exit 1 - fi -@@ -64,8 +66,8 @@ sbindir ?= ${sbindir:-${prefix}/sbin} - mandir ?= ${mandir:-${prefix}/share/man} - enable_documentation ?= ${enable_documentation:-yes} - bindir ?= ${bindir:-${prefix}/bin} --KMOD_CFLAGS ?= $(pkg-config --cflags " libkmod >= 15 ") --KMOD_LIBS ?= $(pkg-config --libs " libkmod >= 15 ") -+KMOD_CFLAGS ?= $(${PKG_CONFIG} --cflags " libkmod >= 15 ") -+KMOD_LIBS ?= $(${PKG_CONFIG} --libs " libkmod >= 15 ") - EOF - - { diff --git a/0072-dracut-systemd-dracut-cmdline.sh-Don-t-error-out-if-.patch b/0072-dracut-systemd-dracut-cmdline.sh-Don-t-error-out-if-.patch deleted file mode 100644 index 20f7339..0000000 --- a/0072-dracut-systemd-dracut-cmdline.sh-Don-t-error-out-if-.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 016613c774baf3d30c6425a65ead05d8b55d6279 Mon Sep 17 00:00:00 2001 -From: Alexander Kurtz -Date: Fri, 6 May 2016 17:25:37 +0200 -Subject: [PATCH] dracut-systemd/dracut-cmdline.sh: Don't error out if there is - no root= argument. - -Thanks to systemd's gpt-auto-generator [0] (which implements the Discoverable -Partitions Specification [1]), it is no longer necessary to always specify the -root= argument. - -However, dracut would still refuse to boot if there was no root= argument (or -if it was set to the special value "gpt-auto" [2]). This commit stops dracut -from aborting the boot process in these cases and simply lets systemd do its -magic. - -[0] https://github.com/systemd/systemd/blob/v229/src/gpt-auto-generator -[1] https://www.freedesktop.org/wiki/Specifications/DiscoverablePartitionsSpec/ -[2] https://github.com/systemd/systemd/blob/v229/src/gpt-auto-generator/gpt-auto-generator.c#L928 ---- - modules.d/98dracut-systemd/dracut-cmdline.sh | 12 ++++++++++-- - 1 file changed, 10 insertions(+), 2 deletions(-) - -diff --git a/modules.d/98dracut-systemd/dracut-cmdline.sh b/modules.d/98dracut-systemd/dracut-cmdline.sh -index a1dcf84..ccf24fb 100755 ---- a/modules.d/98dracut-systemd/dracut-cmdline.sh -+++ b/modules.d/98dracut-systemd/dracut-cmdline.sh -@@ -21,7 +21,12 @@ getargbool 0 rd.udev.log-priority=debug -d rd.udev.debug -d -n -y rdudevdebug && - - source_conf /etc/conf.d - --root=$(getarg root=) -+# Get the "root=" parameter from the kernel command line, but differentiate -+# between the case where it was set to the empty string and the case where it -+# wasn't specified at all. -+if ! root="$(getarg root=)"; then -+ root='UNSET' -+fi - - rflags="$(getarg rootflags=)" - getargbool 0 ro && rflags="${rflags},ro" -@@ -65,9 +70,12 @@ case "$root" in - /dev/*) - root="block:${root}" - rootok=1 ;; -+ UNSET|gpt-auto) -+ # systemd's gpt-auto-generator handles this case. -+ rootok=1 ;; - esac - --[ -z "$root" ] && die "No or empty root= argument" -+[ -z "$root" ] && die "Empty root= argument" - [ -z "$rootok" ] && die "Don't know how to handle 'root=$root'" - - export root rflags fstype netroot NEWROOT diff --git a/0072-systemd-ensure-journal-is-volatile.patch b/0072-systemd-ensure-journal-is-volatile.patch new file mode 100644 index 0000000..5c69f09 --- /dev/null +++ b/0072-systemd-ensure-journal-is-volatile.patch @@ -0,0 +1,30 @@ +From 5dea430e087ec7749080547a6a6fe5b152f665ef Mon Sep 17 00:00:00 2001 +From: Michael Chapman +Date: Wed, 4 May 2016 10:49:56 +1000 +Subject: [PATCH] systemd: ensure journal is volatile + +If journald.conf already contains Storage=persistent, journald will +write to /var/log/journal/, which ends up at /run/initramfs/log/journal/ +after switching root. We want to make sure early boot logs are written +to /run/log/journal/ so they can be flushed to /var/log/journal/ after +switching root. +--- + modules.d/00systemd/module-setup.sh | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/modules.d/00systemd/module-setup.sh b/modules.d/00systemd/module-setup.sh +index deb5e06..951a5be 100755 +--- a/modules.d/00systemd/module-setup.sh ++++ b/modules.d/00systemd/module-setup.sh +@@ -210,9 +210,10 @@ install() { + done + + mkdir -p "$initdir/etc/systemd" +- # turn off RateLimit for journal ++ # We must use a volatile journal, and we don't want rate-limiting + { + echo "[Journal]" ++ echo "Storage=volatile" + echo "RateLimitInterval=0" + echo "RateLimitBurst=0" + } >> "$initdir/etc/systemd/journald.conf" diff --git a/0073-configure-don-t-hardcode-pkg-config.patch b/0073-configure-don-t-hardcode-pkg-config.patch new file mode 100644 index 0000000..b3b825d --- /dev/null +++ b/0073-configure-don-t-hardcode-pkg-config.patch @@ -0,0 +1,43 @@ +From 699414f5a518f039fa74fd314d21994849a90625 Mon Sep 17 00:00:00 2001 +From: Marc-Antoine Perennou +Date: Wed, 4 May 2016 10:18:54 +0200 +Subject: [PATCH] configure: don't hardcode pkg-config + +Signed-off-by: Marc-Antoine Perennou +--- + configure | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/configure b/configure +index c92cb99..2368680 100755 +--- a/configure ++++ b/configure +@@ -7,6 +7,8 @@ prefix=/usr + + enable_documentation=yes + ++PKG_CONFIG="${PKG_CONFIG:-pkg-config}" ++ + # Little helper function for reading args from the commandline. + # it automatically handles -a b and -a=b variants, and returns 1 if + # we need to shift $3. +@@ -50,7 +52,7 @@ while (($# > 0)); do + shift + done + +-if ! pkg-config --exists --print-errors " libkmod >= 15 "; then ++if ! ${PKG_CONFIG} --exists --print-errors " libkmod >= 15 "; then + echo "dracut needs pkg-config and libkmod >= 15." >&2 + exit 1 + fi +@@ -64,8 +66,8 @@ sbindir ?= ${sbindir:-${prefix}/sbin} + mandir ?= ${mandir:-${prefix}/share/man} + enable_documentation ?= ${enable_documentation:-yes} + bindir ?= ${bindir:-${prefix}/bin} +-KMOD_CFLAGS ?= $(pkg-config --cflags " libkmod >= 15 ") +-KMOD_LIBS ?= $(pkg-config --libs " libkmod >= 15 ") ++KMOD_CFLAGS ?= $(${PKG_CONFIG} --cflags " libkmod >= 15 ") ++KMOD_LIBS ?= $(${PKG_CONFIG} --libs " libkmod >= 15 ") + EOF + + { diff --git a/0073-move-ln_r-to-dracut-init.sh.patch b/0073-move-ln_r-to-dracut-init.sh.patch deleted file mode 100644 index 2e573e0..0000000 --- a/0073-move-ln_r-to-dracut-init.sh.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 190150018798f88107fba119e92bd32e2a8d4b0b Mon Sep 17 00:00:00 2001 -From: Harald Hoyer -Date: Mon, 2 May 2016 12:48:12 +0200 -Subject: [PATCH] move ln_r() to dracut-init.sh - ---- - dracut-functions.sh | 12 ------------ - dracut-init.sh | 13 +++++++++++++ - 2 files changed, 13 insertions(+), 12 deletions(-) - -diff --git a/dracut-functions.sh b/dracut-functions.sh -index c7ea9f5..4496bfe 100755 ---- a/dracut-functions.sh -+++ b/dracut-functions.sh -@@ -167,18 +167,6 @@ convert_abs_rel() { - printf "%s\n" "$__newpath" - } - --if [[ "$(ln --help)" == *--relative* ]]; then -- ln_r() { -- ln -sfnr "${initdir}/$1" "${initdir}/$2" -- } --else -- ln_r() { -- local _source=$1 -- local _dest=$2 -- [[ -d "${_dest%/*}" ]] && _dest=$(readlink -f "${_dest%/*}")/${_dest##*/} -- ln -sfn -- "$(convert_abs_rel "${_dest}" "${_source}")" "${initdir}/${_dest}" -- } --fi - - # get_fs_env - # Get and the ID_FS_TYPE variable from udev for a device. -diff --git a/dracut-init.sh b/dracut-init.sh -index a195c32..d2bb845 100644 ---- a/dracut-init.sh -+++ b/dracut-init.sh -@@ -997,3 +997,16 @@ instmods() { - [[ "$optional" ]] && return 0 - return $_ret - } -+ -+if [[ "$(ln --help)" == *--relative* ]]; then -+ ln_r() { -+ ln -sfnr "${initdir}/$1" "${initdir}/$2" -+ } -+else -+ ln_r() { -+ local _source=$1 -+ local _dest=$2 -+ [[ -d "${_dest%/*}" ]] && _dest=$(readlink -f "${_dest%/*}")/${_dest##*/} -+ ln -sfn -- "$(convert_abs_rel "${_dest}" "${_source}")" "${initdir}/${_dest}" -+ } -+fi diff --git a/0074-dracut-systemd-dracut-cmdline.sh-Don-t-error-out-if-.patch b/0074-dracut-systemd-dracut-cmdline.sh-Don-t-error-out-if-.patch new file mode 100644 index 0000000..20f7339 --- /dev/null +++ b/0074-dracut-systemd-dracut-cmdline.sh-Don-t-error-out-if-.patch @@ -0,0 +1,54 @@ +From 016613c774baf3d30c6425a65ead05d8b55d6279 Mon Sep 17 00:00:00 2001 +From: Alexander Kurtz +Date: Fri, 6 May 2016 17:25:37 +0200 +Subject: [PATCH] dracut-systemd/dracut-cmdline.sh: Don't error out if there is + no root= argument. + +Thanks to systemd's gpt-auto-generator [0] (which implements the Discoverable +Partitions Specification [1]), it is no longer necessary to always specify the +root= argument. + +However, dracut would still refuse to boot if there was no root= argument (or +if it was set to the special value "gpt-auto" [2]). This commit stops dracut +from aborting the boot process in these cases and simply lets systemd do its +magic. + +[0] https://github.com/systemd/systemd/blob/v229/src/gpt-auto-generator +[1] https://www.freedesktop.org/wiki/Specifications/DiscoverablePartitionsSpec/ +[2] https://github.com/systemd/systemd/blob/v229/src/gpt-auto-generator/gpt-auto-generator.c#L928 +--- + modules.d/98dracut-systemd/dracut-cmdline.sh | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +diff --git a/modules.d/98dracut-systemd/dracut-cmdline.sh b/modules.d/98dracut-systemd/dracut-cmdline.sh +index a1dcf84..ccf24fb 100755 +--- a/modules.d/98dracut-systemd/dracut-cmdline.sh ++++ b/modules.d/98dracut-systemd/dracut-cmdline.sh +@@ -21,7 +21,12 @@ getargbool 0 rd.udev.log-priority=debug -d rd.udev.debug -d -n -y rdudevdebug && + + source_conf /etc/conf.d + +-root=$(getarg root=) ++# Get the "root=" parameter from the kernel command line, but differentiate ++# between the case where it was set to the empty string and the case where it ++# wasn't specified at all. ++if ! root="$(getarg root=)"; then ++ root='UNSET' ++fi + + rflags="$(getarg rootflags=)" + getargbool 0 ro && rflags="${rflags},ro" +@@ -65,9 +70,12 @@ case "$root" in + /dev/*) + root="block:${root}" + rootok=1 ;; ++ UNSET|gpt-auto) ++ # systemd's gpt-auto-generator handles this case. ++ rootok=1 ;; + esac + +-[ -z "$root" ] && die "No or empty root= argument" ++[ -z "$root" ] && die "Empty root= argument" + [ -z "$rootok" ] && die "Don't know how to handle 'root=$root'" + + export root rflags fstype netroot NEWROOT diff --git a/0074-systemd-initrd-add-initrd-root-device.target.patch b/0074-systemd-initrd-add-initrd-root-device.target.patch deleted file mode 100644 index 87d6696..0000000 --- a/0074-systemd-initrd-add-initrd-root-device.target.patch +++ /dev/null @@ -1,21 +0,0 @@ -From d4efc0aeeecc470d9a267b7f3c130f472488905c Mon Sep 17 00:00:00 2001 -From: Harald Hoyer -Date: Wed, 25 May 2016 15:06:29 +0200 -Subject: [PATCH] systemd-initrd: add initrd-root-device.target - ---- - modules.d/01systemd-initrd/module-setup.sh | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/modules.d/01systemd-initrd/module-setup.sh b/modules.d/01systemd-initrd/module-setup.sh -index fb6a9ea..c1ccd2a 100755 ---- a/modules.d/01systemd-initrd/module-setup.sh -+++ b/modules.d/01systemd-initrd/module-setup.sh -@@ -28,6 +28,7 @@ install() { - inst_multiple -o \ - $systemdsystemunitdir/initrd.target \ - $systemdsystemunitdir/initrd-fs.target \ -+ $systemdsystemunitdir/initrd-root-device.target \ - $systemdsystemunitdir/initrd-root-fs.target \ - $systemdsystemunitdir/initrd-switch-root.target \ - $systemdsystemunitdir/initrd-switch-root.service \ diff --git a/0075-move-ln_r-to-dracut-init.sh.patch b/0075-move-ln_r-to-dracut-init.sh.patch new file mode 100644 index 0000000..2e573e0 --- /dev/null +++ b/0075-move-ln_r-to-dracut-init.sh.patch @@ -0,0 +1,54 @@ +From 190150018798f88107fba119e92bd32e2a8d4b0b Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Mon, 2 May 2016 12:48:12 +0200 +Subject: [PATCH] move ln_r() to dracut-init.sh + +--- + dracut-functions.sh | 12 ------------ + dracut-init.sh | 13 +++++++++++++ + 2 files changed, 13 insertions(+), 12 deletions(-) + +diff --git a/dracut-functions.sh b/dracut-functions.sh +index c7ea9f5..4496bfe 100755 +--- a/dracut-functions.sh ++++ b/dracut-functions.sh +@@ -167,18 +167,6 @@ convert_abs_rel() { + printf "%s\n" "$__newpath" + } + +-if [[ "$(ln --help)" == *--relative* ]]; then +- ln_r() { +- ln -sfnr "${initdir}/$1" "${initdir}/$2" +- } +-else +- ln_r() { +- local _source=$1 +- local _dest=$2 +- [[ -d "${_dest%/*}" ]] && _dest=$(readlink -f "${_dest%/*}")/${_dest##*/} +- ln -sfn -- "$(convert_abs_rel "${_dest}" "${_source}")" "${initdir}/${_dest}" +- } +-fi + + # get_fs_env + # Get and the ID_FS_TYPE variable from udev for a device. +diff --git a/dracut-init.sh b/dracut-init.sh +index a195c32..d2bb845 100644 +--- a/dracut-init.sh ++++ b/dracut-init.sh +@@ -997,3 +997,16 @@ instmods() { + [[ "$optional" ]] && return 0 + return $_ret + } ++ ++if [[ "$(ln --help)" == *--relative* ]]; then ++ ln_r() { ++ ln -sfnr "${initdir}/$1" "${initdir}/$2" ++ } ++else ++ ln_r() { ++ local _source=$1 ++ local _dest=$2 ++ [[ -d "${_dest%/*}" ]] && _dest=$(readlink -f "${_dest%/*}")/${_dest##*/} ++ ln -sfn -- "$(convert_abs_rel "${_dest}" "${_source}")" "${initdir}/${_dest}" ++ } ++fi diff --git a/0076-systemd-initrd-add-initrd-root-device.target.patch b/0076-systemd-initrd-add-initrd-root-device.target.patch new file mode 100644 index 0000000..87d6696 --- /dev/null +++ b/0076-systemd-initrd-add-initrd-root-device.target.patch @@ -0,0 +1,21 @@ +From d4efc0aeeecc470d9a267b7f3c130f472488905c Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Wed, 25 May 2016 15:06:29 +0200 +Subject: [PATCH] systemd-initrd: add initrd-root-device.target + +--- + modules.d/01systemd-initrd/module-setup.sh | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/modules.d/01systemd-initrd/module-setup.sh b/modules.d/01systemd-initrd/module-setup.sh +index fb6a9ea..c1ccd2a 100755 +--- a/modules.d/01systemd-initrd/module-setup.sh ++++ b/modules.d/01systemd-initrd/module-setup.sh +@@ -28,6 +28,7 @@ install() { + inst_multiple -o \ + $systemdsystemunitdir/initrd.target \ + $systemdsystemunitdir/initrd-fs.target \ ++ $systemdsystemunitdir/initrd-root-device.target \ + $systemdsystemunitdir/initrd-root-fs.target \ + $systemdsystemunitdir/initrd-switch-root.target \ + $systemdsystemunitdir/initrd-switch-root.service \ diff --git a/0077-dracut.sh-fix-tmpfilesdir-fallback-when-systemd-deve.patch b/0077-dracut.sh-fix-tmpfilesdir-fallback-when-systemd-deve.patch new file mode 100644 index 0000000..c1c9399 --- /dev/null +++ b/0077-dracut.sh-fix-tmpfilesdir-fallback-when-systemd-deve.patch @@ -0,0 +1,26 @@ +From 55b99a0e4c37b3b7ee58e1369ab00430795acdc6 Mon Sep 17 00:00:00 2001 +From: Colin Guthrie +Date: Tue, 7 Jun 2016 09:16:05 +0100 +Subject: [PATCH] dracut.sh: fix $tmpfilesdir fallback when systemd-devel is + not installed. + +Bug introduced in 3a04bddeed in Dec 2014. +--- + dracut.sh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/dracut.sh b/dracut.sh +index 8232fa4..a50eaff 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -1260,8 +1260,8 @@ fi + || tmpfilesdir=$(pkg-config systemd --variable=tmpfilesdir 2>/dev/null) + + if ! [[ -d "$tmpfilesdir" ]]; then +- [[ -f /lib/tmpfiles.d ]] && tmpfilesdir=/lib/tmpfiles.d +- [[ -f /usr/lib/tmpfiles.d ]] && tmpfilesdir=/usr/lib/tmpfiles.d ++ [[ -d /lib/tmpfiles.d ]] && tmpfilesdir=/lib/tmpfiles.d ++ [[ -d /usr/lib/tmpfiles.d ]] && tmpfilesdir=/usr/lib/tmpfiles.d + fi + + export initdir dracutbasedir \ diff --git a/0078-dracut-Add-drivers-clk-by-default-on-arm.patch b/0078-dracut-Add-drivers-clk-by-default-on-arm.patch new file mode 100644 index 0000000..8f4ea3e --- /dev/null +++ b/0078-dracut-Add-drivers-clk-by-default-on-arm.patch @@ -0,0 +1,30 @@ +From 2602a74edf543f98f2aa1eb79db3de3a1cda13f0 Mon Sep 17 00:00:00 2001 +From: Nicolas Chauvet +Date: Thu, 12 May 2016 17:28:21 +0200 +Subject: [PATCH] dracut: Add drivers/clk by default on arm + +This will bundle clock drivers into the initramfs on arm + +Tested on ti dm8148-t410 where adpll is needed on 4.6+ kernel +This will avoid to rely on (maybe broken) bootloader clocks. + +Theses modules are also usually loaded early. Having them bundled into +the initramfs will avoid lot of deferred probes and others delay. + +Signed-off-by: Nicolas Chauvet +--- + modules.d/90kernel-modules/module-setup.sh | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/modules.d/90kernel-modules/module-setup.sh b/modules.d/90kernel-modules/module-setup.sh +index c30715d..7904c02 100755 +--- a/modules.d/90kernel-modules/module-setup.sh ++++ b/modules.d/90kernel-modules/module-setup.sh +@@ -26,6 +26,7 @@ installkernel() { + if [[ "$(uname -p)" == arm* ]]; then + # arm specific modules + instmods \ ++ "=drivers/clk" \ + "=drivers/i2c/busses" \ + "=drivers/regulator" \ + "=drivers/rtc" \ diff --git a/0079-network-remove-awk-call-and-replace-it-with-a-shell-.patch b/0079-network-remove-awk-call-and-replace-it-with-a-shell-.patch new file mode 100644 index 0000000..c34ed13 --- /dev/null +++ b/0079-network-remove-awk-call-and-replace-it-with-a-shell-.patch @@ -0,0 +1,59 @@ +From 71867b665cea6b4d9814ea0386baf0500db06806 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Tue, 7 Jun 2016 11:11:58 +0200 +Subject: [PATCH] network: remove awk call and replace it with a shell function + +changes commit 4fa5c235a76c085f5958002826436ed9c40e5034 +--- + dracut-functions.sh | 10 ++++++++++ + modules.d/40network/module-setup.sh | 2 +- + modules.d/40network/net-lib.sh | 2 +- + 3 files changed, 12 insertions(+), 2 deletions(-) + +diff --git a/dracut-functions.sh b/dracut-functions.sh +index 4496bfe..146dbea 100755 +--- a/dracut-functions.sh ++++ b/dracut-functions.sh +@@ -37,6 +37,16 @@ str_starts() { [ "${1#"$2"*}" != "$1" ]; } + # returns OK if $1 contains literal string $2 at the end, and isn't empty + str_ends() { [ "${1%*"$2"}" != "$1" ]; } + ++uniq_lines() { ++ local -A lines ++ while read -r line; do ++ if ! [[ ${lines[$line]} ]]; then ++ echo "$line" ++ lines[$line]=1 ++ fi ++ done ++} ++ + # find a binary. If we were not passed the full path directly, + # search in the usual places to find the binary. + find_binary() { +diff --git a/modules.d/40network/module-setup.sh b/modules.d/40network/module-setup.sh +index 53b4b60..4bf93cc 100755 +--- a/modules.d/40network/module-setup.sh ++++ b/modules.d/40network/module-setup.sh +@@ -23,7 +23,7 @@ installkernel() { + # called by dracut + install() { + local _arch _i _dir +- inst_multiple ip arping dhclient sed awk ++ inst_multiple ip arping dhclient sed + inst_multiple -o ping ping6 + inst_multiple -o brctl + inst_multiple -o teamd teamdctl teamnl +diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh +index 005ad1b..4fd274e 100755 +--- a/modules.d/40network/net-lib.sh ++++ b/modules.d/40network/net-lib.sh +@@ -120,7 +120,7 @@ setup_net() { + [ -e /tmp/dhclient.$netif.dhcpopts ] && . /tmp/dhclient.$netif.dhcpopts + # set up resolv.conf + [ -e /tmp/net.$netif.resolv.conf ] && \ +- awk '!array[$0]++' /tmp/net.$netif.resolv.conf > /etc/resolv.conf ++ uniq_lines < /tmp/net.$netif.resolv.conf > /etc/resolv.conf + [ -e /tmp/net.$netif.gw ] && . /tmp/net.$netif.gw + + # add static route diff --git a/0080-dracut-init.sh-set-default-firmware-path-if-not-spec.patch b/0080-dracut-init.sh-set-default-firmware-path-if-not-spec.patch new file mode 100644 index 0000000..f940cab --- /dev/null +++ b/0080-dracut-init.sh-set-default-firmware-path-if-not-spec.patch @@ -0,0 +1,22 @@ +From 8e010957557621c1a71d7289c4210d3ad5932893 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Wed, 25 May 2016 17:05:03 +0200 +Subject: [PATCH] dracut-init.sh: set default firmware path, if not specified + +--- + dracut-init.sh | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/dracut-init.sh b/dracut-init.sh +index d2bb845..7f628ce 100644 +--- a/dracut-init.sh ++++ b/dracut-init.sh +@@ -69,6 +69,8 @@ srcmods="/lib/modules/$kernel/" + } + export srcmods + ++[[ $DRACUT_FIRMWARE_PATH ]] || export DRACUT_FIRMWARE_PATH="/lib/firmware/updates:/lib/firmware:/lib/firmware/$kernel" ++ + # export standard hookdirs + [[ $hookdirs ]] || { + hookdirs="cmdline pre-udev pre-trigger netroot " diff --git a/0081-use-shutdown-emergency-hook-in-testsuite-to-poweroff.patch b/0081-use-shutdown-emergency-hook-in-testsuite-to-poweroff.patch new file mode 100644 index 0000000..ed87a01 --- /dev/null +++ b/0081-use-shutdown-emergency-hook-in-testsuite-to-poweroff.patch @@ -0,0 +1,269 @@ +From 4e882b8090e82b0f0ffabfb45f0a2cd69768ef53 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Fri, 27 May 2016 10:52:28 +0200 +Subject: [PATCH] use shutdown-emergency hook in testsuite to poweroff the + machine + +--- + modules.d/99base/dracut-lib.sh | 6 +++++- + test/TEST-01-BASIC/test.sh | 2 +- + test/TEST-02-SYSTEMD/test.sh | 2 +- + test/TEST-03-USR-MOUNT/test.sh | 2 +- + test/TEST-04-FULL-SYSTEMD/test.sh | 2 +- + test/TEST-10-RAID/test.sh | 2 +- + test/TEST-11-LVM/test.sh | 2 +- + test/TEST-12-RAID-DEG/test.sh | 2 +- + test/TEST-13-ENC-RAID-LVM/test.sh | 2 +- + test/TEST-14-IMSM/test.sh | 2 +- + test/TEST-15-BTRFSRAID/test.sh | 2 +- + test/TEST-16-DMSQUASH/test.sh | 2 +- + test/TEST-17-LVM-THIN/test.sh | 2 +- + test/TEST-20-NFS/test.sh | 4 ++-- + test/TEST-30-ISCSI/test.sh | 2 +- + test/TEST-40-NBD/test.sh | 4 ++-- + test/TEST-50-MULTINIC/test.sh | 2 +- + 17 files changed, 23 insertions(+), 19 deletions(-) + +diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh +index 48fc83d..94e4614 100755 +--- a/modules.d/99base/dracut-lib.sh ++++ b/modules.d/99base/dracut-lib.sh +@@ -457,7 +457,11 @@ die() { + + > /run/initramfs/.die + +- getargbool 0 "rd.shell=" && emergency_shell ++ if getargbool 0 "rd.shell"; then ++ emergency_shell ++ else ++ source_hook "shutdown-emergency" ++ fi + + if [ -n "$DRACUT_SYSTEMD" ]; then + systemctl --no-block --force halt +diff --git a/test/TEST-01-BASIC/test.sh b/test/TEST-01-BASIC/test.sh +index 83320e2..959ac05 100755 +--- a/test/TEST-01-BASIC/test.sh ++++ b/test/TEST-01-BASIC/test.sh +@@ -89,7 +89,7 @@ test_setup() { + export initdir=$TESTDIR/overlay + . $basedir/dracut-init.sh + inst_multiple poweroff shutdown +- inst_hook emergency 000 ./hard-off.sh ++ inst_hook shutdown-emergency 000 ./hard-off.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + ) + sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \ +diff --git a/test/TEST-02-SYSTEMD/test.sh b/test/TEST-02-SYSTEMD/test.sh +index 16f5c26..6dc6f42 100755 +--- a/test/TEST-02-SYSTEMD/test.sh ++++ b/test/TEST-02-SYSTEMD/test.sh +@@ -86,7 +86,7 @@ test_setup() { + export initdir=$TESTDIR/overlay + . $basedir/dracut-init.sh + inst_multiple poweroff shutdown +- inst_hook emergency 000 ./hard-off.sh ++ inst_hook shutdown-emergency 000 ./hard-off.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + ) + sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \ +diff --git a/test/TEST-03-USR-MOUNT/test.sh b/test/TEST-03-USR-MOUNT/test.sh +index 61063fd..0aca8cf 100755 +--- a/test/TEST-03-USR-MOUNT/test.sh ++++ b/test/TEST-03-USR-MOUNT/test.sh +@@ -124,7 +124,7 @@ test_setup() { + export initdir=$TESTDIR/overlay + . $basedir/dracut-init.sh + inst_multiple poweroff shutdown +- inst_hook emergency 000 ./hard-off.sh ++ inst_hook shutdown-emergency 000 ./hard-off.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + ) + sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \ +diff --git a/test/TEST-04-FULL-SYSTEMD/test.sh b/test/TEST-04-FULL-SYSTEMD/test.sh +index c7e08bf..884f441 100755 +--- a/test/TEST-04-FULL-SYSTEMD/test.sh ++++ b/test/TEST-04-FULL-SYSTEMD/test.sh +@@ -261,7 +261,7 @@ EOF + export initdir=$TESTDIR/overlay + . $basedir/dracut-init.sh + inst_multiple poweroff shutdown +- inst_hook emergency 000 ./hard-off.sh ++ inst_hook shutdown-emergency 000 ./hard-off.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + ) + +diff --git a/test/TEST-10-RAID/test.sh b/test/TEST-10-RAID/test.sh +index 523b61a..6ec77a6 100755 +--- a/test/TEST-10-RAID/test.sh ++++ b/test/TEST-10-RAID/test.sh +@@ -86,7 +86,7 @@ test_setup() { + export initdir=$TESTDIR/overlay + . $basedir/dracut-init.sh + inst_multiple poweroff shutdown +- inst_hook emergency 000 ./hard-off.sh ++ inst_hook shutdown-emergency 000 ./hard-off.sh + inst ./cryptroot-ask.sh /sbin/cryptroot-ask + mkdir -p $initdir/etc + echo "testluks UUID=$ID_FS_UUID /etc/key" > $initdir/etc/crypttab +diff --git a/test/TEST-11-LVM/test.sh b/test/TEST-11-LVM/test.sh +index 34c7736..412a065 100755 +--- a/test/TEST-11-LVM/test.sh ++++ b/test/TEST-11-LVM/test.sh +@@ -79,7 +79,7 @@ test_setup() { + export initdir=$TESTDIR/overlay + . $basedir/dracut-init.sh + inst_multiple poweroff shutdown +- inst_hook emergency 000 ./hard-off.sh ++ inst_hook shutdown-emergency 000 ./hard-off.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + ) + sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \ +diff --git a/test/TEST-12-RAID-DEG/test.sh b/test/TEST-12-RAID-DEG/test.sh +index f4ec2d0..444dca6 100755 +--- a/test/TEST-12-RAID-DEG/test.sh ++++ b/test/TEST-12-RAID-DEG/test.sh +@@ -129,7 +129,7 @@ test_setup() { + export initdir=$TESTDIR/overlay + . $basedir/dracut-init.sh + inst_multiple poweroff shutdown +- inst_hook emergency 000 ./hard-off.sh ++ inst_hook shutdown-emergency 000 ./hard-off.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + inst ./cryptroot-ask.sh /sbin/cryptroot-ask + mkdir -p $initdir/etc +diff --git a/test/TEST-13-ENC-RAID-LVM/test.sh b/test/TEST-13-ENC-RAID-LVM/test.sh +index ea81697..2a814f8 100755 +--- a/test/TEST-13-ENC-RAID-LVM/test.sh ++++ b/test/TEST-13-ENC-RAID-LVM/test.sh +@@ -123,7 +123,7 @@ test_setup() { + export initdir=$TESTDIR/overlay + . $basedir/dracut-init.sh + inst_multiple poweroff shutdown +- inst_hook emergency 000 ./hard-off.sh ++ inst_hook shutdown-emergency 000 ./hard-off.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + inst ./cryptroot-ask.sh /sbin/cryptroot-ask + mkdir -p $initdir/etc +diff --git a/test/TEST-14-IMSM/test.sh b/test/TEST-14-IMSM/test.sh +index f4ea7ae..315bc5a 100755 +--- a/test/TEST-14-IMSM/test.sh ++++ b/test/TEST-14-IMSM/test.sh +@@ -113,7 +113,7 @@ test_setup() { + export initdir=$TESTDIR/overlay + . $basedir/dracut-init.sh + inst_multiple poweroff shutdown +- inst_hook emergency 000 ./hard-off.sh ++ inst_hook shutdown-emergency 000 ./hard-off.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + ) + sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \ +diff --git a/test/TEST-15-BTRFSRAID/test.sh b/test/TEST-15-BTRFSRAID/test.sh +index 5a9b6e1..8e2ea49 100755 +--- a/test/TEST-15-BTRFSRAID/test.sh ++++ b/test/TEST-15-BTRFSRAID/test.sh +@@ -87,7 +87,7 @@ test_setup() { + export initdir=$TESTDIR/overlay + . $basedir/dracut-init.sh + inst_multiple poweroff shutdown +- inst_hook emergency 000 ./hard-off.sh ++ inst_hook shutdown-emergency 000 ./hard-off.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + ) + sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \ +diff --git a/test/TEST-16-DMSQUASH/test.sh b/test/TEST-16-DMSQUASH/test.sh +index 53a45d6..b255492 100755 +--- a/test/TEST-16-DMSQUASH/test.sh ++++ b/test/TEST-16-DMSQUASH/test.sh +@@ -43,7 +43,7 @@ test_setup() { + export initdir="$TESTDIR"/overlay + . "$basedir"/dracut-init.sh + inst_multiple poweroff shutdown +- inst_hook emergency 000 ./hard-off.sh ++ inst_hook shutdown-emergency 000 ./hard-off.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + ) + +diff --git a/test/TEST-17-LVM-THIN/test.sh b/test/TEST-17-LVM-THIN/test.sh +index 859d4dc..e337591 100755 +--- a/test/TEST-17-LVM-THIN/test.sh ++++ b/test/TEST-17-LVM-THIN/test.sh +@@ -79,7 +79,7 @@ test_setup() { + export initdir=$TESTDIR/overlay + . $basedir/dracut-init.sh + inst_multiple poweroff shutdown +- inst_hook emergency 000 ./hard-off.sh ++ inst_hook shutdown-emergency 000 ./hard-off.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + ) + sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \ +diff --git a/test/TEST-20-NFS/test.sh b/test/TEST-20-NFS/test.sh +index ceca1f0..1dfdfc4 100755 +--- a/test/TEST-20-NFS/test.sh ++++ b/test/TEST-20-NFS/test.sh +@@ -141,7 +141,7 @@ test_nfsv3() { + + # This test must fail: nfsroot= requires root=/dev/nfs + client_test "NFSv3 Invalid root=dhcp nfsroot=/nfs/client" 52:54:00:12:34:04 \ +- "root=dhcp nfsroot=/nfs/client failme" 192.168.50.1 -wsize=4096 && return 1 ++ "root=dhcp nfsroot=/nfs/client failme rd.debug" 192.168.50.1 -wsize=4096 && return 1 + + client_test "NFSv3 root=dhcp DHCP path,options" \ + 52:54:00:12:34:05 "root=dhcp" 192.168.50.1 wsize=4096 || return 1 +@@ -334,7 +334,7 @@ test_setup() { + . $basedir/dracut-init.sh + mkdir $TESTDIR/overlay + inst_multiple poweroff shutdown +- inst_hook emergency 000 ./hard-off.sh ++ inst_hook shutdown-emergency 000 ./hard-off.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + ) + +diff --git a/test/TEST-30-ISCSI/test.sh b/test/TEST-30-ISCSI/test.sh +index 940edb6..1c06b06 100755 +--- a/test/TEST-30-ISCSI/test.sh ++++ b/test/TEST-30-ISCSI/test.sh +@@ -213,7 +213,7 @@ test_setup() { + export initdir=$TESTDIR/overlay + . $basedir/dracut-init.sh + inst_multiple poweroff shutdown +- inst_hook emergency 000 ./hard-off.sh ++ inst_hook shutdown-emergency 000 ./hard-off.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + ) + sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \ +diff --git a/test/TEST-40-NBD/test.sh b/test/TEST-40-NBD/test.sh +index 28ba6aa..2061392 100755 +--- a/test/TEST-40-NBD/test.sh ++++ b/test/TEST-40-NBD/test.sh +@@ -226,7 +226,7 @@ make_encrypted_root() { + done + ) + inst_multiple mke2fs poweroff cp umount tune2fs +- inst_hook emergency 000 ./hard-off.sh ++ inst_hook shutdown-emergency 000 ./hard-off.sh + inst_hook initqueue 01 ./create-root.sh + inst_hook initqueue/finished 01 ./finished-false.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules +@@ -362,7 +362,7 @@ test_setup() { + export initdir=$TESTDIR/overlay + . $basedir/dracut-init.sh + inst_multiple poweroff shutdown +- inst_hook emergency 000 ./hard-off.sh ++ inst_hook shutdown-emergency 000 ./hard-off.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + inst ./cryptroot-ask.sh /sbin/cryptroot-ask + +diff --git a/test/TEST-50-MULTINIC/test.sh b/test/TEST-50-MULTINIC/test.sh +index 484ebee..e0bf7d2 100755 +--- a/test/TEST-50-MULTINIC/test.sh ++++ b/test/TEST-50-MULTINIC/test.sh +@@ -269,7 +269,7 @@ test_setup() { + export initdir="$TESTDIR"/overlay + . "$basedir"/dracut-init.sh + inst_multiple poweroff shutdown +- inst_hook emergency 000 ./hard-off.sh ++ inst_hook shutdown-emergency 000 ./hard-off.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + ) + diff --git a/0082-Revert-network-remove-awk-call-and-replace-it-with-a.patch b/0082-Revert-network-remove-awk-call-and-replace-it-with-a.patch new file mode 100644 index 0000000..4d5603c --- /dev/null +++ b/0082-Revert-network-remove-awk-call-and-replace-it-with-a.patch @@ -0,0 +1,62 @@ +From 9e19c0512d12be15d02125bce0e25d6b9bb2b333 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Tue, 7 Jun 2016 13:24:47 +0200 +Subject: [PATCH] Revert "network: remove awk call and replace it with a shell + function" + +This reverts commit 71867b665cea6b4d9814ea0386baf0500db06806. + +network needs posix shell +--- + dracut-functions.sh | 10 ---------- + modules.d/40network/module-setup.sh | 2 +- + modules.d/40network/net-lib.sh | 2 +- + 3 files changed, 2 insertions(+), 12 deletions(-) + +diff --git a/dracut-functions.sh b/dracut-functions.sh +index 146dbea..4496bfe 100755 +--- a/dracut-functions.sh ++++ b/dracut-functions.sh +@@ -37,16 +37,6 @@ str_starts() { [ "${1#"$2"*}" != "$1" ]; } + # returns OK if $1 contains literal string $2 at the end, and isn't empty + str_ends() { [ "${1%*"$2"}" != "$1" ]; } + +-uniq_lines() { +- local -A lines +- while read -r line; do +- if ! [[ ${lines[$line]} ]]; then +- echo "$line" +- lines[$line]=1 +- fi +- done +-} +- + # find a binary. If we were not passed the full path directly, + # search in the usual places to find the binary. + find_binary() { +diff --git a/modules.d/40network/module-setup.sh b/modules.d/40network/module-setup.sh +index 4bf93cc..53b4b60 100755 +--- a/modules.d/40network/module-setup.sh ++++ b/modules.d/40network/module-setup.sh +@@ -23,7 +23,7 @@ installkernel() { + # called by dracut + install() { + local _arch _i _dir +- inst_multiple ip arping dhclient sed ++ inst_multiple ip arping dhclient sed awk + inst_multiple -o ping ping6 + inst_multiple -o brctl + inst_multiple -o teamd teamdctl teamnl +diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh +index 4fd274e..005ad1b 100755 +--- a/modules.d/40network/net-lib.sh ++++ b/modules.d/40network/net-lib.sh +@@ -120,7 +120,7 @@ setup_net() { + [ -e /tmp/dhclient.$netif.dhcpopts ] && . /tmp/dhclient.$netif.dhcpopts + # set up resolv.conf + [ -e /tmp/net.$netif.resolv.conf ] && \ +- uniq_lines < /tmp/net.$netif.resolv.conf > /etc/resolv.conf ++ awk '!array[$0]++' /tmp/net.$netif.resolv.conf > /etc/resolv.conf + [ -e /tmp/net.$netif.gw ] && . /tmp/net.$netif.gw + + # add static route diff --git a/0083-dracut-systemd-dracut-emergency.sh-call-shutdown-eme.patch b/0083-dracut-systemd-dracut-emergency.sh-call-shutdown-eme.patch new file mode 100644 index 0000000..fbf4224 --- /dev/null +++ b/0083-dracut-systemd-dracut-emergency.sh-call-shutdown-eme.patch @@ -0,0 +1,37 @@ +From 8fce2c4d5eb6f48fdb2429cf1854aca3ced42423 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Tue, 7 Jun 2016 14:47:27 +0200 +Subject: [PATCH] dracut-systemd/dracut-emergency.sh: call shutdown-emergency + hooks + +if no rd.shell is given +--- + modules.d/98dracut-systemd/dracut-emergency.sh | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/modules.d/98dracut-systemd/dracut-emergency.sh b/modules.d/98dracut-systemd/dracut-emergency.sh +index 26be291..63311c2 100755 +--- a/modules.d/98dracut-systemd/dracut-emergency.sh ++++ b/modules.d/98dracut-systemd/dracut-emergency.sh +@@ -12,10 +12,9 @@ type plymouth >/dev/null 2>&1 && plymouth quit + + export _rdshell_name="dracut" action="Boot" hook="emergency" + +-source_hook "$hook" +- + + if getargbool 1 rd.shell -d -y rdshell || getarg rd.break -d rdbreak; then ++ source_hook "$hook" + echo + rdsosreport + echo +@@ -30,7 +29,9 @@ if getargbool 1 rd.shell -d -y rdshell || getarg rd.break -d rdbreak; then + [ -z "$PS1" ] && export PS1="$_name:\${PWD}# " + exec sh -i -l + else ++ export hook="shutdown-emergency" + warn "$action has failed. To debug this issue add \"rd.shell rd.debug\" to the kernel command line." ++ source_hook "$hook" + exit 1 + fi + diff --git a/0084-systemd-add-udev.hwdb-and-udev.conf.patch b/0084-systemd-add-udev.hwdb-and-udev.conf.patch new file mode 100644 index 0000000..0f4bc5b --- /dev/null +++ b/0084-systemd-add-udev.hwdb-and-udev.conf.patch @@ -0,0 +1,45 @@ +From 3847bd450d82fd4f95d9668f4810f31adc95ab30 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Wed, 8 Jun 2016 16:46:42 +0200 +Subject: [PATCH] systemd: add udev.hwdb and udev.conf + +--- + modules.d/00systemd/module-setup.sh | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +diff --git a/modules.d/00systemd/module-setup.sh b/modules.d/00systemd/module-setup.sh +index 951a5be..dcee08b 100755 +--- a/modules.d/00systemd/module-setup.sh ++++ b/modules.d/00systemd/module-setup.sh +@@ -130,7 +130,9 @@ install() { + kmod insmod rmmod modprobe modinfo depmod lsmod \ + mount umount reboot poweroff \ + systemd-run systemd-escape \ +- systemd-cgls systemd-tmpfiles ++ systemd-cgls systemd-tmpfiles \ ++ /etc/udev/udev.hwdb \ ++ ${NULL} + + inst_multiple -o \ + /usr/lib/modules-load.d/*.conf \ +@@ -167,7 +169,9 @@ install() { + /etc/locale.conf \ + /etc/modules-load.d/*.conf \ + /etc/sysctl.d/*.conf \ +- /etc/sysctl.conf ++ /etc/sysctl.conf \ ++ /etc/udev/udev.conf \ ++ ${NULL} + + _mods=$(modules_load_get /etc/modules-load.d) + [[ $_mods ]] && instmods $_mods +@@ -196,7 +200,8 @@ install() { + 71-seat.rules \ + 73-seat-late.rules \ + 90-vconsole.rules \ +- 99-systemd.rules ++ 99-systemd.rules \ ++ ${NULL} + + for i in \ + emergency.target \ diff --git a/0085-cope-with-rd.shell-0-in-the-testsuite.patch b/0085-cope-with-rd.shell-0-in-the-testsuite.patch new file mode 100644 index 0000000..f854c1f --- /dev/null +++ b/0085-cope-with-rd.shell-0-in-the-testsuite.patch @@ -0,0 +1,2031 @@ +From 781f1971c326da07d22516a4b555138b1978177b Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Wed, 8 Jun 2016 09:33:48 +0200 +Subject: [PATCH] cope with "rd.shell=0" in the testsuite + +If emergency and shutdown-emergency hooks are called, the systemd should +poweroff the testsuite, therefore "rd.shell=0" is given on the test +suite kernel command lines. + +"rd.shell=0" has to be parsed correctly by the test suite real root init +also. +--- + test/TEST-01-BASIC/hard-off.sh | 4 +- + test/TEST-01-BASIC/test-init.sh | 97 +++++++++++++++++++++++++++++++- + test/TEST-01-BASIC/test.sh | 3 +- + test/TEST-02-SYSTEMD/hard-off.sh | 4 +- + test/TEST-02-SYSTEMD/test-init.sh | 100 ++++++++++++++++++++++++++++++++- + test/TEST-02-SYSTEMD/test.sh | 3 +- + test/TEST-03-USR-MOUNT/hard-off.sh | 4 +- + test/TEST-03-USR-MOUNT/test-init.sh | 97 +++++++++++++++++++++++++++++++- + test/TEST-03-USR-MOUNT/test.sh | 3 +- + test/TEST-04-FULL-SYSTEMD/hard-off.sh | 4 +- + test/TEST-04-FULL-SYSTEMD/test-init.sh | 97 +++++++++++++++++++++++++++++++- + test/TEST-04-FULL-SYSTEMD/test.sh | 3 +- + test/TEST-10-RAID/hard-off.sh | 4 +- + test/TEST-10-RAID/test-init.sh | 97 +++++++++++++++++++++++++++++++- + test/TEST-10-RAID/test.sh | 3 +- + test/TEST-11-LVM/hard-off.sh | 4 +- + test/TEST-11-LVM/test-init.sh | 97 +++++++++++++++++++++++++++++++- + test/TEST-11-LVM/test.sh | 3 +- + test/TEST-12-RAID-DEG/hard-off.sh | 4 +- + test/TEST-12-RAID-DEG/test-init.sh | 97 +++++++++++++++++++++++++++++++- + test/TEST-12-RAID-DEG/test.sh | 3 +- + test/TEST-13-ENC-RAID-LVM/hard-off.sh | 4 +- + test/TEST-13-ENC-RAID-LVM/test.sh | 3 +- + test/TEST-14-IMSM/hard-off.sh | 4 +- + test/TEST-14-IMSM/test-init.sh | 97 +++++++++++++++++++++++++++++++- + test/TEST-14-IMSM/test.sh | 3 +- + test/TEST-15-BTRFSRAID/hard-off.sh | 4 +- + test/TEST-15-BTRFSRAID/test.sh | 3 +- + test/TEST-16-DMSQUASH/hard-off.sh | 4 +- + test/TEST-16-DMSQUASH/test-init.sh | 97 +++++++++++++++++++++++++++++++- + test/TEST-16-DMSQUASH/test.sh | 3 +- + test/TEST-17-LVM-THIN/hard-off.sh | 2 +- + test/TEST-17-LVM-THIN/test-init.sh | 97 +++++++++++++++++++++++++++++++- + test/TEST-17-LVM-THIN/test.sh | 3 +- + test/TEST-20-NFS/client-init.sh | 97 +++++++++++++++++++++++++++++++- + test/TEST-20-NFS/hard-off.sh | 4 +- + test/TEST-20-NFS/test.sh | 3 +- + test/TEST-30-ISCSI/client-init.sh | 97 +++++++++++++++++++++++++++++++- + test/TEST-30-ISCSI/hard-off.sh | 4 +- + test/TEST-30-ISCSI/test.sh | 3 +- + test/TEST-40-NBD/hard-off.sh | 4 +- + test/TEST-40-NBD/test.sh | 3 +- + test/TEST-50-MULTINIC/client-init.sh | 98 +++++++++++++++++++++++++++++++- + test/TEST-50-MULTINIC/hard-off.sh | 4 +- + test/TEST-50-MULTINIC/test.sh | 3 +- + 45 files changed, 1315 insertions(+), 60 deletions(-) + +diff --git a/test/TEST-01-BASIC/hard-off.sh b/test/TEST-01-BASIC/hard-off.sh +index 12c3d5a..01acb19 100755 +--- a/test/TEST-01-BASIC/hard-off.sh ++++ b/test/TEST-01-BASIC/hard-off.sh +@@ -1,3 +1,3 @@ + #!/bin/sh +-getarg rd.shell || poweroff -f +-getarg failme && poweroff -f ++getargbool 0 rd.shell || poweroff -f ++getargbool 0 failme && poweroff -f +diff --git a/test/TEST-01-BASIC/test-init.sh b/test/TEST-01-BASIC/test-init.sh +index ef196ec..a8b6e39 100755 +--- a/test/TEST-01-BASIC/test-init.sh ++++ b/test/TEST-01-BASIC/test-init.sh +@@ -1,5 +1,100 @@ + #!/bin/sh + >/dev/watchdog ++getcmdline() { ++ while read -r _line || [ -n "$_line" ]; do ++ printf "%s" "$line" ++ done ", we want the exact match ++ if [ "$_o" = "$1" ]; then ++ _val="1"; ++ unset _doecho ++ fi ++ continue ++ fi ++ ++ if [ "${_o#*=}" = "$_o" ]; then ++ # if cmdline argument has no "=", we assume "=1" ++ _val="1"; ++ unset _doecho ++ continue ++ fi ++ ++ _val="${_o#*=}" ++ _doecho=1 ++ fi ++ done ++ if [ -n "$_val" ]; then ++ [ "x$_doecho" != "x" ] && echo "$_val"; ++ return 0; ++ fi ++ return 1; ++} ++ ++getarg() { ++ local _deprecated _newoption ++ while [ $# -gt 0 ]; do ++ case $1 in ++ -d) _deprecated=1; shift;; ++ -y) if _dogetarg $2 >/dev/null; then ++ if [ "$_deprecated" = "1" ]; then ++ [ -n "$_newoption" ] && warn "Kernel command line option '$2' is deprecated, use '$_newoption' instead." || warn "Option '$2' is deprecated." ++ fi ++ echo 1 ++ return 0 ++ fi ++ _deprecated=0 ++ shift 2;; ++ -n) if _dogetarg $2 >/dev/null; then ++ echo 0; ++ if [ "$_deprecated" = "1" ]; then ++ [ -n "$_newoption" ] && warn "Kernel command line option '$2' is deprecated, use '$_newoption=0' instead." || warn "Option '$2' is deprecated." ++ fi ++ return 1 ++ fi ++ _deprecated=0 ++ shift 2;; ++ *) if [ -z "$_newoption" ]; then ++ _newoption="$1" ++ fi ++ if _dogetarg $1; then ++ if [ "$_deprecated" = "1" ]; then ++ [ -n "$_newoption" ] && warn "Kernel command line option '$1' is deprecated, use '$_newoption' instead." || warn "Option '$1' is deprecated." ++ fi ++ return 0; ++ fi ++ _deprecated=0 ++ shift;; ++ esac ++ done ++ return 1 ++} ++ ++getargbool() { ++ local _b ++ unset _b ++ local _default ++ _default="$1"; shift ++ _b=$(getarg "$@") ++ [ $? -ne 0 -a -z "$_b" ] && _b="$_default" ++ if [ -n "$_b" ]; then ++ [ $_b = "0" ] && return 1 ++ [ $_b = "no" ] && return 1 ++ [ $_b = "off" ] && return 1 ++ fi ++ return 0 ++} + export PATH=/sbin:/bin:/usr/sbin:/usr/bin + strstr() { [ "${1##*"$2"*}" != "$1" ]; } + CMDLINE=$(while read line || [ -n "$line" ]; do echo $line;done < /proc/cmdline) +@@ -12,7 +107,7 @@ export PS1='initramfs-test:\w\$ ' + [ -f /etc/fstab ] || ln -sfn /proc/mounts /etc/fstab + stty sane + echo "made it to the rootfs!" +-if strstr "$CMDLINE" "rd.shell"; then ++if getargbool 0 rd.shell; then + strstr "$(setsid --help)" "control" && CTTY="-c" + setsid $CTTY sh -i + fi +diff --git a/test/TEST-01-BASIC/test.sh b/test/TEST-01-BASIC/test.sh +index 959ac05..ab84074 100755 +--- a/test/TEST-01-BASIC/test.sh ++++ b/test/TEST-01-BASIC/test.sh +@@ -14,7 +14,7 @@ test_run() { + -m 256M -smp 2 -nographic \ + -net none \ + -watchdog i6300esb -watchdog-action poweroff \ +- -append "root=LABEL=dracut rw systemd.log_level=debug systemd.log_target=console rd.retry=3 rd.debug console=ttyS0,115200n81 $DEBUGFAIL" \ ++ -append "root=LABEL=dracut rw systemd.log_level=debug systemd.log_target=console rd.retry=3 rd.debug console=ttyS0,115200n81 rd.shell=0 $DEBUGFAIL" \ + -initrd $TESTDIR/initramfs.testing || return 1 + grep -F -m 1 -q dracut-root-block-success $TESTDIR/result || return 1 + } +@@ -90,6 +90,7 @@ test_setup() { + . $basedir/dracut-init.sh + inst_multiple poweroff shutdown + inst_hook shutdown-emergency 000 ./hard-off.sh ++ inst_hook emergency 000 ./hard-off.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + ) + sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \ +diff --git a/test/TEST-02-SYSTEMD/hard-off.sh b/test/TEST-02-SYSTEMD/hard-off.sh +index 12c3d5a..01acb19 100755 +--- a/test/TEST-02-SYSTEMD/hard-off.sh ++++ b/test/TEST-02-SYSTEMD/hard-off.sh +@@ -1,3 +1,3 @@ + #!/bin/sh +-getarg rd.shell || poweroff -f +-getarg failme && poweroff -f ++getargbool 0 rd.shell || poweroff -f ++getargbool 0 failme && poweroff -f +diff --git a/test/TEST-02-SYSTEMD/test-init.sh b/test/TEST-02-SYSTEMD/test-init.sh +index b7e0192..0999bc0 100755 +--- a/test/TEST-02-SYSTEMD/test-init.sh ++++ b/test/TEST-02-SYSTEMD/test-init.sh +@@ -1,4 +1,102 @@ + #!/bin/sh ++ ++getcmdline() { ++ while read -r _line || [ -n "$_line" ]; do ++ printf "%s" "$line" ++ done ", we want the exact match ++ if [ "$_o" = "$1" ]; then ++ _val="1"; ++ unset _doecho ++ fi ++ continue ++ fi ++ ++ if [ "${_o#*=}" = "$_o" ]; then ++ # if cmdline argument has no "=", we assume "=1" ++ _val="1"; ++ unset _doecho ++ continue ++ fi ++ ++ _val="${_o#*=}" ++ _doecho=1 ++ fi ++ done ++ if [ -n "$_val" ]; then ++ [ "x$_doecho" != "x" ] && echo "$_val"; ++ return 0; ++ fi ++ return 1; ++} ++ ++getarg() { ++ local _deprecated _newoption ++ while [ $# -gt 0 ]; do ++ case $1 in ++ -d) _deprecated=1; shift;; ++ -y) if _dogetarg $2 >/dev/null; then ++ if [ "$_deprecated" = "1" ]; then ++ [ -n "$_newoption" ] && warn "Kernel command line option '$2' is deprecated, use '$_newoption' instead." || warn "Option '$2' is deprecated." ++ fi ++ echo 1 ++ return 0 ++ fi ++ _deprecated=0 ++ shift 2;; ++ -n) if _dogetarg $2 >/dev/null; then ++ echo 0; ++ if [ "$_deprecated" = "1" ]; then ++ [ -n "$_newoption" ] && warn "Kernel command line option '$2' is deprecated, use '$_newoption=0' instead." || warn "Option '$2' is deprecated." ++ fi ++ return 1 ++ fi ++ _deprecated=0 ++ shift 2;; ++ *) if [ -z "$_newoption" ]; then ++ _newoption="$1" ++ fi ++ if _dogetarg $1; then ++ if [ "$_deprecated" = "1" ]; then ++ [ -n "$_newoption" ] && warn "Kernel command line option '$1' is deprecated, use '$_newoption' instead." || warn "Option '$1' is deprecated." ++ fi ++ return 0; ++ fi ++ _deprecated=0 ++ shift;; ++ esac ++ done ++ return 1 ++} ++ ++getargbool() { ++ local _b ++ unset _b ++ local _default ++ _default="$1"; shift ++ _b=$(getarg "$@") ++ [ $? -ne 0 -a -z "$_b" ] && _b="$_default" ++ if [ -n "$_b" ]; then ++ [ $_b = "0" ] && return 1 ++ [ $_b = "no" ] && return 1 ++ [ $_b = "off" ] && return 1 ++ fi ++ return 0 ++} ++ ++ + export PATH=/sbin:/bin:/usr/sbin:/usr/bin + strstr() { [ "${1##*"$2"*}" != "$1" ]; } + CMDLINE=$(while read line || [ -n "$line" ]; do echo $line;done < /proc/cmdline) +@@ -11,7 +109,7 @@ export PS1='initramfs-test:\w\$ ' + [ -f /etc/fstab ] || ln -sfn /proc/mounts /etc/fstab + stty sane + echo "made it to the rootfs!" +-if strstr "$CMDLINE" "rd.shell"; then ++if getargbool 0 rd.shell; then + strstr "$(setsid --help)" "control" && CTTY="-c" + setsid $CTTY sh -i + fi +diff --git a/test/TEST-02-SYSTEMD/test.sh b/test/TEST-02-SYSTEMD/test.sh +index 6dc6f42..350cff8 100755 +--- a/test/TEST-02-SYSTEMD/test.sh ++++ b/test/TEST-02-SYSTEMD/test.sh +@@ -10,7 +10,7 @@ test_run() { + -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext3 \ + -m 256M -smp 2 -nographic \ + -net none \ +- -append "root=LABEL=dracut rw loglevel=77 systemd.log_level=debug systemd.log_target=console rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug init=/sbin/init $DEBUGFAIL" \ ++ -append "root=LABEL=dracut rw loglevel=77 systemd.log_level=debug systemd.log_target=console rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug init=/sbin/init rd.shell=0 $DEBUGFAIL" \ + -initrd $TESTDIR/initramfs.testing + grep -F -m 1 -q dracut-root-block-success $TESTDIR/root.ext3 || return 1 + } +@@ -87,6 +87,7 @@ test_setup() { + . $basedir/dracut-init.sh + inst_multiple poweroff shutdown + inst_hook shutdown-emergency 000 ./hard-off.sh ++ inst_hook emergency 000 ./hard-off.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + ) + sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \ +diff --git a/test/TEST-03-USR-MOUNT/hard-off.sh b/test/TEST-03-USR-MOUNT/hard-off.sh +index 12c3d5a..01acb19 100755 +--- a/test/TEST-03-USR-MOUNT/hard-off.sh ++++ b/test/TEST-03-USR-MOUNT/hard-off.sh +@@ -1,3 +1,3 @@ + #!/bin/sh +-getarg rd.shell || poweroff -f +-getarg failme && poweroff -f ++getargbool 0 rd.shell || poweroff -f ++getargbool 0 failme && poweroff -f +diff --git a/test/TEST-03-USR-MOUNT/test-init.sh b/test/TEST-03-USR-MOUNT/test-init.sh +index 48fbfea..68eaff0 100755 +--- a/test/TEST-03-USR-MOUNT/test-init.sh ++++ b/test/TEST-03-USR-MOUNT/test-init.sh +@@ -1,5 +1,100 @@ + #!/bin/sh + >/dev/watchdog ++getcmdline() { ++ while read -r _line || [ -n "$_line" ]; do ++ printf "%s" "$line" ++ done ", we want the exact match ++ if [ "$_o" = "$1" ]; then ++ _val="1"; ++ unset _doecho ++ fi ++ continue ++ fi ++ ++ if [ "${_o#*=}" = "$_o" ]; then ++ # if cmdline argument has no "=", we assume "=1" ++ _val="1"; ++ unset _doecho ++ continue ++ fi ++ ++ _val="${_o#*=}" ++ _doecho=1 ++ fi ++ done ++ if [ -n "$_val" ]; then ++ [ "x$_doecho" != "x" ] && echo "$_val"; ++ return 0; ++ fi ++ return 1; ++} ++ ++getarg() { ++ local _deprecated _newoption ++ while [ $# -gt 0 ]; do ++ case $1 in ++ -d) _deprecated=1; shift;; ++ -y) if _dogetarg $2 >/dev/null; then ++ if [ "$_deprecated" = "1" ]; then ++ [ -n "$_newoption" ] && warn "Kernel command line option '$2' is deprecated, use '$_newoption' instead." || warn "Option '$2' is deprecated." ++ fi ++ echo 1 ++ return 0 ++ fi ++ _deprecated=0 ++ shift 2;; ++ -n) if _dogetarg $2 >/dev/null; then ++ echo 0; ++ if [ "$_deprecated" = "1" ]; then ++ [ -n "$_newoption" ] && warn "Kernel command line option '$2' is deprecated, use '$_newoption=0' instead." || warn "Option '$2' is deprecated." ++ fi ++ return 1 ++ fi ++ _deprecated=0 ++ shift 2;; ++ *) if [ -z "$_newoption" ]; then ++ _newoption="$1" ++ fi ++ if _dogetarg $1; then ++ if [ "$_deprecated" = "1" ]; then ++ [ -n "$_newoption" ] && warn "Kernel command line option '$1' is deprecated, use '$_newoption' instead." || warn "Option '$1' is deprecated." ++ fi ++ return 0; ++ fi ++ _deprecated=0 ++ shift;; ++ esac ++ done ++ return 1 ++} ++ ++getargbool() { ++ local _b ++ unset _b ++ local _default ++ _default="$1"; shift ++ _b=$(getarg "$@") ++ [ $? -ne 0 -a -z "$_b" ] && _b="$_default" ++ if [ -n "$_b" ]; then ++ [ $_b = "0" ] && return 1 ++ [ $_b = "no" ] && return 1 ++ [ $_b = "off" ] && return 1 ++ fi ++ return 0 ++} + export PATH=/sbin:/bin:/usr/sbin:/usr/bin + strstr() { [ "${1##*"$2"*}" != "$1" ]; } + CMDLINE=$(while read line || [ -n "$line" ]; do echo $line;done < /proc/cmdline) +@@ -22,7 +117,7 @@ export PS1='initramfs-test:\w\$ ' + [ -f /etc/fstab ] || ln -sfn /proc/mounts /etc/fstab + stty sane + echo "made it to the rootfs!" +-if strstr "$CMDLINE" "rd.shell"; then ++if getargbool 0 rd.shell; then + strstr "$(setsid --help)" "control" && CTTY="-c" + setsid $CTTY sh -i + fi +diff --git a/test/TEST-03-USR-MOUNT/test.sh b/test/TEST-03-USR-MOUNT/test.sh +index 0aca8cf..ed76d35 100755 +--- a/test/TEST-03-USR-MOUNT/test.sh ++++ b/test/TEST-03-USR-MOUNT/test.sh +@@ -21,7 +21,7 @@ client_run() { + -m 256M -smp 2 -nographic \ + -net none \ + -watchdog i6300esb -watchdog-action poweroff \ +- -append "root=LABEL=dracut $client_opts quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL" \ ++ -append "root=LABEL=dracut $client_opts quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug rd.shell=0 $DEBUGFAIL" \ + -initrd $TESTDIR/initramfs.testing + + if (($? != 0)); then +@@ -125,6 +125,7 @@ test_setup() { + . $basedir/dracut-init.sh + inst_multiple poweroff shutdown + inst_hook shutdown-emergency 000 ./hard-off.sh ++ inst_hook emergency 000 ./hard-off.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + ) + sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \ +diff --git a/test/TEST-04-FULL-SYSTEMD/hard-off.sh b/test/TEST-04-FULL-SYSTEMD/hard-off.sh +index 12c3d5a..01acb19 100755 +--- a/test/TEST-04-FULL-SYSTEMD/hard-off.sh ++++ b/test/TEST-04-FULL-SYSTEMD/hard-off.sh +@@ -1,3 +1,3 @@ + #!/bin/sh +-getarg rd.shell || poweroff -f +-getarg failme && poweroff -f ++getargbool 0 rd.shell || poweroff -f ++getargbool 0 failme && poweroff -f +diff --git a/test/TEST-04-FULL-SYSTEMD/test-init.sh b/test/TEST-04-FULL-SYSTEMD/test-init.sh +index ad516f1..e388afc 100755 +--- a/test/TEST-04-FULL-SYSTEMD/test-init.sh ++++ b/test/TEST-04-FULL-SYSTEMD/test-init.sh +@@ -1,5 +1,100 @@ + #!/bin/sh + >/dev/watchdog ++getcmdline() { ++ while read -r _line || [ -n "$_line" ]; do ++ printf "%s" "$line" ++ done ", we want the exact match ++ if [ "$_o" = "$1" ]; then ++ _val="1"; ++ unset _doecho ++ fi ++ continue ++ fi ++ ++ if [ "${_o#*=}" = "$_o" ]; then ++ # if cmdline argument has no "=", we assume "=1" ++ _val="1"; ++ unset _doecho ++ continue ++ fi ++ ++ _val="${_o#*=}" ++ _doecho=1 ++ fi ++ done ++ if [ -n "$_val" ]; then ++ [ "x$_doecho" != "x" ] && echo "$_val"; ++ return 0; ++ fi ++ return 1; ++} ++ ++getarg() { ++ local _deprecated _newoption ++ while [ $# -gt 0 ]; do ++ case $1 in ++ -d) _deprecated=1; shift;; ++ -y) if _dogetarg $2 >/dev/null; then ++ if [ "$_deprecated" = "1" ]; then ++ [ -n "$_newoption" ] && warn "Kernel command line option '$2' is deprecated, use '$_newoption' instead." || warn "Option '$2' is deprecated." ++ fi ++ echo 1 ++ return 0 ++ fi ++ _deprecated=0 ++ shift 2;; ++ -n) if _dogetarg $2 >/dev/null; then ++ echo 0; ++ if [ "$_deprecated" = "1" ]; then ++ [ -n "$_newoption" ] && warn "Kernel command line option '$2' is deprecated, use '$_newoption=0' instead." || warn "Option '$2' is deprecated." ++ fi ++ return 1 ++ fi ++ _deprecated=0 ++ shift 2;; ++ *) if [ -z "$_newoption" ]; then ++ _newoption="$1" ++ fi ++ if _dogetarg $1; then ++ if [ "$_deprecated" = "1" ]; then ++ [ -n "$_newoption" ] && warn "Kernel command line option '$1' is deprecated, use '$_newoption' instead." || warn "Option '$1' is deprecated." ++ fi ++ return 0; ++ fi ++ _deprecated=0 ++ shift;; ++ esac ++ done ++ return 1 ++} ++ ++getargbool() { ++ local _b ++ unset _b ++ local _default ++ _default="$1"; shift ++ _b=$(getarg "$@") ++ [ $? -ne 0 -a -z "$_b" ] && _b="$_default" ++ if [ -n "$_b" ]; then ++ [ $_b = "0" ] && return 1 ++ [ $_b = "no" ] && return 1 ++ [ $_b = "off" ] && return 1 ++ fi ++ return 0 ++} + export PATH=/sbin:/bin:/usr/sbin:/usr/bin + strstr() { [ "${1##*"$2"*}" != "$1" ]; } + CMDLINE=$(while read line || [ -n "$line" ]; do echo $line;done < /proc/cmdline) +@@ -35,7 +130,7 @@ export PS1='initramfs-test:\w\$ ' + [ -f /etc/fstab ] || ln -sfn /proc/mounts /etc/fstab + stty sane + echo "made it to the rootfs!" +-if strstr "$CMDLINE" "rd.shell"; then ++if getargbool 0 rd.shell; then + # while sleep 1; do sleep 1;done + strstr "$(setsid --help)" "control" && CTTY="-c" + setsid $CTTY sh -i +diff --git a/test/TEST-04-FULL-SYSTEMD/test.sh b/test/TEST-04-FULL-SYSTEMD/test.sh +index 884f441..88711ef 100755 +--- a/test/TEST-04-FULL-SYSTEMD/test.sh ++++ b/test/TEST-04-FULL-SYSTEMD/test.sh +@@ -22,7 +22,7 @@ client_run() { + -drive format=raw,index=2,media=disk,file=$TESTDIR/result \ + -m 256M -smp 2 -nographic \ + -net none \ +- -append "root=LABEL=dracut $client_opts rd.retry=3 console=ttyS0,115200n81 selinux=0 $DEBUGOUT $DEBUGFAIL" \ ++ -append "root=LABEL=dracut $client_opts rd.retry=3 console=ttyS0,115200n81 selinux=0 $DEBUGOUT rd.shell=0 $DEBUGFAIL" \ + -initrd $TESTDIR/initramfs.testing + + if (($? != 0)); then +@@ -262,6 +262,7 @@ EOF + . $basedir/dracut-init.sh + inst_multiple poweroff shutdown + inst_hook shutdown-emergency 000 ./hard-off.sh ++ inst_hook emergency 000 ./hard-off.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + ) + +diff --git a/test/TEST-10-RAID/hard-off.sh b/test/TEST-10-RAID/hard-off.sh +index 12c3d5a..01acb19 100755 +--- a/test/TEST-10-RAID/hard-off.sh ++++ b/test/TEST-10-RAID/hard-off.sh +@@ -1,3 +1,3 @@ + #!/bin/sh +-getarg rd.shell || poweroff -f +-getarg failme && poweroff -f ++getargbool 0 rd.shell || poweroff -f ++getargbool 0 failme && poweroff -f +diff --git a/test/TEST-10-RAID/test-init.sh b/test/TEST-10-RAID/test-init.sh +index c7c114e..7eb932a 100755 +--- a/test/TEST-10-RAID/test-init.sh ++++ b/test/TEST-10-RAID/test-init.sh +@@ -1,5 +1,100 @@ + #!/bin/sh + export PATH=/sbin:/bin:/usr/sbin:/usr/bin ++getcmdline() { ++ while read -r _line || [ -n "$_line" ]; do ++ printf "%s" "$line" ++ done ", we want the exact match ++ if [ "$_o" = "$1" ]; then ++ _val="1"; ++ unset _doecho ++ fi ++ continue ++ fi ++ ++ if [ "${_o#*=}" = "$_o" ]; then ++ # if cmdline argument has no "=", we assume "=1" ++ _val="1"; ++ unset _doecho ++ continue ++ fi ++ ++ _val="${_o#*=}" ++ _doecho=1 ++ fi ++ done ++ if [ -n "$_val" ]; then ++ [ "x$_doecho" != "x" ] && echo "$_val"; ++ return 0; ++ fi ++ return 1; ++} ++ ++getarg() { ++ local _deprecated _newoption ++ while [ $# -gt 0 ]; do ++ case $1 in ++ -d) _deprecated=1; shift;; ++ -y) if _dogetarg $2 >/dev/null; then ++ if [ "$_deprecated" = "1" ]; then ++ [ -n "$_newoption" ] && warn "Kernel command line option '$2' is deprecated, use '$_newoption' instead." || warn "Option '$2' is deprecated." ++ fi ++ echo 1 ++ return 0 ++ fi ++ _deprecated=0 ++ shift 2;; ++ -n) if _dogetarg $2 >/dev/null; then ++ echo 0; ++ if [ "$_deprecated" = "1" ]; then ++ [ -n "$_newoption" ] && warn "Kernel command line option '$2' is deprecated, use '$_newoption=0' instead." || warn "Option '$2' is deprecated." ++ fi ++ return 1 ++ fi ++ _deprecated=0 ++ shift 2;; ++ *) if [ -z "$_newoption" ]; then ++ _newoption="$1" ++ fi ++ if _dogetarg $1; then ++ if [ "$_deprecated" = "1" ]; then ++ [ -n "$_newoption" ] && warn "Kernel command line option '$1' is deprecated, use '$_newoption' instead." || warn "Option '$1' is deprecated." ++ fi ++ return 0; ++ fi ++ _deprecated=0 ++ shift;; ++ esac ++ done ++ return 1 ++} ++ ++getargbool() { ++ local _b ++ unset _b ++ local _default ++ _default="$1"; shift ++ _b=$(getarg "$@") ++ [ $? -ne 0 -a -z "$_b" ] && _b="$_default" ++ if [ -n "$_b" ]; then ++ [ $_b = "0" ] && return 1 ++ [ $_b = "no" ] && return 1 ++ [ $_b = "off" ] && return 1 ++ fi ++ return 0 ++} + strstr() { [ "${1##*"$2"*}" != "$1" ]; } + CMDLINE=$(while read line || [ -n "$line" ]; do echo $line;done < /proc/cmdline) + command -v plymouth >/dev/null && plymouth --quit +@@ -11,7 +106,7 @@ export PS1='initramfs-test:\w\$ ' + [ -f /etc/fstab ] || ln -sfn /proc/mounts /etc/fstab + stty sane + echo "made it to the rootfs!" +-strstr "$CMDLINE" "rd.shell" && sh -i ++getargbool 0 rd.shell && sh -i + echo "Powering down." + mount -n -o remount,ro / + #echo " rd.break=shutdown " >> /run/initramfs/etc/cmdline +diff --git a/test/TEST-10-RAID/test.sh b/test/TEST-10-RAID/test.sh +index 6ec77a6..2d09314 100755 +--- a/test/TEST-10-RAID/test.sh ++++ b/test/TEST-10-RAID/test.sh +@@ -12,7 +12,7 @@ test_run() { + -drive format=raw,index=0,media=disk,file=$DISKIMAGE \ + -m 256M -smp 2 -nographic \ + -net none \ +- -append "root=/dev/dracut/root rd.auto rw rd.retry=10 console=ttyS0,115200n81 selinux=0 $DEBUGFAIL" \ ++ -append "root=/dev/dracut/root rd.auto rw rd.retry=10 console=ttyS0,115200n81 selinux=0 rd.shell=0 $DEBUGFAIL" \ + -initrd $TESTDIR/initramfs.testing + grep -F -m 1 -q dracut-root-block-success $DISKIMAGE || return 1 + } +@@ -87,6 +87,7 @@ test_setup() { + . $basedir/dracut-init.sh + inst_multiple poweroff shutdown + inst_hook shutdown-emergency 000 ./hard-off.sh ++ inst_hook emergency 000 ./hard-off.sh + inst ./cryptroot-ask.sh /sbin/cryptroot-ask + mkdir -p $initdir/etc + echo "testluks UUID=$ID_FS_UUID /etc/key" > $initdir/etc/crypttab +diff --git a/test/TEST-11-LVM/hard-off.sh b/test/TEST-11-LVM/hard-off.sh +index 12c3d5a..01acb19 100755 +--- a/test/TEST-11-LVM/hard-off.sh ++++ b/test/TEST-11-LVM/hard-off.sh +@@ -1,3 +1,3 @@ + #!/bin/sh +-getarg rd.shell || poweroff -f +-getarg failme && poweroff -f ++getargbool 0 rd.shell || poweroff -f ++getargbool 0 failme && poweroff -f +diff --git a/test/TEST-11-LVM/test-init.sh b/test/TEST-11-LVM/test-init.sh +index 61a9543..18fd2b3 100755 +--- a/test/TEST-11-LVM/test-init.sh ++++ b/test/TEST-11-LVM/test-init.sh +@@ -1,5 +1,100 @@ + #!/bin/sh + export PATH=/sbin:/bin:/usr/sbin:/usr/bin ++getcmdline() { ++ while read -r _line || [ -n "$_line" ]; do ++ printf "%s" "$line" ++ done ", we want the exact match ++ if [ "$_o" = "$1" ]; then ++ _val="1"; ++ unset _doecho ++ fi ++ continue ++ fi ++ ++ if [ "${_o#*=}" = "$_o" ]; then ++ # if cmdline argument has no "=", we assume "=1" ++ _val="1"; ++ unset _doecho ++ continue ++ fi ++ ++ _val="${_o#*=}" ++ _doecho=1 ++ fi ++ done ++ if [ -n "$_val" ]; then ++ [ "x$_doecho" != "x" ] && echo "$_val"; ++ return 0; ++ fi ++ return 1; ++} ++ ++getarg() { ++ local _deprecated _newoption ++ while [ $# -gt 0 ]; do ++ case $1 in ++ -d) _deprecated=1; shift;; ++ -y) if _dogetarg $2 >/dev/null; then ++ if [ "$_deprecated" = "1" ]; then ++ [ -n "$_newoption" ] && warn "Kernel command line option '$2' is deprecated, use '$_newoption' instead." || warn "Option '$2' is deprecated." ++ fi ++ echo 1 ++ return 0 ++ fi ++ _deprecated=0 ++ shift 2;; ++ -n) if _dogetarg $2 >/dev/null; then ++ echo 0; ++ if [ "$_deprecated" = "1" ]; then ++ [ -n "$_newoption" ] && warn "Kernel command line option '$2' is deprecated, use '$_newoption=0' instead." || warn "Option '$2' is deprecated." ++ fi ++ return 1 ++ fi ++ _deprecated=0 ++ shift 2;; ++ *) if [ -z "$_newoption" ]; then ++ _newoption="$1" ++ fi ++ if _dogetarg $1; then ++ if [ "$_deprecated" = "1" ]; then ++ [ -n "$_newoption" ] && warn "Kernel command line option '$1' is deprecated, use '$_newoption' instead." || warn "Option '$1' is deprecated." ++ fi ++ return 0; ++ fi ++ _deprecated=0 ++ shift;; ++ esac ++ done ++ return 1 ++} ++ ++getargbool() { ++ local _b ++ unset _b ++ local _default ++ _default="$1"; shift ++ _b=$(getarg "$@") ++ [ $? -ne 0 -a -z "$_b" ] && _b="$_default" ++ if [ -n "$_b" ]; then ++ [ $_b = "0" ] && return 1 ++ [ $_b = "no" ] && return 1 ++ [ $_b = "off" ] && return 1 ++ fi ++ return 0 ++} + strstr() { [ "${1##*"$2"*}" != "$1" ]; } + CMDLINE=$(while read line || [ -n "$line" ]; do echo $line;done < /proc/cmdline) + plymouth --quit +@@ -11,7 +106,7 @@ export PS1='initramfs-test:\w\$ ' + [ -f /etc/fstab ] || ln -sfn /proc/mounts /etc/fstab + stty sane + echo "made it to the rootfs!" +-strstr "$CMDLINE" "rd.shell" && sh -i ++getargbool 0 rd.shell && sh -i + echo "Powering down." + mount -n -o remount,ro / + poweroff -f +diff --git a/test/TEST-11-LVM/test.sh b/test/TEST-11-LVM/test.sh +index 412a065..97c2f97 100755 +--- a/test/TEST-11-LVM/test.sh ++++ b/test/TEST-11-LVM/test.sh +@@ -11,7 +11,7 @@ test_run() { + -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ + -m 256M -smp 2 -nographic \ + -net none \ +- -append "root=/dev/dracut/root rw rd.auto=1 quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL" \ ++ -append "root=/dev/dracut/root rw rd.auto=1 quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug rd.shell=0 $DEBUGFAIL" \ + -initrd $TESTDIR/initramfs.testing + grep -F -m 1 -q dracut-root-block-success $TESTDIR/root.ext2 || return 1 + } +@@ -80,6 +80,7 @@ test_setup() { + . $basedir/dracut-init.sh + inst_multiple poweroff shutdown + inst_hook shutdown-emergency 000 ./hard-off.sh ++ inst_hook emergency 000 ./hard-off.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + ) + sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \ +diff --git a/test/TEST-12-RAID-DEG/hard-off.sh b/test/TEST-12-RAID-DEG/hard-off.sh +index 07a8f1f..cf44fb0 100755 +--- a/test/TEST-12-RAID-DEG/hard-off.sh ++++ b/test/TEST-12-RAID-DEG/hard-off.sh +@@ -1,3 +1,3 @@ + #!/bin/sh +-getarg rd.shell || poweroff -f +-! getarg rd.break && getarg failme && poweroff -f ++getargbool 0 rd.shell || poweroff -f ++! getargbool 0 rd.break && getargbool 0 failme && poweroff -f +diff --git a/test/TEST-12-RAID-DEG/test-init.sh b/test/TEST-12-RAID-DEG/test-init.sh +index c7c114e..7eb932a 100755 +--- a/test/TEST-12-RAID-DEG/test-init.sh ++++ b/test/TEST-12-RAID-DEG/test-init.sh +@@ -1,5 +1,100 @@ + #!/bin/sh + export PATH=/sbin:/bin:/usr/sbin:/usr/bin ++getcmdline() { ++ while read -r _line || [ -n "$_line" ]; do ++ printf "%s" "$line" ++ done ", we want the exact match ++ if [ "$_o" = "$1" ]; then ++ _val="1"; ++ unset _doecho ++ fi ++ continue ++ fi ++ ++ if [ "${_o#*=}" = "$_o" ]; then ++ # if cmdline argument has no "=", we assume "=1" ++ _val="1"; ++ unset _doecho ++ continue ++ fi ++ ++ _val="${_o#*=}" ++ _doecho=1 ++ fi ++ done ++ if [ -n "$_val" ]; then ++ [ "x$_doecho" != "x" ] && echo "$_val"; ++ return 0; ++ fi ++ return 1; ++} ++ ++getarg() { ++ local _deprecated _newoption ++ while [ $# -gt 0 ]; do ++ case $1 in ++ -d) _deprecated=1; shift;; ++ -y) if _dogetarg $2 >/dev/null; then ++ if [ "$_deprecated" = "1" ]; then ++ [ -n "$_newoption" ] && warn "Kernel command line option '$2' is deprecated, use '$_newoption' instead." || warn "Option '$2' is deprecated." ++ fi ++ echo 1 ++ return 0 ++ fi ++ _deprecated=0 ++ shift 2;; ++ -n) if _dogetarg $2 >/dev/null; then ++ echo 0; ++ if [ "$_deprecated" = "1" ]; then ++ [ -n "$_newoption" ] && warn "Kernel command line option '$2' is deprecated, use '$_newoption=0' instead." || warn "Option '$2' is deprecated." ++ fi ++ return 1 ++ fi ++ _deprecated=0 ++ shift 2;; ++ *) if [ -z "$_newoption" ]; then ++ _newoption="$1" ++ fi ++ if _dogetarg $1; then ++ if [ "$_deprecated" = "1" ]; then ++ [ -n "$_newoption" ] && warn "Kernel command line option '$1' is deprecated, use '$_newoption' instead." || warn "Option '$1' is deprecated." ++ fi ++ return 0; ++ fi ++ _deprecated=0 ++ shift;; ++ esac ++ done ++ return 1 ++} ++ ++getargbool() { ++ local _b ++ unset _b ++ local _default ++ _default="$1"; shift ++ _b=$(getarg "$@") ++ [ $? -ne 0 -a -z "$_b" ] && _b="$_default" ++ if [ -n "$_b" ]; then ++ [ $_b = "0" ] && return 1 ++ [ $_b = "no" ] && return 1 ++ [ $_b = "off" ] && return 1 ++ fi ++ return 0 ++} + strstr() { [ "${1##*"$2"*}" != "$1" ]; } + CMDLINE=$(while read line || [ -n "$line" ]; do echo $line;done < /proc/cmdline) + command -v plymouth >/dev/null && plymouth --quit +@@ -11,7 +106,7 @@ export PS1='initramfs-test:\w\$ ' + [ -f /etc/fstab ] || ln -sfn /proc/mounts /etc/fstab + stty sane + echo "made it to the rootfs!" +-strstr "$CMDLINE" "rd.shell" && sh -i ++getargbool 0 rd.shell && sh -i + echo "Powering down." + mount -n -o remount,ro / + #echo " rd.break=shutdown " >> /run/initramfs/etc/cmdline +diff --git a/test/TEST-12-RAID-DEG/test.sh b/test/TEST-12-RAID-DEG/test.sh +index 444dca6..09d78dd 100755 +--- a/test/TEST-12-RAID-DEG/test.sh ++++ b/test/TEST-12-RAID-DEG/test.sh +@@ -19,7 +19,7 @@ client_run() { + -drive format=raw,index=2,media=disk,file=$TESTDIR/disk2.img.new \ + -drive format=raw,index=3,media=disk,file=$TESTDIR/disk3.img.new \ + -net none \ +- -append "$* root=LABEL=root rw rd.retry=10 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL " \ ++ -append "$* root=LABEL=root rw rd.retry=10 rd.info console=ttyS0,115200n81 selinux=0 rd.debug rd.shell=0 $DEBUGFAIL " \ + -initrd $TESTDIR/initramfs.testing + if ! grep -F -m 1 -q dracut-root-block-success $TESTDIR/root.ext2; then + echo "CLIENT TEST END: $@ [FAIL]" +@@ -130,6 +130,7 @@ test_setup() { + . $basedir/dracut-init.sh + inst_multiple poweroff shutdown + inst_hook shutdown-emergency 000 ./hard-off.sh ++ inst_hook emergency 000 ./hard-off.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + inst ./cryptroot-ask.sh /sbin/cryptroot-ask + mkdir -p $initdir/etc +diff --git a/test/TEST-13-ENC-RAID-LVM/hard-off.sh b/test/TEST-13-ENC-RAID-LVM/hard-off.sh +index 12c3d5a..01acb19 100755 +--- a/test/TEST-13-ENC-RAID-LVM/hard-off.sh ++++ b/test/TEST-13-ENC-RAID-LVM/hard-off.sh +@@ -1,3 +1,3 @@ + #!/bin/sh +-getarg rd.shell || poweroff -f +-getarg failme && poweroff -f ++getargbool 0 rd.shell || poweroff -f ++getargbool 0 failme && poweroff -f +diff --git a/test/TEST-13-ENC-RAID-LVM/test.sh b/test/TEST-13-ENC-RAID-LVM/test.sh +index 2a814f8..3e8c3e2 100755 +--- a/test/TEST-13-ENC-RAID-LVM/test.sh ++++ b/test/TEST-13-ENC-RAID-LVM/test.sh +@@ -19,7 +19,7 @@ test_run() { + -drive format=raw,index=1,media=disk,file=$TESTDIR/check-success.img \ + -m 256M -smp 2 -nographic \ + -net none \ +- -append "root=/dev/dracut/root rw rd.auto rd.retry=20 console=ttyS0,115200n81 selinux=0 rd.debug rootwait $LUKSARGS $DEBUGFAIL" \ ++ -append "root=/dev/dracut/root rw rd.auto rd.retry=20 console=ttyS0,115200n81 selinux=0 rd.debug rootwait $LUKSARGS rd.shell=0 $DEBUGFAIL" \ + -initrd $TESTDIR/initramfs.testing + grep -F -m 1 -q dracut-root-block-success $TESTDIR/check-success.img || return 1 + echo "CLIENT TEST END: [OK]" +@@ -124,6 +124,7 @@ test_setup() { + . $basedir/dracut-init.sh + inst_multiple poweroff shutdown + inst_hook shutdown-emergency 000 ./hard-off.sh ++ inst_hook emergency 000 ./hard-off.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + inst ./cryptroot-ask.sh /sbin/cryptroot-ask + mkdir -p $initdir/etc +diff --git a/test/TEST-14-IMSM/hard-off.sh b/test/TEST-14-IMSM/hard-off.sh +index f340d2d..780a0b2 100755 +--- a/test/TEST-14-IMSM/hard-off.sh ++++ b/test/TEST-14-IMSM/hard-off.sh +@@ -1,3 +1,3 @@ + #!/bin/sh +-getarg rd.shell || poweroff -f +-getarg failme && poweroff -f ++getargbool 0 rd.shell || poweroff -f ++getargbool 0 failme && poweroff -f +diff --git a/test/TEST-14-IMSM/test-init.sh b/test/TEST-14-IMSM/test-init.sh +index ba63245..127185a 100755 +--- a/test/TEST-14-IMSM/test-init.sh ++++ b/test/TEST-14-IMSM/test-init.sh +@@ -1,4 +1,99 @@ + #!/bin/sh ++getcmdline() { ++ while read -r _line || [ -n "$_line" ]; do ++ printf "%s" "$line" ++ done ", we want the exact match ++ if [ "$_o" = "$1" ]; then ++ _val="1"; ++ unset _doecho ++ fi ++ continue ++ fi ++ ++ if [ "${_o#*=}" = "$_o" ]; then ++ # if cmdline argument has no "=", we assume "=1" ++ _val="1"; ++ unset _doecho ++ continue ++ fi ++ ++ _val="${_o#*=}" ++ _doecho=1 ++ fi ++ done ++ if [ -n "$_val" ]; then ++ [ "x$_doecho" != "x" ] && echo "$_val"; ++ return 0; ++ fi ++ return 1; ++} ++ ++getarg() { ++ local _deprecated _newoption ++ while [ $# -gt 0 ]; do ++ case $1 in ++ -d) _deprecated=1; shift;; ++ -y) if _dogetarg $2 >/dev/null; then ++ if [ "$_deprecated" = "1" ]; then ++ [ -n "$_newoption" ] && warn "Kernel command line option '$2' is deprecated, use '$_newoption' instead." || warn "Option '$2' is deprecated." ++ fi ++ echo 1 ++ return 0 ++ fi ++ _deprecated=0 ++ shift 2;; ++ -n) if _dogetarg $2 >/dev/null; then ++ echo 0; ++ if [ "$_deprecated" = "1" ]; then ++ [ -n "$_newoption" ] && warn "Kernel command line option '$2' is deprecated, use '$_newoption=0' instead." || warn "Option '$2' is deprecated." ++ fi ++ return 1 ++ fi ++ _deprecated=0 ++ shift 2;; ++ *) if [ -z "$_newoption" ]; then ++ _newoption="$1" ++ fi ++ if _dogetarg $1; then ++ if [ "$_deprecated" = "1" ]; then ++ [ -n "$_newoption" ] && warn "Kernel command line option '$1' is deprecated, use '$_newoption' instead." || warn "Option '$1' is deprecated." ++ fi ++ return 0; ++ fi ++ _deprecated=0 ++ shift;; ++ esac ++ done ++ return 1 ++} ++ ++getargbool() { ++ local _b ++ unset _b ++ local _default ++ _default="$1"; shift ++ _b=$(getarg "$@") ++ [ $? -ne 0 -a -z "$_b" ] && _b="$_default" ++ if [ -n "$_b" ]; then ++ [ $_b = "0" ] && return 1 ++ [ $_b = "no" ] && return 1 ++ [ $_b = "off" ] && return 1 ++ fi ++ return 0 ++} + export PATH=/sbin:/bin:/usr/sbin:/usr/bin + strstr() { [ "${1##*"$2"*}" != "$1" ]; } + CMDLINE=$(while read line || [ -n "$line" ]; do echo $line;done < /proc/cmdline) +@@ -11,7 +106,7 @@ cat /proc/mdstat + [ -f /etc/fstab ] || ln -s /proc/mounts /etc/fstab + stty sane + echo "made it to the rootfs!" +-strstr "$CMDLINE" "rd.shell" && sh -i ++getargbool 0 rd.shell && sh -i + echo "Powering down." + mount -n -o remount,ro / + poweroff -f +diff --git a/test/TEST-14-IMSM/test.sh b/test/TEST-14-IMSM/test.sh +index 315bc5a..9083fd5 100755 +--- a/test/TEST-14-IMSM/test.sh ++++ b/test/TEST-14-IMSM/test.sh +@@ -15,7 +15,7 @@ client_run() { + -drive format=raw,index=2,media=disk,file=$TESTDIR/disk2 \ + -m 256M -nographic \ + -net none \ +- -append "$* root=LABEL=root rw debug rd.retry=5 rd.debug console=ttyS0,115200n81 selinux=0 rd.info $DEBUGFAIL" \ ++ -append "$* root=LABEL=root rw debug rd.retry=5 rd.debug console=ttyS0,115200n81 selinux=0 rd.info rd.shell=0 $DEBUGFAIL" \ + -initrd $TESTDIR/initramfs.testing + if ! grep -F -m 1 -q dracut-root-block-success $TESTDIR/root.ext2; then + echo "CLIENT TEST END: $@ [FAIL]" +@@ -114,6 +114,7 @@ test_setup() { + . $basedir/dracut-init.sh + inst_multiple poweroff shutdown + inst_hook shutdown-emergency 000 ./hard-off.sh ++ inst_hook emergency 000 ./hard-off.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + ) + sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \ +diff --git a/test/TEST-15-BTRFSRAID/hard-off.sh b/test/TEST-15-BTRFSRAID/hard-off.sh +index 12c3d5a..01acb19 100755 +--- a/test/TEST-15-BTRFSRAID/hard-off.sh ++++ b/test/TEST-15-BTRFSRAID/hard-off.sh +@@ -1,3 +1,3 @@ + #!/bin/sh +-getarg rd.shell || poweroff -f +-getarg failme && poweroff -f ++getargbool 0 rd.shell || poweroff -f ++getargbool 0 failme && poweroff -f +diff --git a/test/TEST-15-BTRFSRAID/test.sh b/test/TEST-15-BTRFSRAID/test.sh +index 8e2ea49..281f856 100755 +--- a/test/TEST-15-BTRFSRAID/test.sh ++++ b/test/TEST-15-BTRFSRAID/test.sh +@@ -11,7 +11,7 @@ test_run() { + -drive format=raw,index=0,media=disk,file=$DISKIMAGE \ + -m 256M -smp 2 -nographic \ + -net none \ +- -append "root=LABEL=root rw rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 $DEBUGFAIL" \ ++ -append "root=LABEL=root rw rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.shell=0 $DEBUGFAIL" \ + -initrd $TESTDIR/initramfs.testing + dd if=$DISKIMAGE bs=512 count=4 skip=2048 | grep -F -m 1 -q dracut-root-block-success $DISKIMAGE || return 1 + } +@@ -88,6 +88,7 @@ test_setup() { + . $basedir/dracut-init.sh + inst_multiple poweroff shutdown + inst_hook shutdown-emergency 000 ./hard-off.sh ++ inst_hook emergency 000 ./hard-off.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + ) + sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \ +diff --git a/test/TEST-16-DMSQUASH/hard-off.sh b/test/TEST-16-DMSQUASH/hard-off.sh +index 12c3d5a..01acb19 100755 +--- a/test/TEST-16-DMSQUASH/hard-off.sh ++++ b/test/TEST-16-DMSQUASH/hard-off.sh +@@ -1,3 +1,3 @@ + #!/bin/sh +-getarg rd.shell || poweroff -f +-getarg failme && poweroff -f ++getargbool 0 rd.shell || poweroff -f ++getargbool 0 failme && poweroff -f +diff --git a/test/TEST-16-DMSQUASH/test-init.sh b/test/TEST-16-DMSQUASH/test-init.sh +index 206298d..5fe523c 100755 +--- a/test/TEST-16-DMSQUASH/test-init.sh ++++ b/test/TEST-16-DMSQUASH/test-init.sh +@@ -1,4 +1,99 @@ + #!/bin/sh ++getcmdline() { ++ while read -r _line || [ -n "$_line" ]; do ++ printf "%s" "$line" ++ done ", we want the exact match ++ if [ "$_o" = "$1" ]; then ++ _val="1"; ++ unset _doecho ++ fi ++ continue ++ fi ++ ++ if [ "${_o#*=}" = "$_o" ]; then ++ # if cmdline argument has no "=", we assume "=1" ++ _val="1"; ++ unset _doecho ++ continue ++ fi ++ ++ _val="${_o#*=}" ++ _doecho=1 ++ fi ++ done ++ if [ -n "$_val" ]; then ++ [ "x$_doecho" != "x" ] && echo "$_val"; ++ return 0; ++ fi ++ return 1; ++} ++ ++getarg() { ++ local _deprecated _newoption ++ while [ $# -gt 0 ]; do ++ case $1 in ++ -d) _deprecated=1; shift;; ++ -y) if _dogetarg $2 >/dev/null; then ++ if [ "$_deprecated" = "1" ]; then ++ [ -n "$_newoption" ] && warn "Kernel command line option '$2' is deprecated, use '$_newoption' instead." || warn "Option '$2' is deprecated." ++ fi ++ echo 1 ++ return 0 ++ fi ++ _deprecated=0 ++ shift 2;; ++ -n) if _dogetarg $2 >/dev/null; then ++ echo 0; ++ if [ "$_deprecated" = "1" ]; then ++ [ -n "$_newoption" ] && warn "Kernel command line option '$2' is deprecated, use '$_newoption=0' instead." || warn "Option '$2' is deprecated." ++ fi ++ return 1 ++ fi ++ _deprecated=0 ++ shift 2;; ++ *) if [ -z "$_newoption" ]; then ++ _newoption="$1" ++ fi ++ if _dogetarg $1; then ++ if [ "$_deprecated" = "1" ]; then ++ [ -n "$_newoption" ] && warn "Kernel command line option '$1' is deprecated, use '$_newoption' instead." || warn "Option '$1' is deprecated." ++ fi ++ return 0; ++ fi ++ _deprecated=0 ++ shift;; ++ esac ++ done ++ return 1 ++} ++ ++getargbool() { ++ local _b ++ unset _b ++ local _default ++ _default="$1"; shift ++ _b=$(getarg "$@") ++ [ $? -ne 0 -a -z "$_b" ] && _b="$_default" ++ if [ -n "$_b" ]; then ++ [ $_b = "0" ] && return 1 ++ [ $_b = "no" ] && return 1 ++ [ $_b = "off" ] && return 1 ++ fi ++ return 0 ++} + export PATH=/sbin:/bin:/usr/sbin:/usr/bin + strstr() { [ "${1##*"$2"*}" != "$1" ]; } + CMDLINE=$(while read line || [ -n "$line" ]; do echo $line;done < /proc/cmdline) +@@ -11,7 +106,7 @@ export PS1='initramfs-test:\w\$ ' + [ -f /etc/fstab ] || ln -sfn /proc/mounts /etc/fstab + stty sane + echo "made it to the rootfs!" +-strstr "$CMDLINE" "rd.shell" && sh -i ++getargbool 0 rd.shell && sh -i + echo "Powering down." + mount -n -o remount,ro / + poweroff -f +diff --git a/test/TEST-16-DMSQUASH/test.sh b/test/TEST-16-DMSQUASH/test.sh +index b255492..4d72470 100755 +--- a/test/TEST-16-DMSQUASH/test.sh ++++ b/test/TEST-16-DMSQUASH/test.sh +@@ -22,7 +22,7 @@ test_run() { + -m 256M -smp 2 \ + -nographic \ + -net none \ +- -append "root=live:CDLABEL=LiveCD live rw quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 $DEBUGFAIL" \ ++ -append "root=live:CDLABEL=LiveCD live rw quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.shell=0 $DEBUGFAIL" \ + -initrd "$TESTDIR"/initramfs.testing + + # mediacheck test with qemu GUI +@@ -44,6 +44,7 @@ test_setup() { + . "$basedir"/dracut-init.sh + inst_multiple poweroff shutdown + inst_hook shutdown-emergency 000 ./hard-off.sh ++ inst_hook emergency 000 ./hard-off.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + ) + +diff --git a/test/TEST-17-LVM-THIN/hard-off.sh b/test/TEST-17-LVM-THIN/hard-off.sh +index 12c3d5a..f4d19dc 100755 +--- a/test/TEST-17-LVM-THIN/hard-off.sh ++++ b/test/TEST-17-LVM-THIN/hard-off.sh +@@ -1,3 +1,3 @@ + #!/bin/sh +-getarg rd.shell || poweroff -f ++getargbool 0 rd.shell || poweroff -f + getarg failme && poweroff -f +diff --git a/test/TEST-17-LVM-THIN/test-init.sh b/test/TEST-17-LVM-THIN/test-init.sh +index 61a9543..77fb346 100755 +--- a/test/TEST-17-LVM-THIN/test-init.sh ++++ b/test/TEST-17-LVM-THIN/test-init.sh +@@ -1,4 +1,99 @@ + #!/bin/sh ++getcmdline() { ++ while read -r _line || [ -n "$_line" ]; do ++ printf "%s" "$line" ++ done ", we want the exact match ++ if [ "$_o" = "$1" ]; then ++ _val="1"; ++ unset _doecho ++ fi ++ continue ++ fi ++ ++ if [ "${_o#*=}" = "$_o" ]; then ++ # if cmdline argument has no "=", we assume "=1" ++ _val="1"; ++ unset _doecho ++ continue ++ fi ++ ++ _val="${_o#*=}" ++ _doecho=1 ++ fi ++ done ++ if [ -n "$_val" ]; then ++ [ "x$_doecho" != "x" ] && echo "$_val"; ++ return 0; ++ fi ++ return 1; ++} ++ ++getarg() { ++ local _deprecated _newoption ++ while [ $# -gt 0 ]; do ++ case $1 in ++ -d) _deprecated=1; shift;; ++ -y) if _dogetarg $2 >/dev/null; then ++ if [ "$_deprecated" = "1" ]; then ++ [ -n "$_newoption" ] && warn "Kernel command line option '$2' is deprecated, use '$_newoption' instead." || warn "Option '$2' is deprecated." ++ fi ++ echo 1 ++ return 0 ++ fi ++ _deprecated=0 ++ shift 2;; ++ -n) if _dogetarg $2 >/dev/null; then ++ echo 0; ++ if [ "$_deprecated" = "1" ]; then ++ [ -n "$_newoption" ] && warn "Kernel command line option '$2' is deprecated, use '$_newoption=0' instead." || warn "Option '$2' is deprecated." ++ fi ++ return 1 ++ fi ++ _deprecated=0 ++ shift 2;; ++ *) if [ -z "$_newoption" ]; then ++ _newoption="$1" ++ fi ++ if _dogetarg $1; then ++ if [ "$_deprecated" = "1" ]; then ++ [ -n "$_newoption" ] && warn "Kernel command line option '$1' is deprecated, use '$_newoption' instead." || warn "Option '$1' is deprecated." ++ fi ++ return 0; ++ fi ++ _deprecated=0 ++ shift;; ++ esac ++ done ++ return 1 ++} ++ ++getargbool() { ++ local _b ++ unset _b ++ local _default ++ _default="$1"; shift ++ _b=$(getarg "$@") ++ [ $? -ne 0 -a -z "$_b" ] && _b="$_default" ++ if [ -n "$_b" ]; then ++ [ $_b = "0" ] && return 1 ++ [ $_b = "no" ] && return 1 ++ [ $_b = "off" ] && return 1 ++ fi ++ return 0 ++} + export PATH=/sbin:/bin:/usr/sbin:/usr/bin + strstr() { [ "${1##*"$2"*}" != "$1" ]; } + CMDLINE=$(while read line || [ -n "$line" ]; do echo $line;done < /proc/cmdline) +@@ -11,7 +106,7 @@ export PS1='initramfs-test:\w\$ ' + [ -f /etc/fstab ] || ln -sfn /proc/mounts /etc/fstab + stty sane + echo "made it to the rootfs!" +-strstr "$CMDLINE" "rd.shell" && sh -i ++getargbool 0 rd.shell && sh -i + echo "Powering down." + mount -n -o remount,ro / + poweroff -f +diff --git a/test/TEST-17-LVM-THIN/test.sh b/test/TEST-17-LVM-THIN/test.sh +index e337591..1485f72 100755 +--- a/test/TEST-17-LVM-THIN/test.sh ++++ b/test/TEST-17-LVM-THIN/test.sh +@@ -11,7 +11,7 @@ test_run() { + -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ + -m 256M -smp 2 -nographic \ + -net none \ +- -append "root=/dev/dracut/root rw rd.auto=1 quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL" \ ++ -append "root=/dev/dracut/root rw rd.auto=1 quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug rd.shell=0 $DEBUGFAIL" \ + -initrd $TESTDIR/initramfs.testing + grep -F -m 1 -q dracut-root-block-success $TESTDIR/root.ext2 || return 1 + } +@@ -80,6 +80,7 @@ test_setup() { + . $basedir/dracut-init.sh + inst_multiple poweroff shutdown + inst_hook shutdown-emergency 000 ./hard-off.sh ++ inst_hook emergency 000 ./hard-off.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + ) + sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \ +diff --git a/test/TEST-20-NFS/client-init.sh b/test/TEST-20-NFS/client-init.sh +index a443289..eea162c 100755 +--- a/test/TEST-20-NFS/client-init.sh ++++ b/test/TEST-20-NFS/client-init.sh +@@ -1,4 +1,99 @@ + #!/bin/sh ++getcmdline() { ++ while read -r _line || [ -n "$_line" ]; do ++ printf "%s" "$line" ++ done ", we want the exact match ++ if [ "$_o" = "$1" ]; then ++ _val="1"; ++ unset _doecho ++ fi ++ continue ++ fi ++ ++ if [ "${_o#*=}" = "$_o" ]; then ++ # if cmdline argument has no "=", we assume "=1" ++ _val="1"; ++ unset _doecho ++ continue ++ fi ++ ++ _val="${_o#*=}" ++ _doecho=1 ++ fi ++ done ++ if [ -n "$_val" ]; then ++ [ "x$_doecho" != "x" ] && echo "$_val"; ++ return 0; ++ fi ++ return 1; ++} ++ ++getarg() { ++ local _deprecated _newoption ++ while [ $# -gt 0 ]; do ++ case $1 in ++ -d) _deprecated=1; shift;; ++ -y) if _dogetarg $2 >/dev/null; then ++ if [ "$_deprecated" = "1" ]; then ++ [ -n "$_newoption" ] && warn "Kernel command line option '$2' is deprecated, use '$_newoption' instead." || warn "Option '$2' is deprecated." ++ fi ++ echo 1 ++ return 0 ++ fi ++ _deprecated=0 ++ shift 2;; ++ -n) if _dogetarg $2 >/dev/null; then ++ echo 0; ++ if [ "$_deprecated" = "1" ]; then ++ [ -n "$_newoption" ] && warn "Kernel command line option '$2' is deprecated, use '$_newoption=0' instead." || warn "Option '$2' is deprecated." ++ fi ++ return 1 ++ fi ++ _deprecated=0 ++ shift 2;; ++ *) if [ -z "$_newoption" ]; then ++ _newoption="$1" ++ fi ++ if _dogetarg $1; then ++ if [ "$_deprecated" = "1" ]; then ++ [ -n "$_newoption" ] && warn "Kernel command line option '$1' is deprecated, use '$_newoption' instead." || warn "Option '$1' is deprecated." ++ fi ++ return 0; ++ fi ++ _deprecated=0 ++ shift;; ++ esac ++ done ++ return 1 ++} ++ ++getargbool() { ++ local _b ++ unset _b ++ local _default ++ _default="$1"; shift ++ _b=$(getarg "$@") ++ [ $? -ne 0 -a -z "$_b" ] && _b="$_default" ++ if [ -n "$_b" ]; then ++ [ $_b = "0" ] && return 1 ++ [ $_b = "no" ] && return 1 ++ [ $_b = "off" ] && return 1 ++ fi ++ return 0 ++} + export PATH=/sbin:/bin:/usr/sbin:/usr/bin + exec >/dev/console 2>&1 + export TERM=linux +@@ -7,7 +102,7 @@ CMDLINE=$(while read line || [ -n "$line" ]; do echo $line;done < /proc/cmdline) + strstr() { [ "${1##*"$2"*}" != "$1" ]; } + + stty sane +-if strstr "$CMDLINE" "rd.shell"; then ++if getargbool 0 rd.shell; then + [ -c /dev/watchdog ] && printf 'V' > /dev/watchdog + strstr "$(setsid --help)" "control" && CTTY="-c" + setsid $CTTY sh -i +diff --git a/test/TEST-20-NFS/hard-off.sh b/test/TEST-20-NFS/hard-off.sh +index 12c3d5a..01acb19 100755 +--- a/test/TEST-20-NFS/hard-off.sh ++++ b/test/TEST-20-NFS/hard-off.sh +@@ -1,3 +1,3 @@ + #!/bin/sh +-getarg rd.shell || poweroff -f +-getarg failme && poweroff -f ++getargbool 0 rd.shell || poweroff -f ++getargbool 0 failme && poweroff -f +diff --git a/test/TEST-20-NFS/test.sh b/test/TEST-20-NFS/test.sh +index 1dfdfc4..d7df71e 100755 +--- a/test/TEST-20-NFS/test.sh ++++ b/test/TEST-20-NFS/test.sh +@@ -54,7 +54,7 @@ client_test() { + -net nic,macaddr=$mac,model=e1000 \ + -net socket,connect=127.0.0.1:12320 \ + -watchdog i6300esb -watchdog-action poweroff \ +- -append "$cmdline $DEBUGFAIL rd.debug rd.retry=10 rd.info quiet ro console=ttyS0,115200n81 selinux=0" \ ++ -append "rd.shell=0 $cmdline $DEBUGFAIL rd.debug rd.retry=10 rd.info quiet ro console=ttyS0,115200n81 selinux=0" \ + -initrd $TESTDIR/initramfs.testing + + if [[ $? -ne 0 ]] || ! grep -F -m 1 -q nfs-OK $TESTDIR/client.img; then +@@ -335,6 +335,7 @@ test_setup() { + mkdir $TESTDIR/overlay + inst_multiple poweroff shutdown + inst_hook shutdown-emergency 000 ./hard-off.sh ++ inst_hook emergency 000 ./hard-off.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + ) + +diff --git a/test/TEST-30-ISCSI/client-init.sh b/test/TEST-30-ISCSI/client-init.sh +index 2e422cd..7279987 100755 +--- a/test/TEST-30-ISCSI/client-init.sh ++++ b/test/TEST-30-ISCSI/client-init.sh +@@ -1,4 +1,99 @@ + #!/bin/sh ++getcmdline() { ++ while read -r _line || [ -n "$_line" ]; do ++ printf "%s" "$line" ++ done ", we want the exact match ++ if [ "$_o" = "$1" ]; then ++ _val="1"; ++ unset _doecho ++ fi ++ continue ++ fi ++ ++ if [ "${_o#*=}" = "$_o" ]; then ++ # if cmdline argument has no "=", we assume "=1" ++ _val="1"; ++ unset _doecho ++ continue ++ fi ++ ++ _val="${_o#*=}" ++ _doecho=1 ++ fi ++ done ++ if [ -n "$_val" ]; then ++ [ "x$_doecho" != "x" ] && echo "$_val"; ++ return 0; ++ fi ++ return 1; ++} ++ ++getarg() { ++ local _deprecated _newoption ++ while [ $# -gt 0 ]; do ++ case $1 in ++ -d) _deprecated=1; shift;; ++ -y) if _dogetarg $2 >/dev/null; then ++ if [ "$_deprecated" = "1" ]; then ++ [ -n "$_newoption" ] && warn "Kernel command line option '$2' is deprecated, use '$_newoption' instead." || warn "Option '$2' is deprecated." ++ fi ++ echo 1 ++ return 0 ++ fi ++ _deprecated=0 ++ shift 2;; ++ -n) if _dogetarg $2 >/dev/null; then ++ echo 0; ++ if [ "$_deprecated" = "1" ]; then ++ [ -n "$_newoption" ] && warn "Kernel command line option '$2' is deprecated, use '$_newoption=0' instead." || warn "Option '$2' is deprecated." ++ fi ++ return 1 ++ fi ++ _deprecated=0 ++ shift 2;; ++ *) if [ -z "$_newoption" ]; then ++ _newoption="$1" ++ fi ++ if _dogetarg $1; then ++ if [ "$_deprecated" = "1" ]; then ++ [ -n "$_newoption" ] && warn "Kernel command line option '$1' is deprecated, use '$_newoption' instead." || warn "Option '$1' is deprecated." ++ fi ++ return 0; ++ fi ++ _deprecated=0 ++ shift;; ++ esac ++ done ++ return 1 ++} ++ ++getargbool() { ++ local _b ++ unset _b ++ local _default ++ _default="$1"; shift ++ _b=$(getarg "$@") ++ [ $? -ne 0 -a -z "$_b" ] && _b="$_default" ++ if [ -n "$_b" ]; then ++ [ $_b = "0" ] && return 1 ++ [ $_b = "no" ] && return 1 ++ [ $_b = "off" ] && return 1 ++ fi ++ return 0 ++} + export PATH=/sbin:/bin:/usr/sbin:/usr/bin + exec >/dev/console 2>&1 + strstr() { [ "${1##*"$2"*}" != "$1" ]; } +@@ -13,7 +108,7 @@ while read dev fs fstype opts rest || [ -n "$dev" ]; do + break + done < /proc/mounts + #sh -i +-if strstr "$CMDLINE" "rd.shell"; then ++if getargbool 0 rd.shell; then + strstr "$(setsid --help)" "control" && CTTY="-c" + setsid $CTTY sh -i + fi +diff --git a/test/TEST-30-ISCSI/hard-off.sh b/test/TEST-30-ISCSI/hard-off.sh +index 12c3d5a..01acb19 100755 +--- a/test/TEST-30-ISCSI/hard-off.sh ++++ b/test/TEST-30-ISCSI/hard-off.sh +@@ -1,3 +1,3 @@ + #!/bin/sh +-getarg rd.shell || poweroff -f +-getarg failme && poweroff -f ++getargbool 0 rd.shell || poweroff -f ++getargbool 0 failme && poweroff -f +diff --git a/test/TEST-30-ISCSI/test.sh b/test/TEST-30-ISCSI/test.sh +index 1c06b06..83fd623 100755 +--- a/test/TEST-30-ISCSI/test.sh ++++ b/test/TEST-30-ISCSI/test.sh +@@ -49,7 +49,7 @@ run_client() { + -net nic,macaddr=52:54:00:12:34:00,model=e1000 \ + -net nic,macaddr=52:54:00:12:34:01,model=e1000 \ + -net socket,connect=127.0.0.1:12330 \ +- -append "rw rd.auto rd.retry=50 console=ttyS0,115200n81 selinux=0 rd.debug=0 $DEBUGFAIL $*" \ ++ -append "rw rd.auto rd.retry=50 console=ttyS0,115200n81 selinux=0 rd.debug=0 rd.shell=0 $DEBUGFAIL $*" \ + -initrd $TESTDIR/initramfs.testing + if ! grep -F -m 1 -q iscsi-OK $TESTDIR/client.img; then + echo "CLIENT TEST END: $test_name [FAILED - BAD EXIT]" +@@ -214,6 +214,7 @@ test_setup() { + . $basedir/dracut-init.sh + inst_multiple poweroff shutdown + inst_hook shutdown-emergency 000 ./hard-off.sh ++ inst_hook emergency 000 ./hard-off.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + ) + sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \ +diff --git a/test/TEST-40-NBD/hard-off.sh b/test/TEST-40-NBD/hard-off.sh +index 12c3d5a..01acb19 100755 +--- a/test/TEST-40-NBD/hard-off.sh ++++ b/test/TEST-40-NBD/hard-off.sh +@@ -1,3 +1,3 @@ + #!/bin/sh +-getarg rd.shell || poweroff -f +-getarg failme && poweroff -f ++getargbool 0 rd.shell || poweroff -f ++getargbool 0 failme && poweroff -f +diff --git a/test/TEST-40-NBD/test.sh b/test/TEST-40-NBD/test.sh +index 2061392..40e09b7 100755 +--- a/test/TEST-40-NBD/test.sh ++++ b/test/TEST-40-NBD/test.sh +@@ -58,7 +58,7 @@ client_test() { + -nographic \ + -net nic,macaddr=$mac,model=e1000 \ + -net socket,connect=127.0.0.1:12340 \ +- -append "$cmdline $DEBUGFAIL rd.auto rd.info rd.retry=10 ro console=ttyS0,115200n81 selinux=0 " \ ++ -append "rd.shell=0 $cmdline $DEBUGFAIL rd.auto rd.info rd.retry=10 ro console=ttyS0,115200n81 selinux=0 " \ + -initrd $TESTDIR/initramfs.testing + + if [[ $? -ne 0 ]] || ! grep -F -m 1 -q nbd-OK $TESTDIR/flag.img; then +@@ -227,6 +227,7 @@ make_encrypted_root() { + ) + inst_multiple mke2fs poweroff cp umount tune2fs + inst_hook shutdown-emergency 000 ./hard-off.sh ++ inst_hook emergency 000 ./hard-off.sh + inst_hook initqueue 01 ./create-root.sh + inst_hook initqueue/finished 01 ./finished-false.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules +diff --git a/test/TEST-50-MULTINIC/client-init.sh b/test/TEST-50-MULTINIC/client-init.sh +index e6157af..d9ba45e 100755 +--- a/test/TEST-50-MULTINIC/client-init.sh ++++ b/test/TEST-50-MULTINIC/client-init.sh +@@ -1,4 +1,100 @@ + #!/bin/sh ++getcmdline() { ++ while read -r _line || [ -n "$_line" ]; do ++ printf "%s" "$line" ++ done ", we want the exact match ++ if [ "$_o" = "$1" ]; then ++ _val="1"; ++ unset _doecho ++ fi ++ continue ++ fi ++ ++ if [ "${_o#*=}" = "$_o" ]; then ++ # if cmdline argument has no "=", we assume "=1" ++ _val="1"; ++ unset _doecho ++ continue ++ fi ++ ++ _val="${_o#*=}" ++ _doecho=1 ++ fi ++ done ++ if [ -n "$_val" ]; then ++ [ "x$_doecho" != "x" ] && echo "$_val"; ++ return 0; ++ fi ++ return 1; ++} ++ ++getarg() { ++ local _deprecated _newoption ++ while [ $# -gt 0 ]; do ++ case $1 in ++ -d) _deprecated=1; shift;; ++ -y) if _dogetarg $2 >/dev/null; then ++ if [ "$_deprecated" = "1" ]; then ++ [ -n "$_newoption" ] && warn "Kernel command line option '$2' is deprecated, use '$_newoption' instead." || warn "Option '$2' is deprecated." ++ fi ++ echo 1 ++ return 0 ++ fi ++ _deprecated=0 ++ shift 2;; ++ -n) if _dogetarg $2 >/dev/null; then ++ echo 0; ++ if [ "$_deprecated" = "1" ]; then ++ [ -n "$_newoption" ] && warn "Kernel command line option '$2' is deprecated, use '$_newoption=0' instead." || warn "Option '$2' is deprecated." ++ fi ++ return 1 ++ fi ++ _deprecated=0 ++ shift 2;; ++ *) if [ -z "$_newoption" ]; then ++ _newoption="$1" ++ fi ++ if _dogetarg $1; then ++ if [ "$_deprecated" = "1" ]; then ++ [ -n "$_newoption" ] && warn "Kernel command line option '$1' is deprecated, use '$_newoption' instead." || warn "Option '$1' is deprecated." ++ fi ++ return 0; ++ fi ++ _deprecated=0 ++ shift;; ++ esac ++ done ++ return 1 ++} ++ ++getargbool() { ++ local _b ++ unset _b ++ local _default ++ _default="$1"; shift ++ _b=$(getarg "$@") ++ [ $? -ne 0 -a -z "$_b" ] && _b="$_default" ++ if [ -n "$_b" ]; then ++ [ $_b = "0" ] && return 1 ++ [ $_b = "no" ] && return 1 ++ [ $_b = "off" ] && return 1 ++ fi ++ return 0 ++} ++ + exec >/dev/console 2>&1 + set -x + export PATH=/sbin:/bin:/usr/sbin:/usr/bin +@@ -20,5 +116,5 @@ done + echo "$IFACES" + } > /dev/sda + +-strstr "$CMDLINE" "rd.shell" && sh -i ++getargbool 0 rd.shell && sh -i + poweroff -f +diff --git a/test/TEST-50-MULTINIC/hard-off.sh b/test/TEST-50-MULTINIC/hard-off.sh +index 12c3d5a..01acb19 100755 +--- a/test/TEST-50-MULTINIC/hard-off.sh ++++ b/test/TEST-50-MULTINIC/hard-off.sh +@@ -1,3 +1,3 @@ + #!/bin/sh +-getarg rd.shell || poweroff -f +-getarg failme && poweroff -f ++getargbool 0 rd.shell || poweroff -f ++getargbool 0 failme && poweroff -f +diff --git a/test/TEST-50-MULTINIC/test.sh b/test/TEST-50-MULTINIC/test.sh +index e0bf7d2..656c237 100755 +--- a/test/TEST-50-MULTINIC/test.sh ++++ b/test/TEST-50-MULTINIC/test.sh +@@ -54,7 +54,7 @@ client_test() { + -net nic,macaddr=52:54:00:12:34:$mac2,model=e1000 \ + -net nic,macaddr=52:54:00:12:34:$mac3,model=e1000 \ + -watchdog i6300esb -watchdog-action poweroff \ +- -append "$cmdline $DEBUGFAIL rd.retry=5 ro console=ttyS0,115200n81 selinux=0 init=/sbin/init rd.debug systemd.log_target=console loglevel=7" \ ++ -append "rd.shell=0 $cmdline $DEBUGFAIL rd.retry=5 ro console=ttyS0,115200n81 selinux=0 init=/sbin/init rd.debug systemd.log_target=console loglevel=7" \ + -initrd "$TESTDIR"/initramfs.testing + + { read OK; read IFACES; } < "$TESTDIR"/client.img +@@ -270,6 +270,7 @@ test_setup() { + . "$basedir"/dracut-init.sh + inst_multiple poweroff shutdown + inst_hook shutdown-emergency 000 ./hard-off.sh ++ inst_hook emergency 000 ./hard-off.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + ) + diff --git a/0086-test-TEST-99-RPM-fixed-test-suite.patch b/0086-test-TEST-99-RPM-fixed-test-suite.patch new file mode 100644 index 0000000..e772901 --- /dev/null +++ b/0086-test-TEST-99-RPM-fixed-test-suite.patch @@ -0,0 +1,83 @@ +From 00929425314d4a661c441397a56b163bbaab3de4 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Thu, 9 Jun 2016 18:14:45 +0200 +Subject: [PATCH] test/TEST-99-RPM: fixed test suite + +- cope with dnf vs yum +- fixed find arguments +- make script fail, if command fails +--- + test/TEST-99-RPM/test.sh | 25 ++++++++++++++----------- + 1 file changed, 14 insertions(+), 11 deletions(-) + +diff --git a/test/TEST-99-RPM/test.sh b/test/TEST-99-RPM/test.sh +index d0c89e5..31520f1 100755 +--- a/test/TEST-99-RPM/test.sh ++++ b/test/TEST-99-RPM/test.sh +@@ -5,6 +5,7 @@ $TESTDIR + + test_run() { + set -x ++ set -e + export rootdir=$TESTDIR/root + + mkdir -p $rootdir +@@ -13,15 +14,17 @@ test_run() { + mkdir -p "$rootdir/sys" + mkdir -p "$rootdir/dev" + +-trap 'ret=$?; [[ -d $rootdir ]] && { umount "$rootdir/proc"; umount "$rootdir/sys"; umount "$rootdir/dev"; rm -rf -- "$rootdir"; }; exit $ret;' EXIT +-trap '[[ -d $rootdir ]] && { umount "$rootdir/proc"; umount "$rootdir/sys"; umount "$rootdir/dev"; rm -rf -- "$rootdir"; }; exit 1;' SIGINT ++trap 'ret=$?; [[ -d $rootdir ]] && { umount "$rootdir/proc"; umount "$rootdir/sys"; umount "$rootdir/dev"; rm -rf -- "$rootdir"; } || :; exit $ret;' EXIT ++trap '[[ -d $rootdir ]] && { umount "$rootdir/proc"; umount "$rootdir/sys"; umount "$rootdir/dev"; rm -rf -- "$rootdir"; } || :; exit 1;' SIGINT + + mount --bind /proc "$rootdir/proc" + mount --bind /sys "$rootdir/sys" + mount -t devtmpfs devtmpfs "$rootdir/dev" + +- yum --nogpgcheck --releasever=/ --installroot "$rootdir"/ install -y \ +- yum \ ++ dnf_or_yum=yum ++ command -v dnf >/dev/null && dnf_or_yum=dnf ++ $dnf_or_yum --nogpgcheck --installroot "$rootdir"/ install --allowerasing -y \ ++ $dnf_or_yum \ + passwd \ + rootfiles \ + systemd \ +@@ -37,9 +40,9 @@ trap '[[ -d $rootdir ]] && { umount "$rootdir/proc"; umount "$rootdir/sys"; umou + + cat >"$rootdir"/test.sh < /test.output ++rpm -Va |& grep -F -v '85-display-manager.preset' &> /test.output + find / -xdev -type f -not -path '/var/*' \ + -not -path '/usr/lib/modules/*/modules.*' \ + -not -path '/etc/*-' \ +@@ -50,19 +53,19 @@ find / -xdev -type f -not -path '/var/*' \ + -not -path '/etc/nsswitch.conf.bak' \ + -not -path '/etc/iscsi/initiatorname.iscsi' \ + -not -path '/boot/*0-rescue*' \ +- -not -patch '/usr/share/mime/*' \ +- -not -patch '/etc/crypto-policies/*' \ ++ -not -path '/usr/share/mime/*' \ ++ -not -path '/etc/crypto-policies/*' \ + -not -path '/dev/null' \ + -not -path "/boot/loader/entries/\$(cat /etc/machine-id)-*" \ + -not -path "/boot/\$(cat /etc/machine-id)/*" \ + -exec rpm -qf '{}' ';' | \ +- grep -F 'not owned' &> /test.output +-exit ++ grep -F 'not owned' &>> /test.output || : ++exit 0 + EOF + + chmod 0755 "$rootdir/test.sh" + +- chroot "$rootdir" /test.sh ++ chroot "$rootdir" /test.sh || : + + if [[ -s "$rootdir"/test.output ]]; then + failed=1 diff --git a/0087-test-handle-kernel-panic-in-testsuite.patch b/0087-test-handle-kernel-panic-in-testsuite.patch new file mode 100644 index 0000000..5fae223 --- /dev/null +++ b/0087-test-handle-kernel-panic-in-testsuite.patch @@ -0,0 +1,310 @@ +From 36867f1abf5d82106447fa4d25275471c0406a56 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Fri, 10 Jun 2016 08:53:01 +0200 +Subject: [PATCH] test: handle kernel panic in testsuite + +- reboot kernel on panic +- qemu don't reboot +--- + test/TEST-01-BASIC/test.sh | 3 ++- + test/TEST-02-SYSTEMD/test.sh | 3 ++- + test/TEST-03-USR-MOUNT/test.sh | 3 ++- + test/TEST-04-FULL-SYSTEMD/test.sh | 3 ++- + test/TEST-10-RAID/test.sh | 3 ++- + test/TEST-11-LVM/test.sh | 3 ++- + test/TEST-12-RAID-DEG/test.sh | 3 ++- + test/TEST-13-ENC-RAID-LVM/test.sh | 9 ++++++--- + test/TEST-14-IMSM/test.sh | 3 ++- + test/TEST-15-BTRFSRAID/test.sh | 3 ++- + test/TEST-16-DMSQUASH/test.sh | 3 ++- + test/TEST-17-LVM-THIN/test.sh | 3 ++- + test/TEST-20-NFS/test.sh | 6 ++++-- + test/TEST-30-ISCSI/test.sh | 6 ++++-- + test/TEST-40-NBD/test.sh | 6 ++++-- + test/TEST-50-MULTINIC/test.sh | 6 ++++-- + 16 files changed, 44 insertions(+), 22 deletions(-) + +diff --git a/test/TEST-01-BASIC/test.sh b/test/TEST-01-BASIC/test.sh +index ab84074..e74c673 100755 +--- a/test/TEST-01-BASIC/test.sh ++++ b/test/TEST-01-BASIC/test.sh +@@ -14,7 +14,8 @@ test_run() { + -m 256M -smp 2 -nographic \ + -net none \ + -watchdog i6300esb -watchdog-action poweroff \ +- -append "root=LABEL=dracut rw systemd.log_level=debug systemd.log_target=console rd.retry=3 rd.debug console=ttyS0,115200n81 rd.shell=0 $DEBUGFAIL" \ ++ -no-reboot \ ++ -append "panic=1 root=LABEL=dracut rw systemd.log_level=debug systemd.log_target=console rd.retry=3 rd.debug console=ttyS0,115200n81 rd.shell=0 $DEBUGFAIL" \ + -initrd $TESTDIR/initramfs.testing || return 1 + grep -F -m 1 -q dracut-root-block-success $TESTDIR/result || return 1 + } +diff --git a/test/TEST-02-SYSTEMD/test.sh b/test/TEST-02-SYSTEMD/test.sh +index 350cff8..6189561 100755 +--- a/test/TEST-02-SYSTEMD/test.sh ++++ b/test/TEST-02-SYSTEMD/test.sh +@@ -10,7 +10,8 @@ test_run() { + -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext3 \ + -m 256M -smp 2 -nographic \ + -net none \ +- -append "root=LABEL=dracut rw loglevel=77 systemd.log_level=debug systemd.log_target=console rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug init=/sbin/init rd.shell=0 $DEBUGFAIL" \ ++ -no-reboot \ ++ -append "panic=1 root=LABEL=dracut rw loglevel=77 systemd.log_level=debug systemd.log_target=console rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug init=/sbin/init rd.shell=0 $DEBUGFAIL" \ + -initrd $TESTDIR/initramfs.testing + grep -F -m 1 -q dracut-root-block-success $TESTDIR/root.ext3 || return 1 + } +diff --git a/test/TEST-03-USR-MOUNT/test.sh b/test/TEST-03-USR-MOUNT/test.sh +index ed76d35..c515613 100755 +--- a/test/TEST-03-USR-MOUNT/test.sh ++++ b/test/TEST-03-USR-MOUNT/test.sh +@@ -21,7 +21,8 @@ client_run() { + -m 256M -smp 2 -nographic \ + -net none \ + -watchdog i6300esb -watchdog-action poweroff \ +- -append "root=LABEL=dracut $client_opts quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug rd.shell=0 $DEBUGFAIL" \ ++ -no-reboot \ ++ -append "panic=1 root=LABEL=dracut $client_opts quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug rd.shell=0 $DEBUGFAIL" \ + -initrd $TESTDIR/initramfs.testing + + if (($? != 0)); then +diff --git a/test/TEST-04-FULL-SYSTEMD/test.sh b/test/TEST-04-FULL-SYSTEMD/test.sh +index 88711ef..3baabb4 100755 +--- a/test/TEST-04-FULL-SYSTEMD/test.sh ++++ b/test/TEST-04-FULL-SYSTEMD/test.sh +@@ -22,7 +22,8 @@ client_run() { + -drive format=raw,index=2,media=disk,file=$TESTDIR/result \ + -m 256M -smp 2 -nographic \ + -net none \ +- -append "root=LABEL=dracut $client_opts rd.retry=3 console=ttyS0,115200n81 selinux=0 $DEBUGOUT rd.shell=0 $DEBUGFAIL" \ ++ -no-reboot \ ++ -append "panic=1 root=LABEL=dracut $client_opts rd.retry=3 console=ttyS0,115200n81 selinux=0 $DEBUGOUT rd.shell=0 $DEBUGFAIL" \ + -initrd $TESTDIR/initramfs.testing + + if (($? != 0)); then +diff --git a/test/TEST-10-RAID/test.sh b/test/TEST-10-RAID/test.sh +index 2d09314..5324457 100755 +--- a/test/TEST-10-RAID/test.sh ++++ b/test/TEST-10-RAID/test.sh +@@ -12,7 +12,8 @@ test_run() { + -drive format=raw,index=0,media=disk,file=$DISKIMAGE \ + -m 256M -smp 2 -nographic \ + -net none \ +- -append "root=/dev/dracut/root rd.auto rw rd.retry=10 console=ttyS0,115200n81 selinux=0 rd.shell=0 $DEBUGFAIL" \ ++ -no-reboot \ ++ -append "panic=1 root=/dev/dracut/root rd.auto rw rd.retry=10 console=ttyS0,115200n81 selinux=0 rd.shell=0 $DEBUGFAIL" \ + -initrd $TESTDIR/initramfs.testing + grep -F -m 1 -q dracut-root-block-success $DISKIMAGE || return 1 + } +diff --git a/test/TEST-11-LVM/test.sh b/test/TEST-11-LVM/test.sh +index 97c2f97..cf7d376 100755 +--- a/test/TEST-11-LVM/test.sh ++++ b/test/TEST-11-LVM/test.sh +@@ -11,7 +11,8 @@ test_run() { + -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ + -m 256M -smp 2 -nographic \ + -net none \ +- -append "root=/dev/dracut/root rw rd.auto=1 quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug rd.shell=0 $DEBUGFAIL" \ ++ -no-reboot \ ++ -append "panic=1 root=/dev/dracut/root rw rd.auto=1 quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug rd.shell=0 $DEBUGFAIL" \ + -initrd $TESTDIR/initramfs.testing + grep -F -m 1 -q dracut-root-block-success $TESTDIR/root.ext2 || return 1 + } +diff --git a/test/TEST-12-RAID-DEG/test.sh b/test/TEST-12-RAID-DEG/test.sh +index 09d78dd..4c313eb 100755 +--- a/test/TEST-12-RAID-DEG/test.sh ++++ b/test/TEST-12-RAID-DEG/test.sh +@@ -19,7 +19,8 @@ client_run() { + -drive format=raw,index=2,media=disk,file=$TESTDIR/disk2.img.new \ + -drive format=raw,index=3,media=disk,file=$TESTDIR/disk3.img.new \ + -net none \ +- -append "$* root=LABEL=root rw rd.retry=10 rd.info console=ttyS0,115200n81 selinux=0 rd.debug rd.shell=0 $DEBUGFAIL " \ ++ -no-reboot \ ++ -append "panic=1 $* root=LABEL=root rw rd.retry=10 rd.info console=ttyS0,115200n81 selinux=0 rd.debug rd.shell=0 $DEBUGFAIL " \ + -initrd $TESTDIR/initramfs.testing + if ! grep -F -m 1 -q dracut-root-block-success $TESTDIR/root.ext2; then + echo "CLIENT TEST END: $@ [FAIL]" +diff --git a/test/TEST-13-ENC-RAID-LVM/test.sh b/test/TEST-13-ENC-RAID-LVM/test.sh +index 3e8c3e2..b8fd26e 100755 +--- a/test/TEST-13-ENC-RAID-LVM/test.sh ++++ b/test/TEST-13-ENC-RAID-LVM/test.sh +@@ -19,7 +19,8 @@ test_run() { + -drive format=raw,index=1,media=disk,file=$TESTDIR/check-success.img \ + -m 256M -smp 2 -nographic \ + -net none \ +- -append "root=/dev/dracut/root rw rd.auto rd.retry=20 console=ttyS0,115200n81 selinux=0 rd.debug rootwait $LUKSARGS rd.shell=0 $DEBUGFAIL" \ ++ -no-reboot \ ++ -append "panic=1 root=/dev/dracut/root rw rd.auto rd.retry=20 console=ttyS0,115200n81 selinux=0 rd.debug rootwait $LUKSARGS rd.shell=0 $DEBUGFAIL" \ + -initrd $TESTDIR/initramfs.testing + grep -F -m 1 -q dracut-root-block-success $TESTDIR/check-success.img || return 1 + echo "CLIENT TEST END: [OK]" +@@ -32,7 +33,8 @@ test_run() { + -drive format=raw,index=1,media=disk,file=$TESTDIR/check-success.img \ + -m 256M -smp 2 -nographic \ + -net none \ +- -append "root=/dev/dracut/root rw quiet rd.auto rd.retry=20 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL" \ ++ -no-reboot \ ++ -append "panic=1 root=/dev/dracut/root rw quiet rd.auto rd.retry=20 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL" \ + -initrd $TESTDIR/initramfs.testing + grep -F -m 1 -q dracut-root-block-success $TESTDIR/check-success.img || return 1 + echo "CLIENT TEST END: [OK]" +@@ -45,7 +47,8 @@ test_run() { + -drive format=raw,index=1,media=disk,file=$TESTDIR/check-success.img \ + -m 256M -smp 2 -nographic \ + -net none \ +- -append "root=/dev/dracut/root rw quiet rd.auto rd.retry=10 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL rd.luks.uuid=failme" \ ++ -no-reboot \ ++ -append "panic=1 root=/dev/dracut/root rw quiet rd.auto rd.retry=10 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL rd.luks.uuid=failme" \ + -initrd $TESTDIR/initramfs.testing + grep -F -m 1 -q dracut-root-block-success $TESTDIR/check-success.img && return 1 + echo "CLIENT TEST END: [OK]" +diff --git a/test/TEST-14-IMSM/test.sh b/test/TEST-14-IMSM/test.sh +index 9083fd5..f9f03b7 100755 +--- a/test/TEST-14-IMSM/test.sh ++++ b/test/TEST-14-IMSM/test.sh +@@ -15,7 +15,8 @@ client_run() { + -drive format=raw,index=2,media=disk,file=$TESTDIR/disk2 \ + -m 256M -nographic \ + -net none \ +- -append "$* root=LABEL=root rw debug rd.retry=5 rd.debug console=ttyS0,115200n81 selinux=0 rd.info rd.shell=0 $DEBUGFAIL" \ ++ -no-reboot \ ++ -append "panic=1 $* root=LABEL=root rw debug rd.retry=5 rd.debug console=ttyS0,115200n81 selinux=0 rd.info rd.shell=0 $DEBUGFAIL" \ + -initrd $TESTDIR/initramfs.testing + if ! grep -F -m 1 -q dracut-root-block-success $TESTDIR/root.ext2; then + echo "CLIENT TEST END: $@ [FAIL]" +diff --git a/test/TEST-15-BTRFSRAID/test.sh b/test/TEST-15-BTRFSRAID/test.sh +index 281f856..adf31b1 100755 +--- a/test/TEST-15-BTRFSRAID/test.sh ++++ b/test/TEST-15-BTRFSRAID/test.sh +@@ -11,7 +11,8 @@ test_run() { + -drive format=raw,index=0,media=disk,file=$DISKIMAGE \ + -m 256M -smp 2 -nographic \ + -net none \ +- -append "root=LABEL=root rw rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.shell=0 $DEBUGFAIL" \ ++ -no-reboot \ ++ -append "panic=1 root=LABEL=root rw rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.shell=0 $DEBUGFAIL" \ + -initrd $TESTDIR/initramfs.testing + dd if=$DISKIMAGE bs=512 count=4 skip=2048 | grep -F -m 1 -q dracut-root-block-success $DISKIMAGE || return 1 + } +diff --git a/test/TEST-16-DMSQUASH/test.sh b/test/TEST-16-DMSQUASH/test.sh +index 4d72470..876d910 100755 +--- a/test/TEST-16-DMSQUASH/test.sh ++++ b/test/TEST-16-DMSQUASH/test.sh +@@ -22,7 +22,8 @@ test_run() { + -m 256M -smp 2 \ + -nographic \ + -net none \ +- -append "root=live:CDLABEL=LiveCD live rw quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.shell=0 $DEBUGFAIL" \ ++ -no-reboot \ ++ -append "panic=1 root=live:CDLABEL=LiveCD live rw quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.shell=0 $DEBUGFAIL" \ + -initrd "$TESTDIR"/initramfs.testing + + # mediacheck test with qemu GUI +diff --git a/test/TEST-17-LVM-THIN/test.sh b/test/TEST-17-LVM-THIN/test.sh +index 1485f72..1ad9ba6 100755 +--- a/test/TEST-17-LVM-THIN/test.sh ++++ b/test/TEST-17-LVM-THIN/test.sh +@@ -11,7 +11,8 @@ test_run() { + -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ + -m 256M -smp 2 -nographic \ + -net none \ +- -append "root=/dev/dracut/root rw rd.auto=1 quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug rd.shell=0 $DEBUGFAIL" \ ++ -no-reboot \ ++ -append "panic=1 root=/dev/dracut/root rw rd.auto=1 quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug rd.shell=0 $DEBUGFAIL" \ + -initrd $TESTDIR/initramfs.testing + grep -F -m 1 -q dracut-root-block-success $TESTDIR/root.ext2 || return 1 + } +diff --git a/test/TEST-20-NFS/test.sh b/test/TEST-20-NFS/test.sh +index d7df71e..222bd24 100755 +--- a/test/TEST-20-NFS/test.sh ++++ b/test/TEST-20-NFS/test.sh +@@ -20,7 +20,8 @@ run_server() { + -net nic,macaddr=52:54:00:12:34:56,model=e1000 \ + -serial ${SERIAL:-null} \ + -watchdog i6300esb -watchdog-action poweroff \ +- -append "rd.debug loglevel=77 root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0" \ ++ -no-reboot \ ++ -append "panic=1 rd.debug loglevel=77 root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0" \ + -initrd $TESTDIR/initramfs.server \ + -pidfile $TESTDIR/server.pid -daemonize || return 1 + sudo chmod 644 $TESTDIR/server.pid || return 1 +@@ -54,7 +55,8 @@ client_test() { + -net nic,macaddr=$mac,model=e1000 \ + -net socket,connect=127.0.0.1:12320 \ + -watchdog i6300esb -watchdog-action poweroff \ +- -append "rd.shell=0 $cmdline $DEBUGFAIL rd.debug rd.retry=10 rd.info quiet ro console=ttyS0,115200n81 selinux=0" \ ++ -no-reboot \ ++ -append "panic=1 rd.shell=0 $cmdline $DEBUGFAIL rd.debug rd.retry=10 rd.info quiet ro console=ttyS0,115200n81 selinux=0" \ + -initrd $TESTDIR/initramfs.testing + + if [[ $? -ne 0 ]] || ! grep -F -m 1 -q nfs-OK $TESTDIR/client.img; then +diff --git a/test/TEST-30-ISCSI/test.sh b/test/TEST-30-ISCSI/test.sh +index 83fd623..63944b3 100755 +--- a/test/TEST-30-ISCSI/test.sh ++++ b/test/TEST-30-ISCSI/test.sh +@@ -25,7 +25,8 @@ run_server() { + -net nic,macaddr=52:54:00:12:34:56,model=e1000 \ + -net nic,macaddr=52:54:00:12:34:57,model=e1000 \ + -net socket,listen=127.0.0.1:12330 \ +- -append "root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0 $SERVER_DEBUG" \ ++ -no-reboot \ ++ -append "panic=1 root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0 $SERVER_DEBUG" \ + -initrd $TESTDIR/initramfs.server \ + -pidfile $TESTDIR/server.pid -daemonize || return 1 + sudo chmod 644 $TESTDIR/server.pid || return 1 +@@ -49,7 +50,8 @@ run_client() { + -net nic,macaddr=52:54:00:12:34:00,model=e1000 \ + -net nic,macaddr=52:54:00:12:34:01,model=e1000 \ + -net socket,connect=127.0.0.1:12330 \ +- -append "rw rd.auto rd.retry=50 console=ttyS0,115200n81 selinux=0 rd.debug=0 rd.shell=0 $DEBUGFAIL $*" \ ++ -no-reboot \ ++ -append "panic=1 rw rd.auto rd.retry=50 console=ttyS0,115200n81 selinux=0 rd.debug=0 rd.shell=0 $DEBUGFAIL $*" \ + -initrd $TESTDIR/initramfs.testing + if ! grep -F -m 1 -q iscsi-OK $TESTDIR/client.img; then + echo "CLIENT TEST END: $test_name [FAILED - BAD EXIT]" +diff --git a/test/TEST-40-NBD/test.sh b/test/TEST-40-NBD/test.sh +index 40e09b7..8d49b05 100755 +--- a/test/TEST-40-NBD/test.sh ++++ b/test/TEST-40-NBD/test.sh +@@ -22,7 +22,8 @@ run_server() { + -net nic,macaddr=52:54:00:12:34:56,model=e1000 \ + -net socket,listen=127.0.0.1:12340 \ + -serial $SERIAL \ +- -append "root=/dev/sda rootfstype=ext2 rw quiet console=ttyS0,115200n81 selinux=0" \ ++ -no-reboot \ ++ -append "panic=1 root=/dev/sda rootfstype=ext2 rw quiet console=ttyS0,115200n81 selinux=0" \ + -initrd $TESTDIR/initramfs.server -pidfile $TESTDIR/server.pid -daemonize || return 1 + sudo chmod 644 $TESTDIR/server.pid || return 1 + +@@ -58,7 +59,8 @@ client_test() { + -nographic \ + -net nic,macaddr=$mac,model=e1000 \ + -net socket,connect=127.0.0.1:12340 \ +- -append "rd.shell=0 $cmdline $DEBUGFAIL rd.auto rd.info rd.retry=10 ro console=ttyS0,115200n81 selinux=0 " \ ++ -no-reboot \ ++ -append "panic=1 rd.shell=0 $cmdline $DEBUGFAIL rd.auto rd.info rd.retry=10 ro console=ttyS0,115200n81 selinux=0 " \ + -initrd $TESTDIR/initramfs.testing + + if [[ $? -ne 0 ]] || ! grep -F -m 1 -q nbd-OK $TESTDIR/flag.img; then +diff --git a/test/TEST-50-MULTINIC/test.sh b/test/TEST-50-MULTINIC/test.sh +index 656c237..ef27682 100755 +--- a/test/TEST-50-MULTINIC/test.sh ++++ b/test/TEST-50-MULTINIC/test.sh +@@ -20,7 +20,8 @@ run_server() { + -net nic,macaddr=52:54:01:12:34:56,model=e1000 \ + -serial ${SERIAL:-null} \ + -watchdog i6300esb -watchdog-action poweroff \ +- -append "loglevel=7 root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0" \ ++ -no-reboot \ ++ -append "panic=1 loglevel=7 root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0" \ + -initrd "$TESTDIR"/initramfs.server \ + -pidfile "$TESTDIR"/server.pid -daemonize || return 1 + sudo chmod 644 -- "$TESTDIR"/server.pid || return 1 +@@ -54,7 +55,8 @@ client_test() { + -net nic,macaddr=52:54:00:12:34:$mac2,model=e1000 \ + -net nic,macaddr=52:54:00:12:34:$mac3,model=e1000 \ + -watchdog i6300esb -watchdog-action poweroff \ +- -append "rd.shell=0 $cmdline $DEBUGFAIL rd.retry=5 ro console=ttyS0,115200n81 selinux=0 init=/sbin/init rd.debug systemd.log_target=console loglevel=7" \ ++ -no-reboot \ ++ -append "panic=1 rd.shell=0 $cmdline $DEBUGFAIL rd.retry=5 ro console=ttyS0,115200n81 selinux=0 init=/sbin/init rd.debug systemd.log_target=console loglevel=7" \ + -initrd "$TESTDIR"/initramfs.testing + + { read OK; read IFACES; } < "$TESTDIR"/client.img diff --git a/0088-systemd-add-missing-.slice-unit.patch b/0088-systemd-add-missing-.slice-unit.patch new file mode 100644 index 0000000..0ed4f57 --- /dev/null +++ b/0088-systemd-add-missing-.slice-unit.patch @@ -0,0 +1,21 @@ +From 8261d2367ee673e24d03306b9623f4f3070dae5b Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Wed, 22 Jun 2016 18:11:28 +0200 +Subject: [PATCH] systemd: add missing -.slice unit + +--- + modules.d/00systemd/module-setup.sh | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/modules.d/00systemd/module-setup.sh b/modules.d/00systemd/module-setup.sh +index dcee08b..e4260c7 100755 +--- a/modules.d/00systemd/module-setup.sh ++++ b/modules.d/00systemd/module-setup.sh +@@ -122,6 +122,7 @@ install() { + \ + $systemdsystemunitdir/slices.target \ + $systemdsystemunitdir/system.slice \ ++ $systemdsystemunitdir/-.slice \ + \ + $tmpfilesdir/systemd.conf \ + \ diff --git a/0089-dracut-systemd-.service-conflict-with-shutdown-targe.patch b/0089-dracut-systemd-.service-conflict-with-shutdown-targe.patch new file mode 100644 index 0000000..4215e16 --- /dev/null +++ b/0089-dracut-systemd-.service-conflict-with-shutdown-targe.patch @@ -0,0 +1,168 @@ +From c000a21c25bd436f2b3cc2076cb7025cc82d2807 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Wed, 22 Jun 2016 18:12:19 +0200 +Subject: [PATCH] dracut-systemd/*.service: conflict with shutdown target + +make reboot/poweroff/halt work + +also conflict with emergency.target +--- + modules.d/98dracut-systemd/dracut-cmdline-ask.service | 2 ++ + modules.d/98dracut-systemd/dracut-cmdline.service | 2 ++ + modules.d/98dracut-systemd/dracut-emergency.service | 5 +++-- + modules.d/98dracut-systemd/dracut-initqueue.service | 2 ++ + modules.d/98dracut-systemd/dracut-mount.service | 2 ++ + modules.d/98dracut-systemd/dracut-pre-mount.service | 2 ++ + modules.d/98dracut-systemd/dracut-pre-pivot.service | 3 +++ + modules.d/98dracut-systemd/dracut-pre-trigger.service | 2 ++ + modules.d/98dracut-systemd/dracut-pre-udev.service | 2 ++ + modules.d/98dracut-systemd/emergency.service | 2 ++ + 10 files changed, 22 insertions(+), 2 deletions(-) + +diff --git a/modules.d/98dracut-systemd/dracut-cmdline-ask.service b/modules.d/98dracut-systemd/dracut-cmdline-ask.service +index 8bc7d80..1685479 100644 +--- a/modules.d/98dracut-systemd/dracut-cmdline-ask.service ++++ b/modules.d/98dracut-systemd/dracut-cmdline-ask.service +@@ -16,6 +16,8 @@ Wants=systemd-journald.socket + ConditionPathExists=/usr/lib/initrd-release + ConditionKernelCommandLine=|rd.cmdline=ask + ConditionPathExistsGlob=|/etc/cmdline.d/*.conf ++Conflicts=shutdown.target emergency.target ++Before=shutdown.target emergency.target + + [Service] + Environment=DRACUT_SYSTEMD=1 +diff --git a/modules.d/98dracut-systemd/dracut-cmdline.service b/modules.d/98dracut-systemd/dracut-cmdline.service +index 6eeb991..c22856e 100644 +--- a/modules.d/98dracut-systemd/dracut-cmdline.service ++++ b/modules.d/98dracut-systemd/dracut-cmdline.service +@@ -20,6 +20,8 @@ ConditionDirectoryNotEmpty=|/lib/dracut/hooks/cmdline + ConditionKernelCommandLine=|rd.break=cmdline + ConditionKernelCommandLine=|resume + ConditionKernelCommandLine=|noresume ++Conflicts=shutdown.target emergency.target ++Before=shutdown.target emergency.target + + [Service] + Environment=DRACUT_SYSTEMD=1 +diff --git a/modules.d/98dracut-systemd/dracut-emergency.service b/modules.d/98dracut-systemd/dracut-emergency.service +index a523671..61077bd 100644 +--- a/modules.d/98dracut-systemd/dracut-emergency.service ++++ b/modules.d/98dracut-systemd/dracut-emergency.service +@@ -12,14 +12,15 @@ Description=Dracut Emergency Shell + DefaultDependencies=no + After=systemd-vconsole-setup.service + Wants=systemd-vconsole-setup.service +-Conflicts=emergency.service emergency.target ++Conflicts=shutdown.target emergency.target ++Before=shutdown.target emergency.target + + [Service] + Environment=HOME=/ + Environment=DRACUT_SYSTEMD=1 + Environment=NEWROOT=/sysroot + WorkingDirectory=/ +-ExecStart=/bin/dracut-emergency ++ExecStart=-/bin/dracut-emergency + ExecStopPost=-/bin/rm -f -- /.console_lock + Type=oneshot + StandardInput=tty-force +diff --git a/modules.d/98dracut-systemd/dracut-initqueue.service b/modules.d/98dracut-systemd/dracut-initqueue.service +index fa5ca56..20d6a8c 100644 +--- a/modules.d/98dracut-systemd/dracut-initqueue.service ++++ b/modules.d/98dracut-systemd/dracut-initqueue.service +@@ -18,6 +18,8 @@ Wants=systemd-udev-trigger.service + ConditionPathExists=/usr/lib/initrd-release + ConditionPathExists=|/lib/dracut/need-initqueue + ConditionKernelCommandLine=|rd.break=initqueue ++Conflicts=shutdown.target emergency.target ++Before=shutdown.target emergency.target + + [Service] + Environment=DRACUT_SYSTEMD=1 +diff --git a/modules.d/98dracut-systemd/dracut-mount.service b/modules.d/98dracut-systemd/dracut-mount.service +index 1b14f4a..baa8edb 100644 +--- a/modules.d/98dracut-systemd/dracut-mount.service ++++ b/modules.d/98dracut-systemd/dracut-mount.service +@@ -15,6 +15,8 @@ After=dracut-initqueue.service dracut-pre-mount.service + ConditionPathExists=/usr/lib/initrd-release + ConditionDirectoryNotEmpty=|/lib/dracut/hooks/mount + ConditionKernelCommandLine=|rd.break=mount ++Conflicts=shutdown.target emergency.target ++Before=shutdown.target emergency.target + + [Service] + Environment=DRACUT_SYSTEMD=1 +diff --git a/modules.d/98dracut-systemd/dracut-pre-mount.service b/modules.d/98dracut-systemd/dracut-pre-mount.service +index 1e4e29f..c7b123c 100644 +--- a/modules.d/98dracut-systemd/dracut-pre-mount.service ++++ b/modules.d/98dracut-systemd/dracut-pre-mount.service +@@ -17,6 +17,8 @@ After=cryptsetup.target + ConditionPathExists=/usr/lib/initrd-release + ConditionDirectoryNotEmpty=|/lib/dracut/hooks/pre-mount + ConditionKernelCommandLine=|rd.break=pre-mount ++Conflicts=shutdown.target emergency.target ++Before=shutdown.target emergency.target + + [Service] + Environment=DRACUT_SYSTEMD=1 +diff --git a/modules.d/98dracut-systemd/dracut-pre-pivot.service b/modules.d/98dracut-systemd/dracut-pre-pivot.service +index f5a85ce..20a872a 100644 +--- a/modules.d/98dracut-systemd/dracut-pre-pivot.service ++++ b/modules.d/98dracut-systemd/dracut-pre-pivot.service +@@ -10,6 +10,7 @@ + [Unit] + Description=dracut pre-pivot and cleanup hook + Documentation=man:dracut-pre-pivot.service(8) ++DefaultDependencies=no + After=initrd.target initrd-parse-etc.service sysroot.mount + After=dracut-initqueue.service dracut-pre-mount.service dracut-mount.service + Before=initrd-cleanup.service +@@ -23,6 +24,8 @@ ConditionKernelCommandLine=|rd.break=cleanup + ConditionKernelCommandLine=|rd.break + ConditionPathExists=|/dev/root + ConditionPathExists=|/dev/nfs ++Conflicts=shutdown.target emergency.target ++Before=shutdown.target emergency.target + + [Service] + Environment=DRACUT_SYSTEMD=1 +diff --git a/modules.d/98dracut-systemd/dracut-pre-trigger.service b/modules.d/98dracut-systemd/dracut-pre-trigger.service +index 826b89b..2df9d7b 100644 +--- a/modules.d/98dracut-systemd/dracut-pre-trigger.service ++++ b/modules.d/98dracut-systemd/dracut-pre-trigger.service +@@ -17,6 +17,8 @@ Wants=dracut-pre-udev.service systemd-udevd.service + ConditionPathExists=/usr/lib/initrd-release + ConditionDirectoryNotEmpty=|/lib/dracut/hooks/pre-trigger + ConditionKernelCommandLine=|rd.break=pre-trigger ++Conflicts=shutdown.target emergency.target ++Before=shutdown.target emergency.target + + [Service] + Environment=DRACUT_SYSTEMD=1 +diff --git a/modules.d/98dracut-systemd/dracut-pre-udev.service b/modules.d/98dracut-systemd/dracut-pre-udev.service +index 73740be..7fdeb6e 100644 +--- a/modules.d/98dracut-systemd/dracut-pre-udev.service ++++ b/modules.d/98dracut-systemd/dracut-pre-udev.service +@@ -20,6 +20,8 @@ ConditionKernelCommandLine=|rd.break=pre-udev + ConditionKernelCommandLine=|rd.driver.blacklist + ConditionKernelCommandLine=|rd.driver.pre + ConditionKernelCommandLine=|rd.driver.post ++Conflicts=shutdown.target emergency.target ++Before=shutdown.target emergency.target + + [Service] + Environment=DRACUT_SYSTEMD=1 +diff --git a/modules.d/98dracut-systemd/emergency.service b/modules.d/98dracut-systemd/emergency.service +index 35d9c31..969a300 100644 +--- a/modules.d/98dracut-systemd/emergency.service ++++ b/modules.d/98dracut-systemd/emergency.service +@@ -12,6 +12,8 @@ Description=Emergency Shell + DefaultDependencies=no + After=systemd-vconsole-setup.service + Wants=systemd-vconsole-setup.service ++Conflicts=shutdown.target ++Before=shutdown.target + + [Service] + Environment=HOME=/ diff --git a/0090-network-dhclient.conf-add-missing-commata.patch b/0090-network-dhclient.conf-add-missing-commata.patch new file mode 100644 index 0000000..cabf49f --- /dev/null +++ b/0090-network-dhclient.conf-add-missing-commata.patch @@ -0,0 +1,20 @@ +From 7e51abc81f53c08e464decd4103e8c4ec25fef87 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Thu, 23 Jun 2016 14:24:40 +0200 +Subject: [PATCH] network/dhclient.conf: add missing commata + +options need to be seperated by , +--- + modules.d/40network/dhclient.conf | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/40network/dhclient.conf b/modules.d/40network/dhclient.conf +index 7b06763..a1739ce 100644 +--- a/modules.d/40network/dhclient.conf ++++ b/modules.d/40network/dhclient.conf +@@ -3,4 +3,4 @@ option classless-routes code 121 = array of unsigned integer 8; + + request subnet-mask, broadcast-address, time-offset, routers, + domain-name, domain-name-servers, domain-search, host-name, +- root-path, interface-mtu classless-routes; ++ root-path, interface-mtu, classless-routes; diff --git a/0091-TEST-20-NFS-skip-root-dev-nfs-tests-with-systemd-v23.patch b/0091-TEST-20-NFS-skip-root-dev-nfs-tests-with-systemd-v23.patch new file mode 100644 index 0000000..03f6851 --- /dev/null +++ b/0091-TEST-20-NFS-skip-root-dev-nfs-tests-with-systemd-v23.patch @@ -0,0 +1,36 @@ +From f6fa9ef1010b39a4cb71edd5f1074b6716a3488c Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Thu, 23 Jun 2016 16:36:43 +0200 +Subject: [PATCH] TEST-20-NFS: skip root=/dev/nfs tests with systemd v230 + +--- + test/TEST-20-NFS/test.sh | 14 ++++++++------ + 1 file changed, 8 insertions(+), 6 deletions(-) + +diff --git a/test/TEST-20-NFS/test.sh b/test/TEST-20-NFS/test.sh +index 222bd24..981cd82 100755 +--- a/test/TEST-20-NFS/test.sh ++++ b/test/TEST-20-NFS/test.sh +@@ -114,14 +114,16 @@ test_nfsv3() { + client_test "NFSv3 root=dhcp DHCP path only" 52:54:00:12:34:00 \ + "root=dhcp" 192.168.50.1 -wsize=4096 || return 1 + +- client_test "NFSv3 Legacy root=/dev/nfs nfsroot=IP:path" 52:54:00:12:34:01 \ +- "root=/dev/nfs nfsroot=192.168.50.1:/nfs/client" 192.168.50.1 -wsize=4096 || return 1 ++ if [[ "$(systemctl --version)" != *"systemd 230"* ]] 2>/dev/null; then ++ client_test "NFSv3 Legacy root=/dev/nfs nfsroot=IP:path" 52:54:00:12:34:01 \ ++ "root=/dev/nfs nfsroot=192.168.50.1:/nfs/client" 192.168.50.1 -wsize=4096 || return 1 + +- client_test "NFSv3 Legacy root=/dev/nfs DHCP path only" 52:54:00:12:34:00 \ +- "root=/dev/nfs" 192.168.50.1 -wsize=4096 || return 1 ++ client_test "NFSv3 Legacy root=/dev/nfs DHCP path only" 52:54:00:12:34:00 \ ++ "root=/dev/nfs" 192.168.50.1 -wsize=4096 || return 1 + +- client_test "NFSv3 Legacy root=/dev/nfs DHCP IP:path" 52:54:00:12:34:01 \ +- "root=/dev/nfs" 192.168.50.2 -wsize=4096 || return 1 ++ client_test "NFSv3 Legacy root=/dev/nfs DHCP IP:path" 52:54:00:12:34:01 \ ++ "root=/dev/nfs" 192.168.50.2 -wsize=4096 || return 1 ++ fi + + client_test "NFSv3 root=dhcp DHCP IP:path" 52:54:00:12:34:01 \ + "root=dhcp" 192.168.50.2 -wsize=4096 || return 1 diff --git a/0092-fcoe-cleanup-fcoe.sh-don-t-copy-shm-files-to-state.patch b/0092-fcoe-cleanup-fcoe.sh-don-t-copy-shm-files-to-state.patch new file mode 100644 index 0000000..2bdce94 --- /dev/null +++ b/0092-fcoe-cleanup-fcoe.sh-don-t-copy-shm-files-to-state.patch @@ -0,0 +1,31 @@ +From f8242a6a60c0cf5fb0cd51261f9b6c8570dc3031 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Mon, 27 Jun 2016 12:03:55 +0200 +Subject: [PATCH] fcoe/cleanup-fcoe.sh: don't copy shm files to state + +with systemd version 230, this is not necessary anymore +systemd commit cacf980ed44a28e276a6cc7f8fc41f991e2ab354 +because /dev/shm is selinux relabled. +--- + modules.d/95fcoe/cleanup-fcoe.sh | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git a/modules.d/95fcoe/cleanup-fcoe.sh b/modules.d/95fcoe/cleanup-fcoe.sh +index 5ff4d05..1872156 100644 +--- a/modules.d/95fcoe/cleanup-fcoe.sh ++++ b/modules.d/95fcoe/cleanup-fcoe.sh +@@ -4,7 +4,11 @@ + + if [ -e /var/run/lldpad.pid ]; then + lldpad -k +- mkdir -m 0755 -p /run/initramfs/state/dev/shm +- cp /dev/shm/lldpad.state /run/initramfs/state/dev/shm/ > /dev/null 2>&1 +- echo "files /dev/shm/lldpad.state" >> /run/initramfs/rwtab ++ # with systemd version 230, this is not necessary anymore ++ # systemd commit cacf980ed44a28e276a6cc7f8fc41f991e2ab354 ++ if [ -z "$DRACUT_SYSTEMD" ]; then ++ mkdir -m 0755 -p /run/initramfs/state/dev/shm ++ cp /dev/shm/lldpad.state /run/initramfs/state/dev/shm/ > /dev/null 2>&1 ++ echo "files /dev/shm/lldpad.state" >> /run/initramfs/rwtab ++ fi + fi diff --git a/0093-test-correct-cmdline-reading-functions.patch b/0093-test-correct-cmdline-reading-functions.patch new file mode 100644 index 0000000..fb12865 --- /dev/null +++ b/0093-test-correct-cmdline-reading-functions.patch @@ -0,0 +1,213 @@ +From b039b20ec257901b89ecb32fa8d4ded676c0096c Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Mon, 27 Jun 2016 12:05:37 +0200 +Subject: [PATCH] test: correct cmdline reading functions + +--- + test/TEST-01-BASIC/test-init.sh | 2 +- + test/TEST-02-SYSTEMD/test-init.sh | 4 ++-- + test/TEST-02-SYSTEMD/test.sh | 2 +- + test/TEST-03-USR-MOUNT/test-init.sh | 2 +- + test/TEST-04-FULL-SYSTEMD/test-init.sh | 2 +- + test/TEST-10-RAID/test-init.sh | 2 +- + test/TEST-11-LVM/test-init.sh | 2 +- + test/TEST-12-RAID-DEG/test-init.sh | 2 +- + test/TEST-14-IMSM/test-init.sh | 2 +- + test/TEST-16-DMSQUASH/test-init.sh | 2 +- + test/TEST-17-LVM-THIN/test-init.sh | 2 +- + test/TEST-20-NFS/client-init.sh | 2 +- + test/TEST-30-ISCSI/client-init.sh | 2 +- + test/TEST-50-MULTINIC/client-init.sh | 2 +- + 14 files changed, 15 insertions(+), 15 deletions(-) + +diff --git a/test/TEST-01-BASIC/test-init.sh b/test/TEST-01-BASIC/test-init.sh +index a8b6e39..78f124a 100755 +--- a/test/TEST-01-BASIC/test-init.sh ++++ b/test/TEST-01-BASIC/test-init.sh +@@ -2,7 +2,7 @@ + >/dev/watchdog + getcmdline() { + while read -r _line || [ -n "$_line" ]; do +- printf "%s" "$line" ++ printf "%s" "$_line" + done /dev/console 2>&1 + echo "dracut-root-block-success" >/dev/sda1 +diff --git a/test/TEST-02-SYSTEMD/test.sh b/test/TEST-02-SYSTEMD/test.sh +index 6189561..9736278 100755 +--- a/test/TEST-02-SYSTEMD/test.sh ++++ b/test/TEST-02-SYSTEMD/test.sh +@@ -4,7 +4,7 @@ TEST_DESCRIPTION="root filesystem on a ext3 filesystem" + KVERSION="${KVERSION-$(uname -r)}" + + # Uncomment this to debug failures +-#DEBUGFAIL="rd.shell" ++#DEBUGFAIL="rd.shell=1 rd.break" + test_run() { + $testdir/run-qemu \ + -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext3 \ +diff --git a/test/TEST-03-USR-MOUNT/test-init.sh b/test/TEST-03-USR-MOUNT/test-init.sh +index 68eaff0..dc03359 100755 +--- a/test/TEST-03-USR-MOUNT/test-init.sh ++++ b/test/TEST-03-USR-MOUNT/test-init.sh +@@ -2,7 +2,7 @@ + >/dev/watchdog + getcmdline() { + while read -r _line || [ -n "$_line" ]; do +- printf "%s" "$line" ++ printf "%s" "$_line" + done /dev/watchdog + getcmdline() { + while read -r _line || [ -n "$_line" ]; do +- printf "%s" "$line" ++ printf "%s" "$_line" + done +Date: Thu, 12 May 2016 20:03:28 +0200 +Subject: [PATCH] 40network: Update iBFT scanning code to handle IPv6 + +IPv6 addresses should be specified in brackets so that the +ip= scanning code doesn't get confused. + +References: bnc#887542 + +Signed-off-by: Hannes Reinecke +Signed-off-by: Thomas Renninger +--- + modules.d/40network/net-lib.sh | 48 +++++++++++++++++++++++++++++++++++++----- + 1 file changed, 43 insertions(+), 5 deletions(-) + +diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh +index 005ad1b..9c1448d 100755 +--- a/modules.d/40network/net-lib.sh ++++ b/modules.d/40network/net-lib.sh +@@ -241,23 +241,54 @@ ibft_to_cmdline() { + + [ -e /tmp/net.${dev}.has_ibft_config ] && continue + ++ [ -e ${iface}/flags ] && flags=$(read a < ${iface}/flags; echo $a) ++ # Skip invalid interfaces ++ (( $flags & 1 )) || continue ++ # Skip interfaces not used for booting ++ (( $flags & 2 )) || continue + [ -e ${iface}/dhcp ] && dhcp=$(read a < ${iface}/dhcp; echo $a) +- +- if [ -n "$dhcp" ]; then +- echo "ip=$dev:dhcp" ++ [ -e ${iface}/origin ] && origin=$(read a < ${iface}/origin; echo $a) ++ [ -e ${iface}/ip-addr ] && ip=$(read a < ${iface}/ip-addr; echo $a) ++ ++ if [ -n "$ip" ] ; then ++ case "$ip" in ++ *.*.*.*) ++ family=ipv4 ++ ;; ++ *:*) ++ family=ipv6 ++ ;; ++ esac ++ fi ++ if [ -n "$dhcp" ] || [ "$origin" -eq 3 ]; then ++ if [ "$family" = "ipv6" ] ; then ++ echo "ip=$dev:dhcp6" ++ else ++ echo "ip=$dev:dhcp" ++ fi + elif [ -e ${iface}/ip-addr ]; then +- [ -e ${iface}/ip-addr ] && ip=$(read a < ${iface}/ip-addr; echo $a) + # skip not assigned ip adresses + [ "$ip" = "0.0.0.0" ] && continue + [ -e ${iface}/gateway ] && gw=$(read a < ${iface}/gateway; echo $a) + [ "$gateway" = "0.0.0.0" ] && unset $gateway + [ -e ${iface}/subnet-mask ] && mask=$(read a < ${iface}/subnet-mask; echo $a) ++ [ -e ${iface}/prefix-len ] && prefix=$(read a < ${iface}/prefix-len; echo $a) + [ -e ${iface}/primary-dns ] && dns1=$(read a < ${iface}/primary-dns; echo $a) + [ "$dns1" = "0.0.0.0" ] && unset $dns1 + [ -e ${iface}/secondary-dns ] && dns2=$(read a < ${iface}/secondary-dns; echo $a) + [ "$dns2" = "0.0.0.0" ] && unset $dns2 + [ -e ${iface}/hostname ] && hostname=$(read a < ${iface}/hostname; echo $a) +- if [ -n "$ip" ] && [ -n "$mask" ]; then ++ if [ "$family" = "ipv6" ] ; then ++ if [ -n "$ip" ] ; then ++ [ -n "$prefix" ] || prefix=64 ++ ip="[${ip}/${prefix}]" ++ mask= ++ fi ++ if [ -n "$gw" ] ; then ++ gw="[${gw}]" ++ fi ++ fi ++ if [ -n "$ip" ] && [ -n "$mask" -o -n "$prefix" ]; then + echo "ip=$ip::$gw:$mask:$hostname:$dev:none${dns1:+:$dns1}${dns2:+:$dns2}" + else + warn "${iface} does not contain a valid iBFT configuration" +@@ -439,6 +470,13 @@ ip_to_var() { + esac + ;; + esac ++ # Extract prefix length from CIDR notation ++ case $ip in ++ */*) ++ mask=${ip##*/} ++ ip=${ip%/*} ++ ;; ++ esac + + # ip= means anaconda-style static config argument cluster: + # ip= gateway= netmask= hostname= mtu= diff --git a/0095-dracut.sh-make-tmp-dirs-after-the-trap-function-is-i.patch b/0095-dracut.sh-make-tmp-dirs-after-the-trap-function-is-i.patch new file mode 100644 index 0000000..f660473 --- /dev/null +++ b/0095-dracut.sh-make-tmp-dirs-after-the-trap-function-is-i.patch @@ -0,0 +1,43 @@ +From 3889234f7116d7f0b39a609d5d65c490251f7d5e Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Wed, 29 Jun 2016 17:32:31 +0200 +Subject: [PATCH] dracut.sh: make tmp dirs after the trap function is installed + +otherwise a good timed ctrl-c will leave the tmp dir around +--- + dracut.sh | 14 ++++++++------ + 1 file changed, 8 insertions(+), 6 deletions(-) + +diff --git a/dracut.sh b/dracut.sh +index a50eaff..36607cf 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -823,13 +823,7 @@ readonly DRACUT_TMPDIR="$(mktemp -p "$TMPDIR/" -d -t dracut.XXXXXX)" + printf "%s\n" "dracut: mktemp -p '$TMPDIR/' -d -t dracut.XXXXXX failed." >&2 + exit 1 + } +-readonly initdir="${DRACUT_TMPDIR}/initramfs" +-mkdir "$initdir" + +-if [[ $early_microcode = yes ]] || ( [[ $acpi_override = yes ]] && [[ -d $acpi_table_dir ]] ); then +- readonly early_cpio_dir="${DRACUT_TMPDIR}/earlycpio" +- mkdir "$early_cpio_dir" +-fi + # clean up after ourselves no matter how we die. + trap ' + ret=$?; +@@ -840,6 +834,14 @@ trap ' + # clean up after ourselves no matter how we die. + trap 'exit 1;' SIGINT + ++readonly initdir="${DRACUT_TMPDIR}/initramfs" ++mkdir "$initdir" ++ ++if [[ $early_microcode = yes ]] || ( [[ $acpi_override = yes ]] && [[ -d $acpi_table_dir ]] ); then ++ readonly early_cpio_dir="${DRACUT_TMPDIR}/earlycpio" ++ mkdir "$early_cpio_dir" ++fi ++ + export DRACUT_RESOLVE_LAZY="1" + + if [[ $print_cmdline ]]; then diff --git a/0096-add-support-to-F2FS-filesystem-fsck.patch b/0096-add-support-to-F2FS-filesystem-fsck.patch new file mode 100644 index 0000000..2bf7be3 --- /dev/null +++ b/0096-add-support-to-F2FS-filesystem-fsck.patch @@ -0,0 +1,91 @@ +From 9f521f76a007437083559dc2997570c88386d56c Mon Sep 17 00:00:00 2001 +From: tpg +Date: Thu, 30 Jun 2016 21:26:42 +0200 +Subject: [PATCH] add support to F2FS filesystem (fsck) + +--- + NEWS | 3 +++ + modules.d/03rescue/module-setup.sh | 2 +- + modules.d/95debug/module-setup.sh | 2 +- + modules.d/99fs-lib/fs-lib.sh | 5 +++++ + modules.d/99fs-lib/module-setup.sh | 5 ++++- + 5 files changed, 14 insertions(+), 3 deletions(-) + +diff --git a/NEWS b/NEWS +index 6d1cd0a..1ec8881 100644 +--- a/NEWS ++++ b/NEWS +@@ -56,6 +56,9 @@ systemd: + - add /etc/machine-info + - fixed systemd-escape call for names beginning with "-" + ++filesystems: ++- add support to F2FS filesystem (fsck) ++ + network: + - fix carrier detection + - correctly set mac address for ip=...:: +diff --git a/modules.d/03rescue/module-setup.sh b/modules.d/03rescue/module-setup.sh +index f9dfcda..9267914 100755 +--- a/modules.d/03rescue/module-setup.sh ++++ b/modules.d/03rescue/module-setup.sh +@@ -15,6 +15,6 @@ depends() { + install() { + inst_multiple -o ps grep more cat rm strace free showmount \ + ping netstat rpcinfo vi scp ping6 ssh \ +- fsck fsck.ext2 fsck.ext4 fsck.ext3 fsck.ext4dev fsck.vfat e2fsck ++ fsck fsck.ext2 fsck.ext4 fsck.ext3 fsck.ext4dev fsck.f2fs fsck.vfat e2fsck + } + +diff --git a/modules.d/95debug/module-setup.sh b/modules.d/95debug/module-setup.sh +index 97b2a30..39debd8 100755 +--- a/modules.d/95debug/module-setup.sh ++++ b/modules.d/95debug/module-setup.sh +@@ -16,7 +16,7 @@ install() { + inst_multiple -o cat ls ps grep more cat rm strace free showmount \ + ping netstat rpcinfo vi scp ping6 ssh find vi \ + tcpdump cp less hostname mkdir \ +- fsck fsck.ext2 fsck.ext4 fsck.ext3 fsck.ext4dev fsck.vfat e2fsck ++ fsck fsck.ext2 fsck.ext4 fsck.ext3 fsck.ext4dev fsck.f2fs fsck.vfat e2fsck + + grep '^tcpdump:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd" + } +diff --git a/modules.d/99fs-lib/fs-lib.sh b/modules.d/99fs-lib/fs-lib.sh +index 672d027..5c83155 100755 +--- a/modules.d/99fs-lib/fs-lib.sh ++++ b/modules.d/99fs-lib/fs-lib.sh +@@ -47,6 +47,11 @@ fsck_able() { + _drv="_drv=e2fsck fsck_drv_com" && + return 0 + ;; ++ f2fs) ++ type fsck.f2fs >/dev/null 2>&1 && ++ _drv="_drv=fsck.f2fs fsck_drv_com" && ++ return 0 ++ ;; + jfs) + type jfs_fsck >/dev/null 2>&1 && + _drv="_drv=jfs_fsck fsck_drv_com" && +diff --git a/modules.d/99fs-lib/module-setup.sh b/modules.d/99fs-lib/module-setup.sh +index f4dbc94..a29a350 100755 +--- a/modules.d/99fs-lib/module-setup.sh ++++ b/modules.d/99fs-lib/module-setup.sh +@@ -20,6 +20,9 @@ echo_fs_helper() { + ext?) + echo -n " e2fsck " + ;; ++ f2fs) ++ echo -n " fsck.f2fs " ++ ;; + jfs) + echo -n " jfs_fsck " + ;; +@@ -68,7 +71,7 @@ install() { + _helpers="\ + umount mount /sbin/fsck* + xfs_db xfs_check xfs_repair xfs_metadump +- e2fsck jfs_fsck reiserfsck btrfsck ++ e2fsck fsck.f2fs jfs_fsck reiserfsck btrfsck + " + if [[ $hostonly ]]; then + _helpers="umount mount " diff --git a/0097-systemd-install-missing-drop-in-configs.patch b/0097-systemd-install-missing-drop-in-configs.patch new file mode 100644 index 0000000..e3412e7 --- /dev/null +++ b/0097-systemd-install-missing-drop-in-configs.patch @@ -0,0 +1,25 @@ +From 5d013e5e3c69b0d36b4f5f37e921f83d6dd0c166 Mon Sep 17 00:00:00 2001 +From: Florian Albrechtskirchinger +Date: Wed, 6 Jul 2016 06:36:50 +0200 +Subject: [PATCH] systemd: install missing drop-in configs + +In host-only mode, install missing drop-in configuration files for +/etc/systemd/{journal.conf,system.conf}. +--- + modules.d/00systemd/module-setup.sh | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/modules.d/00systemd/module-setup.sh b/modules.d/00systemd/module-setup.sh +index e4260c7..51904c5 100755 +--- a/modules.d/00systemd/module-setup.sh ++++ b/modules.d/00systemd/module-setup.sh +@@ -162,7 +162,9 @@ install() { + if [[ $hostonly ]]; then + inst_multiple -H -o \ + /etc/systemd/journald.conf \ ++ /etc/systemd/journald.conf.d/*.conf \ + /etc/systemd/system.conf \ ++ /etc/systemd/system.conf.d/*.conf \ + /etc/hostname \ + /etc/machine-id \ + /etc/machine-info \ diff --git a/0098-fs-lib-add-crc32c-kernel-module-for-f2fs.patch b/0098-fs-lib-add-crc32c-kernel-module-for-f2fs.patch new file mode 100644 index 0000000..5c70ab1 --- /dev/null +++ b/0098-fs-lib-add-crc32c-kernel-module-for-f2fs.patch @@ -0,0 +1,35 @@ +From f8ff380bd5aadc00061c6537c54ca14728ded6cd Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Thu, 7 Jul 2016 09:43:48 +0200 +Subject: [PATCH] fs-lib: add crc32c kernel module for f2fs + +--- + modules.d/99fs-lib/module-setup.sh | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/modules.d/99fs-lib/module-setup.sh b/modules.d/99fs-lib/module-setup.sh +index a29a350..2c5f4c0 100755 +--- a/modules.d/99fs-lib/module-setup.sh ++++ b/modules.d/99fs-lib/module-setup.sh +@@ -20,9 +20,9 @@ echo_fs_helper() { + ext?) + echo -n " e2fsck " + ;; +- f2fs) +- echo -n " fsck.f2fs " +- ;; ++ f2fs) ++ echo -n " fsck.f2fs " ++ ;; + jfs) + echo -n " jfs_fsck " + ;; +@@ -41,7 +41,7 @@ echo_fs_helper() { + include_fs_helper_modules() { + local dev=$1 fs=$2 + case "$fs" in +- xfs|btrfs) ++ xfs|btrfs|f2fs) + instmods crc32c + ;; + esac diff --git a/0099-dracut.png-Optimize-with-zopflipng-m.patch b/0099-dracut.png-Optimize-with-zopflipng-m.patch new file mode 100644 index 0000000..ed06e75 --- /dev/null +++ b/0099-dracut.png-Optimize-with-zopflipng-m.patch @@ -0,0 +1,282 @@ +From 828257dd824771cff41374679abb01189666ddf3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ville=20Skytt=C3=A4?= +Date: Thu, 7 Jul 2016 13:53:39 +0300 +Subject: [PATCH] dracut.png: Optimize with zopflipng -m + +--- + dracut.png | Bin 7417 -> 6360 bytes + 1 file changed, 0 insertions(+), 0 deletions(-) + +diff --git a/dracut.png b/dracut.png +index b703f785833bb02c3d1420db70cdca906341226d..0d9265e31868dcee47a3af5a031081ea136d4b85 100644 +GIT binary patch +literal 6360 +zcmV;}7$@h6P)=}t>@ag0Zm3PWP+I2w86Gn;Gr#5CZXYu9DZP#*h8jkA?F2{9U5;_bH`1 +z0knuUi#3RCh%JdNip|UG&xJyvzy6x9`I;?kqp@uQ)sZ7dJ|gGxSpw93fj}TWJUop0 +z`g&AUR3H|ML7szvjZ7wkt*tH0&CTJ;l`ANfN(BHf$mf2yva<45zw}GLwD?I6>fytO +z?+`$q62{$l^UXJ-x3?FywY4w|1CHa+1UR^^3)3`VSr$z`1KYN-y1I(9XV2oynKLLB +zix=d2zWZCgfs}geJwoWkYT6^52*WBe%gSiqJ}a9x8Hs{#>dAARxXz# +z8^s9dzcs?)Fd6K#nCyM)t+y~aIVqnjIWW8o;5qvGl%W<}$9-FQ>bYk`x_ +zk34#(sjO%E`v<)0$|@rq3F9A+bSj0@r>8J9v=bW8U@(Zy%}pee$uf{j8+lC4rI1J! +zur8J_I;e>SQCks2OKljVos|e!2K0zVqhz=Ko{fzS{N3OE9pzzQuov|W4ajA)*hnUv +z3l}b$06y>AzU4cA^|}J}p@$waqVdq=K>xtd?%flnmOT9v3j8_D%*^4~vE#V&&O5Pd +z*Dhq`g4fp8=;9mc0{;5lCA=}6!2EiSpv5CW#G?V2hJl=2L^@kUCSOD_U|^!B8n=x$ +z;HH6E=n;>{sl)oaUViyy`JH33aDx~f9i|tYm^^_qQ)icRX}k6NzVG|o>n8e#W7his +zNSql_c{>MNf=eJ6lsSj_xkXG*U%;n)%BP^CqXUUVg3QX~OZekA7VsBuFN!Oh=x(XP +z?xAKh)yAlu@bq7K@daE5SC=+1vy{Tqe>jaDO>uno9i15O27_5kOA9?fv-gD;UZD2w +z*}I#bar(^Zrcg9=H-NvrZa@{?dVgzMs}qhytku;e0Zk(H`~t>ChA}mD9-sQDpNh7& +zHY_eKYL?Q)5C6e5N-i)l*o6L$YShHFi^tJW9YG`%K+rPbxGou*7F*rOA{sK#*ItEW +z+Q#v7t9bag&fxa327LJgy_lb$M^jT1Jwbco^UptzSUf8K??z{5cX4L!>IbhYP+_PK +zb+&g}PN_sUjK;#~Xm7>KFTIL8?zn>tU0PZqpwFII!O#B9C3H4b;=ryJM1q#MbR+*) +z@ZbV)91oNa1yn?W0;Yx9co@B{)glpTTo%Ue>8*s5S;nhpR$n<-Ez5WvOrm(bVOhlz;^ +z(A_f`0{YW`c@ew%8gSc08`^}K_wDV*4sm_UR7|N%B_^{{9t;I2c~DBs01P>9tBaw# +zCV<7+%P@*5)LUzqT}k14fBiJF`I25dp2PnA`(-gZWno{T=6asn{^XNS_FWgCnx1-4 +z67WL2qLMlW50Xc&Bb7>1<3#Vs8tw8w``4GScV{!k`x`Lc(||*x?TCdKkjf^11k)g} +zV$>J?oINkhS1(r3rjhuF;=m@mBSDJ>3J08J

3}E~A?Gx6!43zpD +z4a2$rIslabe6VLnPeALKElkzp;)To5NxkHijPmJRi5lA3T#2#XdUQ2bqDPLEB48Y3 +zBab=wH1kbG&E_JluCC~0pYPSSe^)=MDxxrzi)tf*V;48@N3YM9^Iom7gM))OIe8L0 +zcJx>NB1>f~E-Z-*6sc>eR7#Eu66NRNc)-EktrCPR?Ch)~ +zY=RkFd2n5ijFOqpL7}Xv!aRbx>F2ZJ#_(LXjJ$k~tR5Nc!k(cf{K0GU*vb~QcQA*Q +zz{S)mo5>sSaJ%j^Y->s9v=wH0Egz>&c1WgNL +z-SsdH_+YwX5Wrpj?}&NY2(F8CI!#v=3GvI<5+oS%*cH=7lo<$#SKNfI?k)`PsAn!K +z!0N^1qKey7+ZQAo5q1YN_U0|y8dL@KV0TxyYYG!=n-?w>(k8mPy7Wac6Zmt~kswo35he?LmJ&Px*9S^w0kl{uVnx`QSYH>W>hCFPD+5~+bKDYwk(dB_1L74i +zeJ-#}Ll&KLAJ|Mmt|86WKK-eJiF6P%^R73yepbu}+S +zk2j_g=$2H-G!&X^q5=kiqsgDl;0(irG7O{zh`G6Wq*ECbL_dqZmHb&2O29L9nuKr# +zvj&(-mGyZ?TQy6DW0#Wp9JmlQH8rTJszNvvv2^;kZ9#qNsi$@ckoB_qzUwPVoswj! +z-%VoKxtz?StGSXalAP0LsRq<7&$2kw&e_>Hx@q1nkm;h$oQnklD(+rHtpL>5*MmqT +zf^^md{c&U_jv>>8x4X +zim7%faIaqdy4pG{uP)OK#kF|y0xD-cGPWZOwWzm+q61CFf?LGW%p$h7l29InfGh>m +zD6*4mmAV(bJ9@;u4S9)RLcReR0X&tp38aDyR~`)y9GpD%6Tsi+?twO*mmbkbOrKvY +z9JclWcxAhQ%2Y~PYOX0)oJpq`Xbh8=Sl$BBqf%HpzmWx$qB|#qol6UIjO6eE)w7?_ +z6VOmFh~bf8S+H8roB1B1CE8lT+GZA(VW8wc2fnU2!_^oo*s_3nR73)tnXdT-gEY@2 +zn0DG%uFTxOoj_G$ACRD76^aE$Y5_u+5N1FSIVkTZRmX$K&K2_xT9KLGXT#a +zGZhG?n08TzJ<*-gU=GOV0j6B#k&)j?Z25pH7nT6&_@~2SLCH*+@vxcB$*fQnC8(4m +zIj{1T%s~HONHUEN0{HH2p{Y+l{rH5qPi;$63o9PxjRA{V77mA~kHS=f+E5w7R;GX# +zrBgIJJByjc)pDvN3ql=bzd$LLwIjk%vRsv$D3p>^Hjh*~?{~03Ej9Ep|5wy&Ww1%W +zeXFI_4b;Q}3|#)XltHyDQ`&>=`g=!@9C@g5TY&0{>kFd_p>RYlU=uQ!PALs4pWEUw +z>+YT^M(<3)po`BeXi!Vq%BfOqT|M?6+>eHahB7lbxjDgtiFM|(>su}+dTac1V=BjzRlp~>6%|#Qu_XtAd$$FshQfzOhDU?iZMRZeunaPR +zx>{XR#qDEZFWszG+`qdy1~*ViSxlxfc;U?xIDYm5me)4W+dqU6VW^=j6iTkJw}f=A +zfX!4^fXN^)z?-^avJ9EEDW9PPlBH`dm&N8*in($$9EBB%Vkwcujr}#{?QMNN3kwS@ +zXV=!(pod6+p`>kj%|ZR4A9|=(BJo6Lhfbw()KOd9ctetR$92#yZnd(qLN*Af1pCm= +zdL*-e3xfeCZx<1*sKJc~??AAkRshIgF_FefGL7}ktbl5x=(u!U1MpKNh{7Z7R2LPyR3aVYQ +z?h~-Qsw%1NZE>S`9F2{Q1aE0^31)z-rGAR5u~B^g-e!b?7QAp1U2)&On{e>Z0kTg9 +zK?#SW@?BM^uCAq3Rq447HMR9pq18)aQG;kSu0i7a71+B)$+5Mph%w1WTJ-za`Bi*m +ze>;l}*~TWIGcz-~4?xW?$@>z?bqR{Cx}vK-eE6}w*EISoWj;7MI;J#WnRG@@u!xB0 +zXrR6hSeL)GRn*C`zBOlHU_h6K>=b>$}#Zf*(F4SCLXw +z+S}VvS64^Z`;Jc;!ngj?B>wW1Y23ND6-_|U#q92~CaZ&H$$mT>gwQS=Y?$~k1Pww6U@Wd#}<>xBSGw70fv`RKi7 +z?k~(Mw01Omvem1GcaAWsCX*Xy5W@{``5i=$f0GwcBwU`QhI_ +zD@<{5_l<32tOE~B=AnK^qwK#v_oCMWE{F;IK+^g?&3=ejxU?4y+`}+o@qu#}6 +zEaP7U(V|_%JMX*$p*CA~0xV0#M?ZT6PyYTi{^+GE_>{Xw&{S7JH>Vsh!b4lx_4z<> +zeYR?bx?nHi`J-3ycW*A@-aSqDg1fuPLTN`b0})Wg-Pft=5egW?ueHU*ZoeT~gI#e4wyxgZp{km?S1r?INf-@>d0UO44FCO{$_L7?wDydTqrbmj +zSaK6D11{onwvo)LS~xP!-nI7+u~kJop;|5%7N4%DQi_b~TUj|l; +zw*cKC7r$?)4o4+wzd4=Y7RYQq0zH@wSPJ%%SLSSAOAH@BSd0DgndX{^&MYV|GRR0_ +zA9qhRpeIh8V1N`U(08ctH}AjyezG>7wP6KK_(KC6(;)hw76~e2r_#^ao{axCs6L=! +zAI#7{2G%K+BK~`5_!qzPuhu5qB6<1s*Ku>PNPRnS-~gku7H13jL$=RCyX!I_H=j7@^^ZcGEjM*$uRr* +z{PWMdt?F%UZ3O$g7jd7@`w$8}>ZIVFHvg^W3y0F-71z7P!6Y$%ch +zS2J5u0pnf$z%}b@>x5R{X&%~J^6}n5$>p7Pzo&uE)y@&@>6c%A$%a<66;J>(F_2dD +zHpl=3yqg$$V&V7Sf8S{xm$P5f#9_agC;;+aKF>53u-|<14SB!YXNAW1eE8uMP4YUQ +ze){QKEOl?aMOCTbu(7d0j!JK0*_#ZZ_oRN>j9G2tCQUk4udU>BkaFm#Q6@rl!F*Ly +z5W*w|3Sh3=&(Yv0yr8LELS}gyOq#zUu$kCSz>o^N+Nr{$LP^d|H33aF%b&~Sz$DV( +zGdSjZc|C$D;5BY?zWCw`CZjAzcHY}>zx^m0nIPQ~Oh7Rd>JSfR(&L8VBS%i1IC*Mk +z{g5H6XA}kH>uQ%1yBJhR8`Lc41e4yuW^jOV(@)GhRSsmjWReOqXe^-+pb@;dmL`J- +zC_vCwf&A5Z`nigiGgbKfaRp+C-VazdrV(ZV)-;ya8CaYc8p|r6;35;!BXe^3E3dqA +z4G?{x^!nX}aHs~)>wS%tRNS%Js*TNON((2~^s%AI6Xm6c4ru^@`XK;zP?re+5V*!Q +zS9Ubbp0hW0tdfAn#QE9e<>7d-q%R$y_hv;Q2P;92C?Hlf@N@knxNf>Cn}Sh+0oHq;Tv$N +zM*tS>$H@VgnAgR#I5?RA_SL?t+QnW9&%QTPK&BM})xgF&>h}BZzyG6Ps0kWt@hZImMQq@?6qupHlFW5> +zc8-v98KV$ugo-0WmCp}RtIw+`&dfzr`qkugN`hJth;C`!lFvW?eBp~PzPMO6vFJm! +z +zIkF>;I0Cb=+rtk(d~=Uluj{FLZ-jBiB$zGrAlc_605lVkaNdKy$tIhOXl`z<(?IIw +zTZU=SBb4a?bbZvv(G+zsWg2UAs1;YR|xbN?FFc1a>U0tFm79-bhwdD-zpptVEa_0u6{r{ +z!S*7wtOqRUShqYD_|fvxQ8j0$mDE_uiv{X;Y0Xg6RGt&qC4#zG-g}`2K2I8p%#~A_ +ztL*4klCLVrh(3O-=N}Q+?RD+ydTIG&X|G%EBooB6@n*XhNg`q^Gb0Iu8UPvrut;fn+kJ8c`A$vMhnm9!Eu2$dUY^q>aB-qrVmgW*U +zlts$h7d-jolM7T-NrdV3fPGIFCAZWtZq(dYnoELDGIlnt22t8V^6=_+N5g_)F9{qMU|cuu%XcY22cmv;Q#s?ggOXy +au>Ap10twlpugmxV0000Ymg8z5Mg0qk!WeE8UuF-aDqV(fGZalJQTR$`Gd7g +zLBJ6Ka!LlC34Jv!{ekbl{&!;IJltdhUeX7sSp=B)xC8_{_&H+*2L}s6y*>P2IQTjX +z`uMpP?#nS?VKD`1sVbX>6zvs3UooMJ7owXo_IJX2YLcGGcS;q}r&4K=a6Zpp0^+{Jl$#HQb@zH9$Rk4cc9)oRc~)h_Nc113cB@Kefq;-0N0l4F*gGmBj> +z_3f|<2PcdCxo)sQX<&au?f(30hM8Z3PWS8t&okP-cS$z +zb+2&=+DUrMs(eeX`eB;6%eW+Lr>+?aFMVySz>`3S=chzAg-;brZ_kiV1(staO)9-x +zqwTloi?xl)OJ1eXIQ{d+;I8rQ(Rl(n*-j73YO@3GqGzruyD~qG3OZ1Cw$iNLNHA|~ +z>$pfUngt!`W#2@;mNe#cbZvL>iMEJQK9`a7G=;mQO9OP+;4AgfYczxT)vH&p$D9nQ +z@V_7blOsb19!9c4Ak$(bdb8wUdrO+*L>(yxUQs|96xXNoUx9`3JoZ +zNj%&A`!|1AvzqFOqfJnsRo%Z4#u|(MJC~q?pL#r0j!EC1%5M6 +z-O(q^#93MiUz{I$)9aRd#FnP3S2&5%gUiT2J7(G4tkM2C4jmcM_!1O2U5n<;CHlG8 +zwq^Ru?j}j-e)OQ}>RsL#LS?1RHIp(uDKj%YqoMzFo)8u2Rf$LOBO{IWm`VPM@BC-D +zkTue??0HjLb8`%)hpJw};64n7TSKfXC^03T7{Z|{hp6BqA{j5U3a%|6WwUi~^dbme +zo%wv$@(}AVq{veu4b!u`+?iRSk=Yt`E7kd<6-k( +z;~y>3cQ*x{bi4XTEdtW)Z0RW-9>4?p>x-DJv4IGXrYcxpoj=0YSaJe;0|VMfTd=K}Q4$1HMJ0Ixo@ +zrAhJf)VfmWLwHzEix)8jLWq&sn*8{=ClHgLpAV`IZy50(-Ml!6j?NIk^mK)nXZGn9 +z5%@4}R@)HiQS+q6@llzoDT7kjm3VO2@W9w=6eocrbov-wyD-Mjb+1u0U1H|H`)^Je +z=k)Rl3g}HC&ge#4AnL6LiMLK|mX#;h{g)Fyjn)$_LV1uxg!ZAYXhHjW3P-MUY{KQG +z8eb0Ihv0(|F+HM0oSGx*yPNIKuDwkbiOisuP%qlxpECyhOj4C*CRB!afGy +zz`tY!pFQ(mFf0DxV`mT@{6H_HGAEQ~oTTsg%`>Tt@!eg1AdQPt#*pDHCB=AwS;WY?tt(^8XB5f37e9OY3PISY)^(U(RQw} +zr4kPC6cGiE7uA7{IhL_@0u~#7j&{!Fr8Lthw9mZRW1Oc>l?rkZz=NMr^7Lpuk9+y0 +zPjIm0`uh6Epc`@T9%us$5fLUn8bzOk>X|C3Ipg5m-QB}H%B99CE`bjsnI*iIRI7{! +zkzRLa0~{p@vfg`~l=EGo&5y`63H#n&^bH?JL?|{_ftDmtFKsrrwk+I7+KjI>`|0Tk +z|H-kc87)XD49}mg-2AQ5`Wl!7E>i+vXFONH4X)nn!lxOecsghD8^v(%XDMFmVDiDv +zh-wElnuxya0t6NAiiKH{(Hj!c&lyVtaXUfO% +zMr*#odUWm&6*$>&!m7ukW2E24j0B-1CnqPiTMvghnikq#Ue9=xV%u0y0;2_2a?K{A$`LynKw7Lc=!d^q$CGt=OAb9fIJSD6##}O$)gU5q;G3D%3iS7;R3W{1C#zR3& +zMK1o<)@U^o2rLOEOsPEg4!PSBQ+OrwdSJR!8)ztU-=7rgztOG|{zO5dCf91UZYNle +zb85YMHBZBP>)BY-DSe9n*)gT8tSm?z>en*pIp$Q$ol?!m!CqFKs~xf3*$L(WQnyMc +zw3@3%Sb%XE+2Td8jC{F^Rl6nQGy?_Psl!28X4Pq!s02|q!eL~Z7Y}PQA}!{9Ts17F +z2Q-l0-d?ISwMrqh{N3Itfm!^ZpCxrIIE2hql%AU=6CYZ~@~PExW;@_R#QDf)Q3u&25$0P_5O`(};-G +zq2q}8fZ$ohDOM@*RgJ6cL}L;?ijaw;7&mp|3-UA=54w2ZTL=rh+JWvt$(D#zvzct* +z(Vv=_ehU&(fo^ZT+sWXwfQ!B#5>ishP_9T*qF;!9+UCCos>S`MQyf +zd?6$0WblmHMNr>FFpqqOAP$7pPfZwd(Pt2BK=wqkK@CD3K|gTvdQLY@dj$+peJy!` +z^R~L@>n{V2O7VjOi6MznUn!75MHZd$*L(*z+1Ok3csVDU1oD{WIWTqDK_FFT4UZGz +z${%bSVkkgLqU9o%@8ik4N({;@99{S_F;Y`_sVB?Wy$9h5Dr^#-Ka^a#RD=r)4{7Ze +z1&MV6#ncA9&<0Un#Vj(e_N*$+Iv2r=G&@Rh7SRiap`cRblu?zn0cmF3t#oJ8~_?UcLxQzBlEP1X1akr^VDH@@ib1l;`*FQzdG +z7)I$RzHW$ulOG>EFZ^^I;f{=Zt3X?`+2Yl?7-z^kTi}dl{_uBa$K9j)p||QvJ5R31 +z0y3>y0vj>TXXW0;pFG^+MU=(u9jNXJ=t2H*f6};|k?v+zn`XY*onV23rm@*fOV;489i93r@JBJ~hjAb45 +z#}W+gtqS)F{-MH?5IEXF3 +zphOvk+t3@ZO_^Fwo;e!&7s>L8jRYD{fsv67_TI{nRfH`?%)N)oz$iE=45p{E$||0y +z@a2?MRJ;k`(vd0V%+Y<6K0=r@XaGyzr{WKE(}>W}8d$>2`i&NR?>S0mDeEz5<0I +zAJI6xbSRnhgwtF%9Ky7!EAk6_UiKPcq{Zz`U7`aLd5b@4$ejZKTWACJPSfDtT@A*{)G}%T$fVd>8@mvW4f-W)mFhXV{;)u8vIWF +z8u6isFeB;~HvITYnB134g)N7N|873rxW+WCkk@8ua%}2!R#ZIE>wP}d&XAu=cyU5@ +zmR0&uQ;KTjVL|0AGr-u2?(U*wWMu(jcQajqx%_I!vUPA?y7_ZCEPhH8PdE|Bs*R_d +z2M1s4sfgR>`o7f!Ud}#Rs&;vUHSK)6*30d*P?p8Tac0KWfS{lUTu>L-6O9aE83k~K +z(F=z%ebIt<9(uVm#wm9{qbg4{8fpI$z~JAv_I}2)gl^BMwfx>p2L`S>(_s%8>gl5L +z!;m;rzKN#<=b(5AvAn}SU<#nS8A2q$LZKcDRFohKuFa#@nGJP@KAxYwg*(9O+y?S$_ +zOHO60aF}8+wYr-5HXHci%~Ww<9xp5^ZWR7O?YP1aTc(3!drr|RecMF7DE82VQ%e3x +z3)98zbyBE(d0~Kz9@m>P3x4AUGoV<3!iU4xy0=Q!2V!wg{>)FISBYbsEsLbjB}VNO +z^&DIfilyIavB`X^-kRHmg>akJitntb~beauK^6O(ZwD(uqVWayD@18nOp-^i4G#=b6WroQS3g3SZC8elW0A?2# +zZ!Ef&k{G+|4F=lsFFUw24$NJ4j?mK3EEyI~^pk_J!Q*gJw~Tewy#6K! +zxEO!EyqcOvx*f6m@vzS3QxIFT*9Q`bym6x@bT>DZ0ICb`8Ahd)UBrC +zAfZoxxF-InY;Pa#%d>MyS~sjmT`Y_$sJpsy7Z(@*ClNH5X>qN2vSNl$BV1Cs5)pc3 +zjxUxJw!8GXC>-_pbVU&WTmziWNi?OLXHUGbM!)#eu^iH8b#mFKUr$4WAhrA*4^diL +z+5%D!AYf#2|FEvl_Fh1tygUR%ztQgE)XCxwGI|5rZG>zImxTk*bxf?uhs?!R-lO;j +zXu&+?mhwG_9S2b_5!+Q12=e>mt@{Ezk +z!4MKr4qJ5mZk?6a^7q^8bN{tr!u_swQlNW#`7N|lXrjRNd!DrIaS^!TEUX7GY +zB4gd0snV&9)5%y*fMYe`5w)+$emf@#EFeLd$9-sTclyxiZv#OIILLFT9v?ajj|-I^ +zjdvn|7Ofn4+VP0nf}g4uNVn5@YtMz|*w|R?09$T`bfh&g$JFyjzj_2w?m1z-8Bq8f +zCNP6laT3$iKRGi)iCp*nJH@81p|SnD`0fW}+@ +ztIbb|#DE&8P+L4X;kZP@rpNt0X`wGtRz*ccwZf>nriKDcp00ivS?brV+if#~^n$@) +z!g_D~wCamA^iTQxdb_az4S2+6QBub7c#gme< +zEb$~zJ3Px0>y3mdXRQQbRWH`WdExi#*w>A-h2ztuPDDW&MKiV;Pqp;W92$Cbd$UmJ-ksqs>;4AfNU22Yz1YoC$jwzoV58-EW?=eomDHNui0U}MjZ~ +zM{VdZl7mSorxJTs^3SO2J-Z2)w$7i?_qRYe9G4~9+S=$~(}Iqj?GgYLTV5VNIS~WY +z<@L4CX|&o^Gp=MTau-V-?Np5<5MSwUX0vd;jpB<<-qow4GuZ<_cMQ^N0JC>|qBX5`x=htYaP*CT{Une3DQJ=yMw_qb%dzD?J_l +z_V$lw7Z(cvRc+gXf8K#kT^oJcRSi|2-MlW@TFiAu>CV2N$DCIAb=&Y$5mk+ijeRP3 +z=9;Q_yKO)_S*qys9GgaIf2ji#42a{=eVE1%?JX@LK&LS=G124&OiCDXpiIF7Oy)@i +z^V3uq*Zr#!iX>b{-Y?D?DBen%>zJ>a$V0TZab0FP+C8`ZG#fDQ@q9zGPQR|_Dfb`r +zT~l_h1X;U5Bp{RALj8j77egbBiOEFEthJL@Vh8FiUy2^jAm&s_ex129`woLo& +zYk>+}L5odb>wZ7p0rW`H=!5Xpr^gw&$d1#EJi9wUp<5R0{r8F308)=y*qkWb#$aB! +zxWL>yQXS|Xl9Aym%Xz`M>P%BpQV2x*gI-o48+STu +z3$3oBI!+{uAH_J*!Llb@I&`@zc6tOW-Zh@dA)an-JR%AT +zcX`0xXx|`m$3*UAN@Z`UshkJM&i~3wvhOe*4uxZYZGkMwd#PLV+xqSCZ-e297bVP= +z7#j0kJKlq%vyY6M+7kvGluMJvviF4!boVD&8Z5tK30MFP7!V?J%%A`MuzD+q^t!)x +zEeYL}wZZ3!02waRlCs0daQ5RreFQdQHleGL=eM!d(0d33r7KfhZOZq%$NTg7ZS>`F +z>HST#B=b3H^v>ZP_EmJEm%-w~UbqS0tg$&-pzAZi#GS3DUXOd&0fA>_-A-#?wRkv%bZq5CthW8?0HTqA_*}iBPD&qZrw|7rwghRMU +UQS{yeSW{wYsp+dWg6-q}2kEwA&j0`b + diff --git a/0100-fs-lib-f2fs-needs-crc32-not-crc32c.patch b/0100-fs-lib-f2fs-needs-crc32-not-crc32c.patch new file mode 100644 index 0000000..8988d9a --- /dev/null +++ b/0100-fs-lib-f2fs-needs-crc32-not-crc32c.patch @@ -0,0 +1,28 @@ +From 34a42f9f49d4ad8897c4890af5b9a455e1335c66 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Fri, 8 Jul 2016 10:01:52 +0200 +Subject: [PATCH] fs-lib: f2fs needs crc32 not crc32c + +*sigh* +--- + modules.d/99fs-lib/module-setup.sh | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/modules.d/99fs-lib/module-setup.sh b/modules.d/99fs-lib/module-setup.sh +index 2c5f4c0..bd61838 100755 +--- a/modules.d/99fs-lib/module-setup.sh ++++ b/modules.d/99fs-lib/module-setup.sh +@@ -41,9 +41,12 @@ echo_fs_helper() { + include_fs_helper_modules() { + local dev=$1 fs=$2 + case "$fs" in +- xfs|btrfs|f2fs) ++ xfs|btrfs) + instmods crc32c + ;; ++ f2fs) ++ instmods crc32 ++ ;; + esac + } + diff --git a/0101-dracut-install.c-really-add-a-inbetween-destdir-and-.patch b/0101-dracut-install.c-really-add-a-inbetween-destdir-and-.patch new file mode 100644 index 0000000..231b847 --- /dev/null +++ b/0101-dracut-install.c-really-add-a-inbetween-destdir-and-.patch @@ -0,0 +1,37 @@ +From 24113c3a1126c7f0e46e7f3c0866e5f8c715775a Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Thu, 14 Jul 2016 13:53:24 +0200 +Subject: [PATCH] dracut-install.c: really add a "/" inbetween destdir and + target + +using dracut-install with + +find . -print0 | xargs dracut-install -D /tmp/test -a + +resulted in /tmp/test./.... files +--- + install/dracut-install.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/install/dracut-install.c b/install/dracut-install.c +index 9a0d53f..0cffa39 100644 +--- a/install/dracut-install.c ++++ b/install/dracut-install.c +@@ -617,7 +617,7 @@ static int dracut_install(const char *src, const char *dst, bool isdir, bool res + + hashmap_put(items, i, i); + +- ret = asprintf(&fulldstpath, "%s%s", destrootdir, dst); ++ ret = asprintf(&fulldstpath, "%s/%s", destrootdir, dst); + if (ret < 0) { + log_error("Out of memory!"); + exit(EXIT_FAILURE); +@@ -704,7 +704,7 @@ static int dracut_install(const char *src, const char *dst, bool isdir, bool res + if (lstat(fulldstpath, &sb) != 0) { + _cleanup_free_ char *absdestpath = NULL; + +- ret = asprintf(&absdestpath, "%s%s", destrootdir, abspath); ++ ret = asprintf(&absdestpath, "%s/%s", destrootdir, abspath); + if (ret < 0) { + log_error("Out of memory!"); + exit(EXIT_FAILURE); diff --git a/0102-fcoe-check-if-needed-for-hostonly.patch b/0102-fcoe-check-if-needed-for-hostonly.patch new file mode 100644 index 0000000..0308419 --- /dev/null +++ b/0102-fcoe-check-if-needed-for-hostonly.patch @@ -0,0 +1,50 @@ +From 5a3773dbe6b48a872295d6a10f87e5329f0113a1 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Wed, 29 Jun 2016 10:49:00 +0200 +Subject: [PATCH] fcoe: check if needed for hostonly + +(cherry picked from commit f45726652fd8c6fd6b5560e1142753bac62dc426) +--- + modules.d/95fcoe-uefi/module-setup.sh | 8 ++++++++ + modules.d/95fcoe/module-setup.sh | 5 +++-- + 2 files changed, 11 insertions(+), 2 deletions(-) + +diff --git a/modules.d/95fcoe-uefi/module-setup.sh b/modules.d/95fcoe-uefi/module-setup.sh +index 5d8477c..c9ff3c2 100755 +--- a/modules.d/95fcoe-uefi/module-setup.sh ++++ b/modules.d/95fcoe-uefi/module-setup.sh +@@ -2,6 +2,14 @@ + + # called by dracut + check() { ++ local _fcoe_ctlr ++ [[ $hostonly ]] || [[ $mount_needs ]] && { ++ for c in /sys/bus/fcoe/devices/ctlr_* ; do ++ [ -L $c ] || continue ++ _fcoe_ctlr=$c ++ done ++ [ -z "$_fcoe_ctlr" ] && return 255 ++ } + [[ $hostonly ]] || [[ $mount_needs ]] && { + [ -d /sys/firmware/efi ] || return 255 + } +diff --git a/modules.d/95fcoe/module-setup.sh b/modules.d/95fcoe/module-setup.sh +index 059bfde..531ea0d 100755 +--- a/modules.d/95fcoe/module-setup.sh ++++ b/modules.d/95fcoe/module-setup.sh +@@ -2,12 +2,13 @@ + + # called by dracut + check() { ++ local _fcoe_ctlr + [[ $hostonly ]] || [[ $mount_needs ]] && { + for c in /sys/bus/fcoe/devices/ctlr_* ; do + [ -L $c ] || continue +- fcoe_ctlr=$c ++ _fcoe_ctlr=$c + done +- [ -z "$fcoe_ctlr" ] && return 255 ++ [ -z "$_fcoe_ctlr" ] && return 255 + } + + require_binaries dcbtool fipvlan lldpad ip readlink fcoemon fcoeadm || return 1 diff --git a/0103-network-use-arping2-if-available.patch b/0103-network-use-arping2-if-available.patch new file mode 100644 index 0000000..06aea08 --- /dev/null +++ b/0103-network-use-arping2-if-available.patch @@ -0,0 +1,101 @@ +From 9853791d376bee4a658d624424b32f7deae6ac79 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Thu, 14 Jul 2016 14:24:31 +0200 +Subject: [PATCH] network: use arping2, if available + +fixes https://github.com/dracutdevs/dracut/issues/135 +--- + modules.d/40network/dhclient-script.sh | 13 ++++++++++--- + modules.d/40network/ifup.sh | 13 ++++++++++--- + modules.d/40network/module-setup.sh | 5 +++-- + modules.d/40network/net-lib.sh | 6 +++++- + 4 files changed, 28 insertions(+), 9 deletions(-) + +diff --git a/modules.d/40network/dhclient-script.sh b/modules.d/40network/dhclient-script.sh +index 94ee9d1..2eade35 100755 +--- a/modules.d/40network/dhclient-script.sh ++++ b/modules.d/40network/dhclient-script.sh +@@ -159,9 +159,16 @@ case $reason in + read layer2 < /sys/class/net/$netif/device/layer2 + fi + if [ "$layer2" != "0" ]; then +- if ! arping -f -q -D -c 2 -I $netif $new_ip_address ; then +- warn "Duplicate address detected for $new_ip_address while doing dhcp. retrying" +- exit 1 ++ if command -v arping2 >/dev/null; then ++ if arping2 -q -C 1 -c 2 -I $netif $new_ip_address ; then ++ warn "Duplicate address detected for $new_ip_address while doing dhcp. retrying" ++ exit 1 ++ fi ++ else ++ if ! arping -f -q -D -c 2 -I $netif $new_ip_address ; then ++ warn "Duplicate address detected for $new_ip_address while doing dhcp. retrying" ++ exit 1 ++ fi + fi + fi + unset layer2 +diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh +index 41282e7..1461b91 100755 +--- a/modules.d/40network/ifup.sh ++++ b/modules.d/40network/ifup.sh +@@ -110,9 +110,16 @@ do_static() { + ip addr add $ip/$mask ${srv:+peer $srv} dev $netif + wait_for_ipv6_dad $netif + else +- if ! arping -f -q -D -c 2 -I $netif $ip; then +- warn "Duplicate address detected for $ip for interface $netif." +- return 1 ++ if command -v arping2 >/dev/null; then ++ if arping2 -q -C 1 -c 2 -I $netif $ip ; then ++ warn "Duplicate address detected for $ip for interface $netif." ++ return 1 ++ fi ++ else ++ if ! arping -f -q -D -c 2 -I $netif $ip ; then ++ warn "Duplicate address detected for $ip for interface $netif." ++ return 1 ++ fi + fi + ip addr flush dev $netif + ip addr add $ip/$mask ${srv:+peer $srv} brd + dev $netif +diff --git a/modules.d/40network/module-setup.sh b/modules.d/40network/module-setup.sh +index 53b4b60..0501ffe 100755 +--- a/modules.d/40network/module-setup.sh ++++ b/modules.d/40network/module-setup.sh +@@ -4,7 +4,8 @@ + check() { + local _program + +- require_binaries ip arping dhclient || return 1 ++ require_binaries ip dhclient || return 1 ++ require_any_binaries arping arping2 || return 1 + + return 255 + } +@@ -23,7 +24,7 @@ installkernel() { + # called by dracut + install() { + local _arch _i _dir +- inst_multiple ip arping dhclient sed awk ++ inst_multiple ip arping arping2 dhclient sed awk + inst_multiple -o ping ping6 + inst_multiple -o brctl + inst_multiple -o teamd teamdctl teamnl +diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh +index 9c1448d..92225c5 100755 +--- a/modules.d/40network/net-lib.sh ++++ b/modules.d/40network/net-lib.sh +@@ -169,7 +169,11 @@ setup_net() { + fi + + if [ "$layer2" != "0" ] && [ -n "$dest" ] && ! strstr "$dest" ":"; then +- arping -q -f -w 60 -I $netif $dest || info "Resolving $dest via ARP on $netif failed" ++ if command -v arping2 >/dev/null; then ++ arping2 -q -C 1 -c 60 -I $netif $dest || info "Resolving $dest via ARP on $netif failed" ++ else ++ arping -q -f -w 60 -I $netif $dest || info "Resolving $dest via ARP on $netif failed" ++ fi + fi + unset layer2 + diff --git a/0104-dracut.conf.5.asc-remove-duplicate-i18n_install_all-.patch b/0104-dracut.conf.5.asc-remove-duplicate-i18n_install_all-.patch new file mode 100644 index 0000000..dc7896a --- /dev/null +++ b/0104-dracut.conf.5.asc-remove-duplicate-i18n_install_all-.patch @@ -0,0 +1,23 @@ +From aaaf035aedd043302c6fec57ba9570afe7639aab Mon Sep 17 00:00:00 2001 +From: Yu Watanabe +Date: Wed, 20 Jul 2016 18:23:44 +0900 +Subject: [PATCH] dracut.conf.5.asc: remove duplicate i18n_install_all option + +--- + dracut.conf.5.asc | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/dracut.conf.5.asc b/dracut.conf.5.asc +index 8f362b2..318024a 100644 +--- a/dracut.conf.5.asc ++++ b/dracut.conf.5.asc +@@ -99,9 +99,6 @@ Configuration files must have the extension .conf; other extensions are ignored. + *hostonly_cmdline=*"__{yes|no}__":: + If set, store the kernel command line arguments needed in the initramfs + +-*i18n_install_all=*"__{yes|no}__":: +- If set to yes, install all available fonts and keyboard files. +- + *persistent_policy=*"____":: + Use __ to address disks and partitions. + __ can be any directory name found in /dev/disk. diff --git a/0105-add-rd.emergency-reboot-poweroff-halt.patch b/0105-add-rd.emergency-reboot-poweroff-halt.patch new file mode 100644 index 0000000..4cf8988 --- /dev/null +++ b/0105-add-rd.emergency-reboot-poweroff-halt.patch @@ -0,0 +1,107 @@ +From c45e856a659a37537c107f7ef3e680abf60a96a5 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Fri, 22 Jul 2016 13:32:47 +0200 +Subject: [PATCH] add rd.emergency=[reboot|poweroff|halt] + +specifies what action to execute in case of a critical failure +--- + dracut.cmdline.7.asc | 3 +++ + modules.d/98dracut-systemd/dracut-emergency.sh | 13 +++++++++++-- + modules.d/99base/dracut-lib.sh | 24 ++++++++++++++++-------- + 3 files changed, 30 insertions(+), 10 deletions(-) + +diff --git a/dracut.cmdline.7.asc b/dracut.cmdline.7.asc +index bf00719..a2d1f95 100644 +--- a/dracut.cmdline.7.asc ++++ b/dracut.cmdline.7.asc +@@ -129,6 +129,9 @@ menuentry 'Live Fedora 20' --class fedora --class gnu-linux --class gnu --class + + Misc + ~~~~ ++**rd.emergency=**__[reboot|poweroff|halt]__:: ++ specify, what action to execute in case of a critical failure. ++ + **rd.driver.blacklist=**____[,____,...]:: + do not load kernel module . This parameter can be specified + multiple times. +diff --git a/modules.d/98dracut-systemd/dracut-emergency.sh b/modules.d/98dracut-systemd/dracut-emergency.sh +index 63311c2..548f64b 100755 +--- a/modules.d/98dracut-systemd/dracut-emergency.sh ++++ b/modules.d/98dracut-systemd/dracut-emergency.sh +@@ -11,7 +11,7 @@ source_conf /etc/conf.d + type plymouth >/dev/null 2>&1 && plymouth quit + + export _rdshell_name="dracut" action="Boot" hook="emergency" +- ++_emergency_action=$(getarg rd.emergency) + + if getargbool 1 rd.shell -d -y rdshell || getarg rd.break -d rdbreak; then + source_hook "$hook" +@@ -32,9 +32,18 @@ else + export hook="shutdown-emergency" + warn "$action has failed. To debug this issue add \"rd.shell rd.debug\" to the kernel command line." + source_hook "$hook" +- exit 1 ++ [ -z "$_emergency_action" ] && _emergency_action=halt + fi + + /bin/rm -f -- /.console_lock + ++case "$_emergency_action" in ++ reboot) ++ reboot || exit 1;; ++ poweroff) ++ poweroff || exit 1;; ++ halt) ++ halt || exit 1;; ++esac ++ + exit 0 +diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh +index 94e4614..060b3fe 100755 +--- a/modules.d/99base/dracut-lib.sh ++++ b/modules.d/99base/dracut-lib.sh +@@ -1111,6 +1111,8 @@ emergency_shell() + local _ctty + set +e + local _rdshell_name="dracut" action="Boot" hook="emergency" ++ local _emergency_action ++ + if [ "$1" = "-n" ]; then + _rdshell_name=$2 + shift 2 +@@ -1129,20 +1131,26 @@ emergency_shell() + source_hook "$hook" + echo + ++ _emergency_action=$(getarg rd.emergency) ++ [ -z "$_emergency_action" ] \ ++ && [ -e /run/initramfs/.die ] \ ++ && _emergency_action=halt ++ + if getargbool 1 rd.shell -d -y rdshell || getarg rd.break -d rdbreak; then + _emergency_shell $_rdshell_name + else + warn "$action has failed. To debug this issue add \"rd.shell rd.debug\" to the kernel command line." +- # cause a kernel panic +- exit 1 ++ [ -z "$_emergency_action" ] && _emergency_action=halt + fi + +- if [ -e /run/initramfs/.die ]; then +- if [ -n "$DRACUT_SYSTEMD" ]; then +- systemctl --no-block --force halt +- fi +- exit 1 +- fi ++ case "$_emergency_action" in ++ reboot) ++ reboot || exit 1;; ++ poweroff) ++ poweroff || exit 1;; ++ halt) ++ halt || exit 1;; ++ esac + } + + # Retain the values of these variables but ensure that they are unexported diff --git a/0106-fips-module-add-missing-space.patch b/0106-fips-module-add-missing-space.patch new file mode 100644 index 0000000..2e99f47 --- /dev/null +++ b/0106-fips-module-add-missing-space.patch @@ -0,0 +1,22 @@ +From 1c132d39a618e625e80b7d23a55ea6527180a5b0 Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +Date: Thu, 28 Jul 2016 11:02:19 +0200 +Subject: [PATCH] fips-module: add missing space + +--- + modules.d/01fips/module-setup.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/01fips/module-setup.sh b/modules.d/01fips/module-setup.sh +index 7278347..65177a9 100755 +--- a/modules.d/01fips/module-setup.sh ++++ b/modules.d/01fips/module-setup.sh +@@ -17,7 +17,7 @@ installkernel() { + _fipsmodules+="chainiv crc32c crct10dif_generic cryptomgr crypto_null ctr cts deflate des des3_ede dm-crypt dm-mod drbg " + _fipsmodules+="ecb eseqiv fcrypt gcm ghash_generic hmac khazad lzo md4 md5 michael_mic rmd128 " + _fipsmodules+="rmd160 rmd256 rmd320 rot13 salsa20 seed seqiv serpent sha1 sha224 sha256 sha256_generic " +- _fipsmodules+="sha384 sha512 sha512_generic tcrypt tea tnepres twofish wp256 wp384 wp512 xeta xtea xts zlib" ++ _fipsmodules+="sha384 sha512 sha512_generic tcrypt tea tnepres twofish wp256 wp384 wp512 xeta xtea xts zlib " + _fipsmodules+="aes_s390 des_s390 prng sha256_s390 sha_common des_check_key ghash_s390 sha1_s390 sha512_s390" + + mkdir -m 0755 -p "${initdir}/etc/modprobe.d" diff --git a/0107-network-support-macaddr-in-brackets.patch b/0107-network-support-macaddr-in-brackets.patch new file mode 100644 index 0000000..7082c9a --- /dev/null +++ b/0107-network-support-macaddr-in-brackets.patch @@ -0,0 +1,167 @@ +From 740c46c0224a187d6b5a42b4aa56e173238884cc Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Wed, 29 Jun 2016 12:27:37 +0200 +Subject: [PATCH] network: support macaddr in brackets [] + +ip=ens3:dhcp:1000 +ip=ens3:dhcp::54:52:00:ab:cd:ef +ip=ens3:dhcp::[54:52:00:ab:cd:ef] +ip=ens3:dhcp:1000:54:52:00:ab:cd:ef +ip=ens3:dhcp:1000:[54:52:00:ab:cd:ef] + +ip=192.168.122.20::192.168.122.1:24:test:ens3:none:1000 +ip=192.168.122.20::192.168.122.1:24:test:ens3:none::54:52:00:ab:cd:ef +ip=192.168.122.20::192.168.122.1:24:test:ens3:none::[54:52:00:ab:cd:ef] +ip=192.168.122.20::192.168.122.1:24:test:ens3:none:1000:54:52:00:ab:cd:ef +ip=192.168.122.20::192.168.122.1:24:test:ens3:none:1000:[54:52:00:ab:cd:ef] + +ip=::::test:ens3:dhcp:1000 +ip=::::test:ens3:dhcp::54:52:00:ab:cd:ef +ip=::::test:ens3:dhcp::[54:52:00:ab:cd:ef] +ip=::::test:ens3:dhcp:1000:54:52:00:ab:cd:ef +ip=::::test:ens3:dhcp:1000:[54:52:00:ab:cd:ef] + +(cherry picked from commit 53e4ab71742fc1e5d8112c719c0d154d08815fa1) +--- + modules.d/40network/net-lib.sh | 124 ++++++++++++++++++++++++----------------- + 1 file changed, 74 insertions(+), 50 deletions(-) + +diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh +index 92225c5..eb98f8e 100755 +--- a/modules.d/40network/net-lib.sh ++++ b/modules.d/40network/net-lib.sh +@@ -447,60 +447,84 @@ ip_to_var() { + done + + unset ip srv gw mask hostname dev autoconf macaddr mtu dns1 dns2 +- case $# in +- 0) autoconf="error" ;; +- 1) autoconf=$1 ;; +- 2) [ -n "$1" ] && dev=$1; [ -n "$2" ] && autoconf=$2 ;; +- 3) [ -n "$1" ] && dev=$1; [ -n "$2" ] && autoconf=$2; [ -n "$3" ] && mtu=$3 ;; +- 4) [ -n "$1" ] && dev=$1; [ -n "$2" ] && autoconf=$2; [ -n "$3" ] && mtu=$3; [ -n "$4" ] && macaddr=$4 ;; +- *) [ -n "$1" ] && ip=$1; [ -n "$2" ] && srv=$2; [ -n "$3" ] && gw=$3; [ -n "$4" ] && mask=$4; +- [ -n "$5" ] && hostname=$5; [ -n "$6" ] && dev=$6; [ -n "$7" ] && autoconf=$7; +- case "$8" in +- [0-9]*:*|[0-9]*.[0-9]*.[0-9]*.[0-9]*) +- dns1="$8" +- [ -n "$9" ] && dns2="$9" +- ;; +- [0-9]*) +- mtu="$8" +- if [ -n "${9}" -a -n "${10}" -a -n "${11}" -a -n "${12}" -a -n "${13}" -a -n "${14}" ]; then +- macaddr="${9}:${10}:${11}:${12}:${13}:${14}" +- fi +- ;; +- *) +- if [ -n "${9}" -a -n "${10}" -a -n "${11}" -a -n "${12}" -a -n "${13}" -a -n "${14}" ]; then +- macaddr="${9}:${10}:${11}:${12}:${13}:${14}" +- fi +- ;; ++ ++ if [ $# -eq 0 ]; then ++ autoconf="error" ++ return 0 ++ fi ++ ++ if [ $# -eq 1 ]; then ++ # format: ip={dhcp|on|any|dhcp6|auto6} ++ # or ++ # ip= means anaconda-style static config argument cluster ++ autoconf="$1" ++ ++ if strstr "$autoconf" "*.*.*.*"; then ++ # ip= means anaconda-style static config argument cluster: ++ # ip= gateway= netmask= hostname= mtu= ++ # ksdevice={link|bootif|ibft||} ++ ip="$autoconf" ++ gw=$(getarg gateway=) ++ mask=$(getarg netmask=) ++ hostname=$(getarg hostname=) ++ dev=$(getarg ksdevice=) ++ autoconf="none" ++ mtu=$(getarg mtu=) ++ ++ # handle special values for ksdevice ++ case "$dev" in ++ bootif|BOOTIF) dev=$(fix_bootif $(getarg BOOTIF=)) ;; ++ link) dev="" ;; # FIXME: do something useful with this ++ ibft) dev="" ;; # ignore - ibft is handled elsewhere + esac ++ fi ++ return 0 ++ fi ++ ++ if [ "$2" = "dhcp" -o "$2" = "on" -o "$2" = "any" -o "$2" = "dhcp6" -o "$2" = "auto6" ]; then ++ # format: ip=:{dhcp|on|any|dhcp6|auto6}[:[][:]] ++ [ -n "$1" ] && dev="$1" ++ [ -n "$2" ] && autoconf="$2" ++ [ -n "$3" ] && mtu=$3 ++ if [ -z "$5" ]; then ++ macaddr="$4" ++ else ++ macaddr="${4}:${5}:${6}:${7}:${8}:${9}" ++ fi ++ return 0 ++ fi ++ ++ # format: ip=:[]:::::{none|off|dhcp|on|any|dhcp6|auto6|ibft}:[:[][:]] ++ ++ [ -n "$1" ] && ip=$1 ++ [ -n "$2" ] && srv=$2 ++ [ -n "$3" ] && gw=$3 ++ [ -n "$4" ] && mask=$4 ++ [ -n "$5" ] && hostname=$5 ++ [ -n "$6" ] && dev=$6 ++ [ -n "$7" ] && autoconf=$7 ++ case "$8" in ++ [0-9]*:*|[0-9]*.[0-9]*.[0-9]*.[0-9]*) ++ dns1="$8" ++ [ -n "$9" ] && dns2="$9" + ;; +- esac +- # Extract prefix length from CIDR notation +- case $ip in +- */*) +- mask=${ip##*/} +- ip=${ip%/*} ++ [0-9]*) ++ mtu="$8" ++ if [ -n "${9}" -a -z "${10}" ]; then ++ macaddr="${9}" ++ elif [ -n "${9}" -a -n "${10}" -a -n "${11}" -a -n "${12}" -a -n "${13}" -a -n "${14}" ]; then ++ macaddr="${9}:${10}:${11}:${12}:${13}:${14}" ++ fi + ;; ++ *) ++ if [ -n "${9}" -a -z "${10}" ]; then ++ macaddr="${9}" ++ elif [ -n "${9}" -a -n "${10}" -a -n "${11}" -a -n "${12}" -a -n "${13}" -a -n "${14}" ]; then ++ macaddr="${9}:${10}:${11}:${12}:${13}:${14}" ++ fi ++ ;; + esac +- +- # ip= means anaconda-style static config argument cluster: +- # ip= gateway= netmask= hostname= mtu= +- # ksdevice={link|bootif|ibft||} +- if strglob "$autoconf" "*.*.*.*"; then +- ip="$autoconf" +- gw=$(getarg gateway=) +- mask=$(getarg netmask=) +- hostname=$(getarg hostname=) +- dev=$(getarg ksdevice=) +- autoconf="none" +- mtu=$(getarg mtu=) +- +- # handle special values for ksdevice +- case "$dev" in +- bootif|BOOTIF) dev=$(fix_bootif $(getarg BOOTIF=)) ;; +- link) dev="" ;; # FIXME: do something useful with this +- ibft) dev="" ;; # ignore - ibft is handled elsewhere +- esac +- fi ++ return 0 + } + + route_to_var() { diff --git a/0108-nfs-install-all-nfs-modules-non-hostonly.patch b/0108-nfs-install-all-nfs-modules-non-hostonly.patch new file mode 100644 index 0000000..f75c431 --- /dev/null +++ b/0108-nfs-install-all-nfs-modules-non-hostonly.patch @@ -0,0 +1,26 @@ +From 88f9d6140da2667b58ddde082ede0f99aead2078 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Fri, 22 Jul 2016 08:30:36 +0200 +Subject: [PATCH] nfs: install all nfs modules non-hostonly + +If nfs is used, we should include all nfs modules, in the case, where +$host_fs_types contains nfs. + +(cherry picked from commit b077d18963436f6771e7ce3c486bcb2ae80165db) +--- + modules.d/95nfs/module-setup.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/95nfs/module-setup.sh b/modules.d/95nfs/module-setup.sh +index 9767e57..0f87761 100755 +--- a/modules.d/95nfs/module-setup.sh ++++ b/modules.d/95nfs/module-setup.sh +@@ -25,7 +25,7 @@ depends() { + + # called by dracut + installkernel() { +- instmods =net/sunrpc =fs/nfs ipv6 nfs_acl nfs_layout_nfsv41_files ++ hostonly='' instmods =net/sunrpc =fs/nfs ipv6 nfs_acl nfs_layout_nfsv41_files + } + + cmdline() { diff --git a/7e51abc81f53c08e464decd4103e8c4ec25fef87.patch b/7e51abc81f53c08e464decd4103e8c4ec25fef87.patch deleted file mode 100644 index cabf49f..0000000 --- a/7e51abc81f53c08e464decd4103e8c4ec25fef87.patch +++ /dev/null @@ -1,20 +0,0 @@ -From 7e51abc81f53c08e464decd4103e8c4ec25fef87 Mon Sep 17 00:00:00 2001 -From: Harald Hoyer -Date: Thu, 23 Jun 2016 14:24:40 +0200 -Subject: [PATCH] network/dhclient.conf: add missing commata - -options need to be seperated by , ---- - modules.d/40network/dhclient.conf | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/modules.d/40network/dhclient.conf b/modules.d/40network/dhclient.conf -index 7b06763..a1739ce 100644 ---- a/modules.d/40network/dhclient.conf -+++ b/modules.d/40network/dhclient.conf -@@ -3,4 +3,4 @@ option classless-routes code 121 = array of unsigned integer 8; - - request subnet-mask, broadcast-address, time-offset, routers, - domain-name, domain-name-servers, domain-search, host-name, -- root-path, interface-mtu classless-routes; -+ root-path, interface-mtu, classless-routes; diff --git a/dracut.spec b/dracut.spec index 1919747..6bc8c4c 100644 --- a/dracut.spec +++ b/dracut.spec @@ -16,7 +16,7 @@ Name: dracut Version: 044 -Release: 76%{?dist} +Release: 109%{?dist} Summary: Initramfs generator using udev %if 0%{?fedora} || 0%{?rhel} @@ -102,16 +102,47 @@ Patch64: 0064-removed-obsolete-kernel-module-functions-and-host_mo.patch Patch65: 0065-watchdog-clean-return-of-installkernel.patch Patch66: 0066-watchdog-start-traversing-the-device-tree-from-the-r.patch Patch67: 0067-dracut-10i18n-support-default-loadkeys-setfont-data-.patch -Patch68: 0068-ensure-parent-dir-for-usr-lib-initrd-release-exists.patch -Patch69: 0069-Fix-small-typo-in-dracut.cmdline-7.patch -Patch70: 0070-systemd-ensure-journal-is-volatile.patch -Patch71: 0071-configure-don-t-hardcode-pkg-config.patch -Patch72: 0072-dracut-systemd-dracut-cmdline.sh-Don-t-error-out-if-.patch -Patch73: 0073-move-ln_r-to-dracut-init.sh.patch -Patch74: 0074-systemd-initrd-add-initrd-root-device.target.patch - -# Backport from master to fix RHBZ #1358416 -Patch1000: https://github.com/dracutdevs/dracut/commit/7e51abc81f53c08e464decd4103e8c4ec25fef87.patch +Patch68: 0068-network-dhcp-before-parsing-specified-dns-through-cm.patch +Patch69: 0069-network-net-lib.sh-delete-duplicated-DNS-items-from-.patch +Patch70: 0070-ensure-parent-dir-for-usr-lib-initrd-release-exists.patch +Patch71: 0071-Fix-small-typo-in-dracut.cmdline-7.patch +Patch72: 0072-systemd-ensure-journal-is-volatile.patch +Patch73: 0073-configure-don-t-hardcode-pkg-config.patch +Patch74: 0074-dracut-systemd-dracut-cmdline.sh-Don-t-error-out-if-.patch +Patch75: 0075-move-ln_r-to-dracut-init.sh.patch +Patch76: 0076-systemd-initrd-add-initrd-root-device.target.patch +Patch77: 0077-dracut.sh-fix-tmpfilesdir-fallback-when-systemd-deve.patch +Patch78: 0078-dracut-Add-drivers-clk-by-default-on-arm.patch +Patch79: 0079-network-remove-awk-call-and-replace-it-with-a-shell-.patch +Patch80: 0080-dracut-init.sh-set-default-firmware-path-if-not-spec.patch +Patch81: 0081-use-shutdown-emergency-hook-in-testsuite-to-poweroff.patch +Patch82: 0082-Revert-network-remove-awk-call-and-replace-it-with-a.patch +Patch83: 0083-dracut-systemd-dracut-emergency.sh-call-shutdown-eme.patch +Patch84: 0084-systemd-add-udev.hwdb-and-udev.conf.patch +Patch85: 0085-cope-with-rd.shell-0-in-the-testsuite.patch +Patch86: 0086-test-TEST-99-RPM-fixed-test-suite.patch +Patch87: 0087-test-handle-kernel-panic-in-testsuite.patch +Patch88: 0088-systemd-add-missing-.slice-unit.patch +Patch89: 0089-dracut-systemd-.service-conflict-with-shutdown-targe.patch +Patch90: 0090-network-dhclient.conf-add-missing-commata.patch +Patch91: 0091-TEST-20-NFS-skip-root-dev-nfs-tests-with-systemd-v23.patch +Patch92: 0092-fcoe-cleanup-fcoe.sh-don-t-copy-shm-files-to-state.patch +Patch93: 0093-test-correct-cmdline-reading-functions.patch +Patch94: 0094-40network-Update-iBFT-scanning-code-to-handle-IPv6.patch +Patch95: 0095-dracut.sh-make-tmp-dirs-after-the-trap-function-is-i.patch +Patch96: 0096-add-support-to-F2FS-filesystem-fsck.patch +Patch97: 0097-systemd-install-missing-drop-in-configs.patch +Patch98: 0098-fs-lib-add-crc32c-kernel-module-for-f2fs.patch +Patch99: 0099-dracut.png-Optimize-with-zopflipng-m.patch +Patch100: 0100-fs-lib-f2fs-needs-crc32-not-crc32c.patch +Patch101: 0101-dracut-install.c-really-add-a-inbetween-destdir-and-.patch +Patch102: 0102-fcoe-check-if-needed-for-hostonly.patch +Patch103: 0103-network-use-arping2-if-available.patch +Patch104: 0104-dracut.conf.5.asc-remove-duplicate-i18n_install_all-.patch +Patch105: 0105-add-rd.emergency-reboot-poweroff-halt.patch +Patch106: 0106-fips-module-add-missing-space.patch +Patch107: 0107-network-support-macaddr-in-brackets.patch +Patch108: 0108-nfs-install-all-nfs-modules-non-hostonly.patch Source1: https://www.gnu.org/licenses/lgpl-2.1.txt @@ -575,6 +606,9 @@ rm -rf -- $RPM_BUILD_ROOT %endif %changelog +* Thu Aug 18 2016 Harald Hoyer - 044-109 +- git snapshot + * Fri Aug 05 2016 Adam Williamson - 044-76 - backport a single commit to fix RHBZ #1358416 (anaconda network init)