From 0840a3b62ca2f4af7c6afd18a12b27e6e59a04e3 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Jul 10 2015 09:31:14 +0000 Subject: dracut-043-40.git20150710 - git snapshot --- diff --git a/0001-Fix-default-udev-systemd-dir-detection-in-usr-merge-.patch b/0001-Fix-default-udev-systemd-dir-detection-in-usr-merge-.patch new file mode 100644 index 0000000..a1d5d26 --- /dev/null +++ b/0001-Fix-default-udev-systemd-dir-detection-in-usr-merge-.patch @@ -0,0 +1,33 @@ +From 80dab03a7dc080b8d35fdd4c23e30e79e044c2a2 Mon Sep 17 00:00:00 2001 +From: Dimitri John Ledkov +Date: Tue, 17 Feb 2015 13:03:01 +0000 +Subject: [PATCH] Fix default udev & systemd dir detection, in usr-merge + configurations. + +Test that /lib is not a symlink, before using split-usr paths. +--- + dracut.sh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/dracut.sh b/dracut.sh +index d06d7d4..4f72b54 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -1300,7 +1300,7 @@ done + [[ -d $udevdir ]] \ + || udevdir="$(pkg-config udev --variable=udevdir 2>/dev/null)" + if ! [[ -d "$udevdir" ]]; then +- [[ -d /lib/udev ]] && udevdir=/lib/udev ++ [[ ! -h /lib ]] && [[ -d /lib/udev ]] && udevdir=/lib/udev + [[ -d /usr/lib/udev ]] && udevdir=/usr/lib/udev + fi + +@@ -1308,7 +1308,7 @@ fi + || systemdutildir=$(pkg-config systemd --variable=systemdutildir 2>/dev/null) + + if ! [[ -d "$systemdutildir" ]]; then +- [[ -d /lib/systemd ]] && systemdutildir=/lib/systemd ++ [[ ! -h /lib ]] && [[ -d /lib/systemd ]] && systemdutildir=/lib/systemd + [[ -d /usr/lib/systemd ]] && systemdutildir=/usr/lib/systemd + fi + diff --git a/0002-rootfs-generator-check-for-rootok-before-doing-any-a.patch b/0002-rootfs-generator-check-for-rootok-before-doing-any-a.patch new file mode 100644 index 0000000..59ae85f --- /dev/null +++ b/0002-rootfs-generator-check-for-rootok-before-doing-any-a.patch @@ -0,0 +1,22 @@ +From 231b3dd4327e011285636e73459c3d139baba661 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Mon, 15 Jun 2015 15:28:52 +0200 +Subject: [PATCH] rootfs-generator: check for rootok, before doing any action + +--- + modules.d/98dracut-systemd/rootfs-generator.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/98dracut-systemd/rootfs-generator.sh b/modules.d/98dracut-systemd/rootfs-generator.sh +index 5910ce7..670613e 100755 +--- a/modules.d/98dracut-systemd/rootfs-generator.sh ++++ b/modules.d/98dracut-systemd/rootfs-generator.sh +@@ -93,7 +93,7 @@ esac + + GENERATOR_DIR="$1" + +-if [ "${root%%:*}" = "block" ]; then ++if [ "$rootok" = "1" ]; then + generator_wait_for_dev "${root#block:}" "$RDRETRY" + strstr "$(cat /proc/cmdline)" 'root=' || generator_mount_rootfs "${root#block:}" "$(getarg rootfstype=)" "$(getarg rootflags=)" + fi diff --git a/0003-uefi-lib-remove-bogus-comment.patch b/0003-uefi-lib-remove-bogus-comment.patch new file mode 100644 index 0000000..41b1b9c --- /dev/null +++ b/0003-uefi-lib-remove-bogus-comment.patch @@ -0,0 +1,19 @@ +From aca93e3364b9b837eb98eeb62322cf19d9819147 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Tue, 16 Jun 2015 15:08:23 +0200 +Subject: [PATCH] uefi-lib: remove bogus comment + +--- + modules.d/99uefi-lib/module-setup.sh | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/modules.d/99uefi-lib/module-setup.sh b/modules.d/99uefi-lib/module-setup.sh +index 4a856ea..3dcff22 100755 +--- a/modules.d/99uefi-lib/module-setup.sh ++++ b/modules.d/99uefi-lib/module-setup.sh +@@ -1,5 +1,4 @@ + #!/bin/bash +-# module-setup for img-lib + + # called by dracut + check() { diff --git a/0004-dracut.spec-move-dmsquash-and-livnet-to-subpackage.patch b/0004-dracut.spec-move-dmsquash-and-livnet-to-subpackage.patch new file mode 100644 index 0000000..bcce092 --- /dev/null +++ b/0004-dracut.spec-move-dmsquash-and-livnet-to-subpackage.patch @@ -0,0 +1,69 @@ +From ac13778f60f3a9568eaa2b480a77563337575d91 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Tue, 16 Jun 2015 15:17:39 +0200 +Subject: [PATCH] dracut.spec: move dmsquash and livnet to subpackage + +dmsquash and livenet need img-lib, which needs tar, which is normally +not needed. +--- + dracut.spec | 19 ++++++++++++++++--- + 1 file changed, 16 insertions(+), 3 deletions(-) + +diff --git a/dracut.spec b/dracut.spec +index 6b37dc3..58510db 100644 +--- a/dracut.spec ++++ b/dracut.spec +@@ -168,6 +168,16 @@ Requires: libcap + This package requires everything which is needed to build an + initramfs with dracut, which drops capabilities. + ++%package live ++Summary: dracut modules to build a dracut initramfs with live image capabilities ++Requires: %{name} = %{version}-%{release} ++Requires: %{name}-network = %{version}-%{release} ++Requires: tar gzip coreutils bash device-mapper curl ++ ++%description live ++This package requires everything which is needed to build an ++initramfs with dracut, with live image capabilities, like Live CDs. ++ + %package config-generic + Summary: dracut configuration to turn off hostonly image generation + Requires: %{name} = %{version}-%{release} +@@ -345,7 +355,6 @@ rm -rf -- $RPM_BUILD_ROOT + %{dracutlibdir}/modules.d/90crypt + %{dracutlibdir}/modules.d/90dm + %{dracutlibdir}/modules.d/90dmraid +-%{dracutlibdir}/modules.d/90dmsquash-live + %{dracutlibdir}/modules.d/90kernel-modules + %{dracutlibdir}/modules.d/90lvm + %{dracutlibdir}/modules.d/90mdraid +@@ -379,7 +388,6 @@ rm -rf -- $RPM_BUILD_ROOT + %{dracutlibdir}/modules.d/98usrmount + %{dracutlibdir}/modules.d/99base + %{dracutlibdir}/modules.d/99fs-lib +-%{dracutlibdir}/modules.d/99img-lib + %{dracutlibdir}/modules.d/99shutdown + %attr(0644,root,root) %ghost %config(missingok,noreplace) %{_localstatedir}/log/dracut.log + %dir %{_sharedstatedir}/initramfs +@@ -413,7 +421,6 @@ rm -rf -- $RPM_BUILD_ROOT + %{dracutlibdir}/modules.d/90kernel-network-modules + %{dracutlibdir}/modules.d/95fcoe + %{dracutlibdir}/modules.d/95iscsi +-%{dracutlibdir}/modules.d/90livenet + %{dracutlibdir}/modules.d/90qemu-net + %{dracutlibdir}/modules.d/95cifs + %{dracutlibdir}/modules.d/95nbd +@@ -440,6 +447,12 @@ rm -rf -- $RPM_BUILD_ROOT + %defattr(-,root,root,0755) + %{dracutlibdir}/modules.d/02caps + ++%files live ++%defattr(-,root,root,0755) ++%{dracutlibdir}/modules.d/99img-lib ++%{dracutlibdir}/modules.d/90dmsquash-live ++%{dracutlibdir}/modules.d/90livenet ++ + %files tools + %defattr(-,root,root,0755) + diff --git a/0005-dracut.spec-Recommends-grubby.patch b/0005-dracut.spec-Recommends-grubby.patch new file mode 100644 index 0000000..4d94be3 --- /dev/null +++ b/0005-dracut.spec-Recommends-grubby.patch @@ -0,0 +1,24 @@ +From 47ff68e78b3bbd01367948b5b9fe1cbaeb45f262 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Tue, 23 Jun 2015 15:21:37 +0200 +Subject: [PATCH] dracut.spec: Recommends grubby + +--- + dracut.spec | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/dracut.spec b/dracut.spec +index 58510db..7a1a9c2 100644 +--- a/dracut.spec ++++ b/dracut.spec +@@ -113,6 +113,10 @@ Requires: util-linux-ng >= 2.21 + + Conflicts: mdadm < 3.2.6-14 + ++%if 0%{?fedora} > 22 ++Recommends: grubby ++%endif ++ + %description + dracut contains tools to create a bootable initramfs for 2.6 Linux kernels. + Unlike existing implementations, dracut does hard-code as little as possible diff --git a/0006-dracut.spec-turn-requires-in-recommends.patch b/0006-dracut.spec-turn-requires-in-recommends.patch new file mode 100644 index 0000000..d9b152e --- /dev/null +++ b/0006-dracut.spec-turn-requires-in-recommends.patch @@ -0,0 +1,48 @@ +From c42064a684f3413dfce249c5bd6ebe0cb0a16908 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Tue, 23 Jun 2015 15:29:00 +0200 +Subject: [PATCH] dracut.spec: turn requires in recommends + +--- + dracut.spec | 18 ++++++++++++------ + 1 file changed, 12 insertions(+), 6 deletions(-) + +diff --git a/dracut.spec b/dracut.spec +index 7a1a9c2..4775210 100644 +--- a/dracut.spec ++++ b/dracut.spec +@@ -92,11 +92,21 @@ Requires: cpio + Requires: filesystem >= 2.1.0 + Requires: findutils + Requires: grep +-Requires: hardlink +-Requires: gzip xz + Requires: kmod + Requires: sed ++ ++%if 0%{?fedora} > 22 ++Recommends: grubby ++Recommends: hardlink ++Recommends: gzip ++Recommends: xz ++Recommends: kpartx ++%else ++Requires: hardlink ++Requires: gzip ++Requires: xz + Requires: kpartx ++%endif + + %if 0%{?fedora} || 0%{?rhel} > 6 + Requires: util-linux >= 2.21 +@@ -113,10 +123,6 @@ Requires: util-linux-ng >= 2.21 + + Conflicts: mdadm < 3.2.6-14 + +-%if 0%{?fedora} > 22 +-Recommends: grubby +-%endif +- + %description + dracut contains tools to create a bootable initramfs for 2.6 Linux kernels. + Unlike existing implementations, dracut does hard-code as little as possible diff --git a/0007-Revert-lvm-Don-t-activate-LVs-with-activationskip-se.patch b/0007-Revert-lvm-Don-t-activate-LVs-with-activationskip-se.patch new file mode 100644 index 0000000..6e16743 --- /dev/null +++ b/0007-Revert-lvm-Don-t-activate-LVs-with-activationskip-se.patch @@ -0,0 +1,30 @@ +From d4b93a092db1105a29a3f768d1d49ece8b90547a Mon Sep 17 00:00:00 2001 +From: Fabian Deutsch +Date: Thu, 25 Jun 2015 11:17:59 +0200 +Subject: [PATCH] Revert "lvm: Don't activate LVs with activationskip set" + +This reverts commit cfa365a32d47388c8476064b23d7d4684f1e591b. + +The logic in commit cfa365a was added to prevent (odl) lvms from +activating snapshots which should not be activated. +Newer lvms however do this automatically (not enabling an LV if the +the 'k' attribute set), thus we can revert the previous commit. +--- + modules.d/90lvm/lvm_scan.sh | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/modules.d/90lvm/lvm_scan.sh b/modules.d/90lvm/lvm_scan.sh +index ce46e14..7495644 100755 +--- a/modules.d/90lvm/lvm_scan.sh ++++ b/modules.d/90lvm/lvm_scan.sh +@@ -106,10 +106,6 @@ if [ -n "$LVS" ] ; then + info "Scanning devices $lvmdevs for LVM logical volumes $LVS" + lvm lvscan --ignorelockingfailure 2>&1 | vinfo + for LV in $LVS; do +- if [ "x$(lvm lvs --noheadings --select "lv_attr =~ k" $LV | wc -l)" = "x0" ]; then +- info "Skipping activation of '$LV' because activationskip is set." +- continue +- fi + if [ -z "$sysinit" ]; then + lvm lvchange --yes -ay --ignorelockingfailure $nopoll --ignoremonitoring $LV 2>&1 | vinfo + else diff --git a/0008-systemd-if-kdbus-is-available-include-the-kernel-mod.patch b/0008-systemd-if-kdbus-is-available-include-the-kernel-mod.patch new file mode 100644 index 0000000..04ece67 --- /dev/null +++ b/0008-systemd-if-kdbus-is-available-include-the-kernel-mod.patch @@ -0,0 +1,22 @@ +From 90ff5ad67ecab66a8f699c9805729701981ee018 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Cristian=20Rodr=C3=ADguez?= +Date: Wed, 1 Jul 2015 20:15:13 -0300 +Subject: [PATCH] systemd: if kdbus is available, include the kernel module + +--- + modules.d/00systemd/module-setup.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/00systemd/module-setup.sh b/modules.d/00systemd/module-setup.sh +index ed55fcc..e763d9f 100755 +--- a/modules.d/00systemd/module-setup.sh ++++ b/modules.d/00systemd/module-setup.sh +@@ -19,7 +19,7 @@ depends() { + + installkernel() { + hostonly='' instmods autofs4 ipv6 +- instmods -s efivarfs ++ instmods -s efivarfs kdbus + } + + # called by dracut diff --git a/0009-network-dhclient-script.sh-add-RENEW-REBIND.patch b/0009-network-dhclient-script.sh-add-RENEW-REBIND.patch new file mode 100644 index 0000000..bfe499d --- /dev/null +++ b/0009-network-dhclient-script.sh-add-RENEW-REBIND.patch @@ -0,0 +1,50 @@ +From cf627b20d039c527f4de167e38978d4984e4d727 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Wed, 1 Jul 2015 14:53:33 +0200 +Subject: [PATCH] network/dhclient-script.sh: add RENEW/REBIND + +--- + modules.d/40network/dhclient-script.sh | 23 +++++++++++++++++++++++ + 1 file changed, 23 insertions(+) + +diff --git a/modules.d/40network/dhclient-script.sh b/modules.d/40network/dhclient-script.sh +index 500f518..320208b 100755 +--- a/modules.d/40network/dhclient-script.sh ++++ b/modules.d/40network/dhclient-script.sh +@@ -135,6 +135,17 @@ case $reason in + >/tmp/net.$netif.up + ;; + ++ RENEW|REBIND) ++ unset lease_time ++ [ -n "$new_dhcp_lease_time" ] && lease_time=$new_dhcp_lease_time ++ [ -n "$new_max_life" ] && lease_time=$new_max_life ++ preferred_lft=$lease_time ++ [ -n "$new_preferred_life" ] && preferred_lft=$new_preferred_life ++ ip -4 addr change ${new_ip_address}/${new_prefix} broadcast ${new_broadcast_address} dev ${interface} \ ++ ${lease_time:+valid_lft $lease_time} ${preferred_lft:+preferred_lft ${preferred_lft}} \ ++ >/dev/null 2>&1 ++ ;; ++ + BOUND6) + echo "dhcp: BOND6 setting $netif" + setup_interface6 +@@ -155,6 +166,18 @@ case $reason in + echo "[ -f /tmp/net.$netif.did-setup ]" > $hookdir/initqueue/finished/dhclient-$netif.sh + >/tmp/net.$netif.up + ;; ++ ++ RENEW6|REBIND6) ++ unset lease_time ++ [ -n "$new_dhcp_lease_time" ] && lease_time=$new_dhcp_lease_time ++ [ -n "$new_max_life" ] && lease_time=$new_max_life ++ preferred_lft=$lease_time ++ [ -n "$new_preferred_life" ] && preferred_lft=$new_preferred_life ++ ip -6 addr change ${new_ip6_address}/${new_ip6_prefixlen} dev ${interface} scope global \ ++ ${lease_time:+valid_lft $lease_time} ${preferred_lft:+preferred_lft ${preferred_lft}} \ ++ >/dev/null 2>&1 ++ ;; ++ + *) echo "dhcp: $reason";; + esac + diff --git a/0010-network-dhclient-script.sh-make-IPv4-DHCP-lease-time.patch b/0010-network-dhclient-script.sh-make-IPv4-DHCP-lease-time.patch new file mode 100644 index 0000000..9202cb7 --- /dev/null +++ b/0010-network-dhclient-script.sh-make-IPv4-DHCP-lease-time.patch @@ -0,0 +1,29 @@ +From 0f89ec314b062a410199251db0356a55b4773173 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Wed, 1 Jul 2015 14:57:15 +0200 +Subject: [PATCH] network/dhclient-script.sh: make IPv4 DHCP lease time + optionally + +If bootp is used, no lease time is provided in the packet from the bootp +server. +--- + modules.d/40network/dhclient-script.sh | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/modules.d/40network/dhclient-script.sh b/modules.d/40network/dhclient-script.sh +index 320208b..a8b5b89 100755 +--- a/modules.d/40network/dhclient-script.sh ++++ b/modules.d/40network/dhclient-script.sh +@@ -39,9 +39,9 @@ setup_interface() { + fi + fi + +- ip addr add $ip${mask:+/$mask} ${bcast:+broadcast $bcast} \ +- valid_lft ${lease_time} preferred_lft ${lease_time} \ +- dev $netif ++ ip addr add $ip${mask:+/$mask} ${bcast:+broadcast $bcast} dev $netif \ ++ ${lease_time:+valid_lft $lease_time} \ ++ ${preferred_lft:+preferred_lft ${preferred_lft}} + + if [ -n "$gw" ] ; then + if [ "$mask" == "255.255.255.255" ] ; then diff --git a/0011-network-don-t-use-ifup-m.patch b/0011-network-don-t-use-ifup-m.patch new file mode 100644 index 0000000..fcd3832 --- /dev/null +++ b/0011-network-don-t-use-ifup-m.patch @@ -0,0 +1,44 @@ +From 7cca5efdcea4f1431331cf7663fc6fb48a365cdf Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Thu, 2 Jul 2015 11:32:08 +0200 +Subject: [PATCH] network: don't use "ifup -m" + +"ifup -m" was thought to be used by humans in the emergency shell. +Using it programatically shows some other flaw in the execution logic. + +Also, "ifup -m" was configuring the interface multiple times on "add" +and "change" uevent, because the "$netif.did-setup" test was not +executed. +--- + modules.d/40network/ifup.sh | 3 ++- + modules.d/40network/net-genrules.sh | 1 - + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh +index de518b6..0138e01 100755 +--- a/modules.d/40network/ifup.sh ++++ b/modules.d/40network/ifup.sh +@@ -77,9 +77,10 @@ fi + # disable manual ifup while netroot is set for simplifying our logic + # in netroot case we prefer netroot to bringup $netif automaticlly + [ -n "$2" -a "$2" = "-m" ] && [ -z "$netroot" ] && manualup="$2" +-[ -z "$netroot" ] && [ -z "$manualup" ] && exit 0 ++ + if [ -n "$manualup" ]; then + >/tmp/net.$netif.manualup ++ rm -f /tmp/net.${netif}.did-setup + else + [ -e /tmp/net.${netif}.did-setup ] && exit 0 + [ -e /sys/class/net/$netif/address ] && \ +diff --git a/modules.d/40network/net-genrules.sh b/modules.d/40network/net-genrules.sh +index 77e47b5..b1c156c 100755 +--- a/modules.d/40network/net-genrules.sh ++++ b/modules.d/40network/net-genrules.sh +@@ -50,7 +50,6 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.sh + fi + + ifup='/sbin/ifup $env{INTERFACE}' +- [ -z "$netroot" ] && ifup="$ifup -m" + + runcmd="RUN+=\"/sbin/initqueue --name ifup-\$env{INTERFACE} --unique --onetime $ifup\"" + diff --git a/0012-lower-the-log-level-for-dfatal.patch b/0012-lower-the-log-level-for-dfatal.patch new file mode 100644 index 0000000..fcf9a38 --- /dev/null +++ b/0012-lower-the-log-level-for-dfatal.patch @@ -0,0 +1,34 @@ +From 3639fe543c06c79e8c7a4872844c95d7d9b61299 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Mon, 29 Jun 2015 16:14:58 +0200 +Subject: [PATCH] lower the log level for dfatal + +--- + dracut-logger.sh | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/dracut-logger.sh b/dracut-logger.sh +index 41e04f4..2a6019c 100755 +--- a/dracut-logger.sh ++++ b/dracut-logger.sh +@@ -264,9 +264,9 @@ _lvl2syspri() { + # Conversion is done as follows: + # + # +-# FATAL(1) -> LOG_EMERG (0) ++# none -> LOG_EMERG (0) + # none -> LOG_ALERT (1) +-# none -> LOG_CRIT (2) ++# FATAL(1) -> LOG_CRIT (2) + # ERROR(2) -> LOG_ERR (3) + # WARN(3) -> LOG_WARNING (4) + # none -> LOG_NOTICE (5) +@@ -280,7 +280,7 @@ _dlvl2syslvl() { + local lvl + + case "$1" in +- 1) lvl=0;; ++ 1) lvl=2;; + 2) lvl=3;; + 3) lvl=4;; + 4) lvl=6;; diff --git a/0013-dracut.sh-add-devices-with-x-initrd.mount-in-etc-fst.patch b/0013-dracut.sh-add-devices-with-x-initrd.mount-in-etc-fst.patch new file mode 100644 index 0000000..4249450 --- /dev/null +++ b/0013-dracut.sh-add-devices-with-x-initrd.mount-in-etc-fst.patch @@ -0,0 +1,36 @@ +From 916559e073a49eedbc7b0c58b399d303fb8c2a05 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Thu, 2 Jul 2015 14:55:31 +0200 +Subject: [PATCH] dracut.sh: add devices with x-initrd.mount in /etc/fstab to + host_devs + +otherwise dracut might not even be able to mount those. +--- + dracut.sh | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/dracut.sh b/dracut.sh +index 4f72b54..52383c0 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -1231,6 +1231,20 @@ if [[ $hostonly ]]; then + done < /etc/fstab + done < /proc/swaps + fi ++ ++ # collect all "x-initrd.mount" entries from /etc/fstab ++ if [[ -f /etc/fstab ]]; then ++ while read _d _m _t _o _r || [ -n "$_d" ]; do ++ [[ "$_d" == \#* ]] && continue ++ [[ $_d ]] || continue ++ [[ "$_o" != *x-initrd.mount* ]] && continue ++ _dev=$(expand_persistent_dev "$_d") ++ _dev="$(readlink -f "$_dev")" ++ [[ -b $_dev ]] && push_host_devs "$_dev" ++ done < /etc/fstab ++ fi ++ ++ + # record all host modaliases + declare -A host_modalias + find /sys/devices/ -name uevent -print > "$initdir/.modalias" diff --git a/0014-dracut-lib.sh-info-output-info-to-stderr.patch b/0014-dracut-lib.sh-info-output-info-to-stderr.patch new file mode 100644 index 0000000..1fde485 --- /dev/null +++ b/0014-dracut-lib.sh-info-output-info-to-stderr.patch @@ -0,0 +1,32 @@ +From 57fb6e67de0cc58b9d188439b0ceb0d0d5dbbd6f Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Thu, 2 Jul 2015 15:02:31 +0200 +Subject: [PATCH] dracut-lib.sh:info() output info to stderr + +otherwise it might collide with stdout redirection +--- + modules.d/99base/dracut-lib.sh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh +index 08110cc..cd1f49f 100755 +--- a/modules.d/99base/dracut-lib.sh ++++ b/modules.d/99base/dracut-lib.sh +@@ -63,7 +63,7 @@ if [ -z "$DRACUT_SYSTEMD" ]; then + check_quiet + echo "<30>dracut: $*" > /dev/kmsg + [ "$DRACUT_QUIET" != "yes" ] && \ +- echo "dracut: $*" ++ echo "dracut: $*" >&2 + } + + else +@@ -73,7 +73,7 @@ else + } + + info() { +- echo "$*" ++ echo "$*" >&2 + } + + fi diff --git a/0015-nfs-nfs-lib.sh-add-anaconda_nfsv6_to_var.patch b/0015-nfs-nfs-lib.sh-add-anaconda_nfsv6_to_var.patch new file mode 100644 index 0000000..a7a1bde --- /dev/null +++ b/0015-nfs-nfs-lib.sh-add-anaconda_nfsv6_to_var.patch @@ -0,0 +1,48 @@ +From ba665de454e7d6ef1da4ba95308fb9f65c7a9497 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Thu, 2 Jul 2015 15:21:35 +0200 +Subject: [PATCH] nfs/nfs-lib.sh: add anaconda_nfsv6_to_var() + +add "nfs:[[2001:0db8:85a3:08d3:1319:8a2e:0370:7344]]/path" style parsing + +https://bugzilla.redhat.com/show_bug.cgi?id=1190098 +--- + modules.d/95nfs/nfs-lib.sh | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +diff --git a/modules.d/95nfs/nfs-lib.sh b/modules.d/95nfs/nfs-lib.sh +index 77c03d9..58aa7e3 100755 +--- a/modules.d/95nfs/nfs-lib.sh ++++ b/modules.d/95nfs/nfs-lib.sh +@@ -15,6 +15,7 @@ nfs_to_var() { + # FIXME: local netif=${2:-$netif}? + case "$1" in + nfs://*) rfc2224_nfs_to_var "$1" ;; ++ nfs:*[*) anaconda_nfsv6_to_var "$1" ;; + nfs:*:*:/*) anaconda_nfs_to_var "$1" ;; + *) nfsroot_to_var "$1" ;; + esac +@@ -84,6 +85,23 @@ anaconda_nfs_to_var() { + path="/${1##*:/}" + } + ++# IPv6 nfs path will be treated separately ++anaconda_nfsv6_to_var() { ++ nfs="nfs" ++ path="$1:" ++ options="${path#*:/}" ++ path="/${options%%:*}" ++ server="${1#*nfs:}" ++ if str_starts $server '['; then ++ server="${server%:/*}" ++ options="${options#*:*}" ++ else ++ server="${server%:/*}" ++ options="${server%%:*}" ++ server="${server#*:}" ++ fi ++} ++ + # nfsroot_from_dhcp NETIF + # fill in missing server/path from DHCP options. + nfsroot_from_dhcp() { diff --git a/0016-splitup-dracut-init.sh-from-dracut-functions.sh.patch b/0016-splitup-dracut-init.sh-from-dracut-functions.sh.patch new file mode 100644 index 0000000..a3baaf3 --- /dev/null +++ b/0016-splitup-dracut-init.sh-from-dracut-functions.sh.patch @@ -0,0 +1,645 @@ +From 777f2db0373ccbc1a44fc2d960ecefbe50195055 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Thu, 2 Jul 2015 15:40:13 +0200 +Subject: [PATCH] splitup dracut-init.sh from dracut-functions.sh + +other tools want to source dracut-functions.sh without any mkdir side +effects. +--- + Makefile | 1 + + dracut-functions.sh | 9 ++------- + dracut-init.sh | 34 ++++++++++++++++++++++++++++++++++ + dracut.sh | 8 ++++---- + test/TEST-01-BASIC/test.sh | 6 +++--- + test/TEST-02-SYSTEMD/test.sh | 6 +++--- + test/TEST-03-USR-MOUNT/test.sh | 6 +++--- + test/TEST-04-FULL-SYSTEMD/test.sh | 6 +++--- + test/TEST-10-RAID/test.sh | 6 +++--- + test/TEST-11-LVM/test.sh | 6 +++--- + test/TEST-12-RAID-DEG/test.sh | 6 +++--- + test/TEST-13-ENC-RAID-LVM/test.sh | 6 +++--- + test/TEST-14-IMSM/test.sh | 6 +++--- + test/TEST-15-BTRFSRAID/test.sh | 6 +++--- + test/TEST-16-DMSQUASH/test.sh | 4 ++-- + test/TEST-17-LVM-THIN/test.sh | 6 +++--- + test/TEST-20-NFS/test.sh | 6 +++--- + test/TEST-30-ISCSI/test.sh | 8 ++++---- + test/TEST-40-NBD/test.sh | 10 +++++----- + test/TEST-50-MULTINIC/test.sh | 6 +++--- + 20 files changed, 91 insertions(+), 61 deletions(-) + create mode 100644 dracut-init.sh + +diff --git a/Makefile b/Makefile +index 0af5d0f..98a2fbf 100644 +--- a/Makefile ++++ b/Makefile +@@ -118,6 +118,7 @@ install: all + install -m 0644 dracut.conf $(DESTDIR)$(sysconfdir)/dracut.conf + mkdir -p $(DESTDIR)$(sysconfdir)/dracut.conf.d + mkdir -p $(DESTDIR)$(pkglibdir)/dracut.conf.d ++ install -m 0755 dracut-init.sh $(DESTDIR)$(pkglibdir)/dracut-init.sh + install -m 0755 dracut-functions.sh $(DESTDIR)$(pkglibdir)/dracut-functions.sh + install -m 0755 dracut-version.sh $(DESTDIR)$(pkglibdir)/dracut-version.sh + ln -fs dracut-functions.sh $(DESTDIR)$(pkglibdir)/dracut-functions +diff --git a/dracut-functions.sh b/dracut-functions.sh +index 8f971c0..f415f0d 100755 +--- a/dracut-functions.sh ++++ b/dracut-functions.sh +@@ -20,14 +20,9 @@ + export LC_MESSAGES=C + + if [[ $DRACUT_KERNEL_LAZY ]] && ! [[ $DRACUT_KERNEL_LAZY_HASHDIR ]]; then +- if ! [[ -d "$initdir/.kernelmodseen" ]]; then +- mkdir -p "$initdir/.kernelmodseen" ++ if [[ -d "$initdir/.kernelmodseen" ]]; then ++ DRACUT_KERNEL_LAZY_HASHDIR="$initdir/.kernelmodseen" + fi +- DRACUT_KERNEL_LAZY_HASHDIR="$initdir/.kernelmodseen" +-fi +- +-if [[ $initdir ]] && ! [[ -d $initdir ]]; then +- mkdir -p "$initdir" + fi + + # Generic substring function. If $2 is in $1, return 0. +diff --git a/dracut-init.sh b/dracut-init.sh +new file mode 100644 +index 0000000..469e42a +--- /dev/null ++++ b/dracut-init.sh +@@ -0,0 +1,34 @@ ++#!/bin/bash ++# ++# functions used by dracut and other tools. ++# ++# Copyright 2005-2009 Red Hat, Inc. All rights reserved. ++# ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++# ++export LC_MESSAGES=C ++ ++if [[ $DRACUT_KERNEL_LAZY ]] && ! [[ $DRACUT_KERNEL_LAZY_HASHDIR ]]; then ++ if ! [[ -d "$initdir/.kernelmodseen" ]]; then ++ mkdir -p "$initdir/.kernelmodseen" ++ fi ++ DRACUT_KERNEL_LAZY_HASHDIR="$initdir/.kernelmodseen" ++fi ++ ++if [[ $initdir ]] && ! [[ -d $initdir ]]; then ++ mkdir -p "$initdir" ++fi ++ ++[[ $dracutbasedir ]] || export dracutbasedir=${BASH_SOURCE%/*} ++. $dracutbasedir/dracut-functions.sh +diff --git a/dracut.sh b/dracut.sh +index 52383c0..8394cee 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -551,7 +551,7 @@ while :; do + -q|--quiet) ((verbosity_mod_l--));; + -l|--local) + allowlocal="yes" +- [[ -f "$(readlink -f "${0%/*}")/dracut-functions.sh" ]] \ ++ [[ -f "$(readlink -f "${0%/*}")/dracut-init.sh" ]] \ + && dracutbasedir="$(readlink -f "${0%/*}")" + ;; + -H|--hostonly|--host-only) +@@ -917,10 +917,10 @@ if [[ -f $dracutbasedir/dracut-version.sh ]]; then + . $dracutbasedir/dracut-version.sh + fi + +-if [[ -f $dracutbasedir/dracut-functions.sh ]]; then +- . $dracutbasedir/dracut-functions.sh ++if [[ -f $dracutbasedir/dracut-init.sh ]]; then ++ . $dracutbasedir/dracut-init.sh + else +- printf "%s\n" "dracut: Cannot find $dracutbasedir/dracut-functions.sh." >&2 ++ printf "%s\n" "dracut: Cannot find $dracutbasedir/dracut-init.sh." >&2 + printf "%s\n" "dracut: Are you running from a git checkout?" >&2 + printf "%s\n" "dracut: Try passing -l as an argument to $0" >&2 + exit 1 +diff --git a/test/TEST-01-BASIC/test.sh b/test/TEST-01-BASIC/test.sh +index 4897cc9..83320e2 100755 +--- a/test/TEST-01-BASIC/test.sh ++++ b/test/TEST-01-BASIC/test.sh +@@ -29,7 +29,7 @@ test_setup() { + ( + export initdir=$TESTDIR/overlay/source + mkdir -p $initdir +- . $basedir/dracut-functions.sh ++ . $basedir/dracut-init.sh + ( + cd "$initdir" + mkdir -p -- dev sys proc etc var/run tmp +@@ -58,7 +58,7 @@ test_setup() { + # second, install the files needed to make the root filesystem + ( + export initdir=$TESTDIR/overlay +- . $basedir/dracut-functions.sh ++ . $basedir/dracut-init.sh + inst_multiple sfdisk mkfs.ext3 poweroff cp umount sync + inst_hook initqueue 01 ./create-root.sh + inst_hook initqueue/finished 01 ./finished-false.sh +@@ -87,7 +87,7 @@ test_setup() { + + ( + export initdir=$TESTDIR/overlay +- . $basedir/dracut-functions.sh ++ . $basedir/dracut-init.sh + inst_multiple poweroff shutdown + inst_hook emergency 000 ./hard-off.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules +diff --git a/test/TEST-02-SYSTEMD/test.sh b/test/TEST-02-SYSTEMD/test.sh +index 3cc5d0a..16f5c26 100755 +--- a/test/TEST-02-SYSTEMD/test.sh ++++ b/test/TEST-02-SYSTEMD/test.sh +@@ -25,7 +25,7 @@ test_setup() { + ( + export initdir=$TESTDIR/overlay/source + mkdir -p $initdir +- . $basedir/dracut-functions.sh ++ . $basedir/dracut-init.sh + ( + cd "$initdir" + mkdir -p -- dev sys proc etc var/run tmp +@@ -55,7 +55,7 @@ test_setup() { + # second, install the files needed to make the root filesystem + ( + export initdir=$TESTDIR/overlay +- . $basedir/dracut-functions.sh ++ . $basedir/dracut-init.sh + inst_multiple sfdisk mkfs.ext3 poweroff cp umount + inst_hook initqueue 01 ./create-root.sh + inst_hook initqueue/finished 01 ./finished-false.sh +@@ -84,7 +84,7 @@ test_setup() { + + ( + export initdir=$TESTDIR/overlay +- . $basedir/dracut-functions.sh ++ . $basedir/dracut-init.sh + inst_multiple poweroff shutdown + inst_hook emergency 000 ./hard-off.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules +diff --git a/test/TEST-03-USR-MOUNT/test.sh b/test/TEST-03-USR-MOUNT/test.sh +index cccec31..61063fd 100755 +--- a/test/TEST-03-USR-MOUNT/test.sh ++++ b/test/TEST-03-USR-MOUNT/test.sh +@@ -56,7 +56,7 @@ test_setup() { + ( + export initdir=$TESTDIR/overlay/source + mkdir -p $initdir +- . $basedir/dracut-functions.sh ++ . $basedir/dracut-init.sh + ( + cd "$initdir" + mkdir -p -- dev sys proc etc var/run tmp +@@ -86,7 +86,7 @@ test_setup() { + # second, install the files needed to make the root filesystem + ( + export initdir=$TESTDIR/overlay +- . $basedir/dracut-functions.sh ++ . $basedir/dracut-init.sh + inst_multiple sfdisk mkfs.btrfs btrfs poweroff cp umount sync + inst_hook initqueue 01 ./create-root.sh + inst_hook initqueue/finished 01 ./finished-false.sh +@@ -122,7 +122,7 @@ test_setup() { + + ( + export initdir=$TESTDIR/overlay +- . $basedir/dracut-functions.sh ++ . $basedir/dracut-init.sh + inst_multiple poweroff shutdown + inst_hook emergency 000 ./hard-off.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules +diff --git a/test/TEST-04-FULL-SYSTEMD/test.sh b/test/TEST-04-FULL-SYSTEMD/test.sh +index 6e05f0d..1c12e4f 100755 +--- a/test/TEST-04-FULL-SYSTEMD/test.sh ++++ b/test/TEST-04-FULL-SYSTEMD/test.sh +@@ -57,7 +57,7 @@ test_setup() { + ( + export initdir=$TESTDIR/overlay/source + mkdir -p $initdir +- . $basedir/dracut-functions.sh ++ . $basedir/dracut-init.sh + + for d in usr/bin usr/sbin bin etc lib "$libdir" sbin tmp usr var var/log dev proc sys sysroot root run; do + if [ -L "/$d" ]; then +@@ -222,7 +222,7 @@ EOF + # second, install the files needed to make the root filesystem + ( + export initdir=$TESTDIR/overlay +- . $basedir/dracut-functions.sh ++ . $basedir/dracut-init.sh + inst_multiple sfdisk mkfs.btrfs btrfs poweroff cp umount sync + inst_hook initqueue 01 ./create-root.sh + inst_hook initqueue/finished 01 ./finished-false.sh +@@ -254,7 +254,7 @@ EOF + + ( + export initdir=$TESTDIR/overlay +- . $basedir/dracut-functions.sh ++ . $basedir/dracut-init.sh + inst_multiple poweroff shutdown + 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/test.sh b/test/TEST-10-RAID/test.sh +index e7a1131..523b61a 100755 +--- a/test/TEST-10-RAID/test.sh ++++ b/test/TEST-10-RAID/test.sh +@@ -27,7 +27,7 @@ test_setup() { + # Create what will eventually be our root filesystem onto an overlay + ( + export initdir=$TESTDIR/overlay/source +- . $basedir/dracut-functions.sh ++ . $basedir/dracut-init.sh + ( + cd "$initdir" + mkdir -p -- dev sys proc etc var/run tmp +@@ -56,7 +56,7 @@ test_setup() { + # second, install the files needed to make the root filesystem + ( + export initdir=$TESTDIR/overlay +- . $basedir/dracut-functions.sh ++ . $basedir/dracut-init.sh + inst_multiple sfdisk mke2fs poweroff cp umount + inst_hook initqueue 01 ./create-root.sh + inst_hook initqueue/finished 01 ./finished-false.sh +@@ -84,7 +84,7 @@ test_setup() { + + ( + export initdir=$TESTDIR/overlay +- . $basedir/dracut-functions.sh ++ . $basedir/dracut-init.sh + inst_multiple poweroff shutdown + inst_hook emergency 000 ./hard-off.sh + inst ./cryptroot-ask.sh /sbin/cryptroot-ask +diff --git a/test/TEST-11-LVM/test.sh b/test/TEST-11-LVM/test.sh +index 0002455..34c7736 100755 +--- a/test/TEST-11-LVM/test.sh ++++ b/test/TEST-11-LVM/test.sh +@@ -24,7 +24,7 @@ test_setup() { + # Create what will eventually be our root filesystem onto an overlay + ( + export initdir=$TESTDIR/overlay/source +- . $basedir/dracut-functions.sh ++ . $basedir/dracut-init.sh + ( + cd "$initdir" + mkdir -p -- dev sys proc etc var/run tmp +@@ -54,7 +54,7 @@ test_setup() { + # second, install the files needed to make the root filesystem + ( + export initdir=$TESTDIR/overlay +- . $basedir/dracut-functions.sh ++ . $basedir/dracut-init.sh + inst_multiple sfdisk mke2fs poweroff cp umount + inst_hook initqueue 01 ./create-root.sh + inst_hook initqueue/finished 01 ./finished-false.sh +@@ -77,7 +77,7 @@ test_setup() { + grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.ext2 || return 1 + ( + export initdir=$TESTDIR/overlay +- . $basedir/dracut-functions.sh ++ . $basedir/dracut-init.sh + inst_multiple poweroff shutdown + inst_hook emergency 000 ./hard-off.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules +diff --git a/test/TEST-12-RAID-DEG/test.sh b/test/TEST-12-RAID-DEG/test.sh +index 6c7b8b3..f4ec2d0 100755 +--- a/test/TEST-12-RAID-DEG/test.sh ++++ b/test/TEST-12-RAID-DEG/test.sh +@@ -66,7 +66,7 @@ test_setup() { + # Create what will eventually be our root filesystem onto an overlay + ( + export initdir=$TESTDIR/overlay/source +- . $basedir/dracut-functions.sh ++ . $basedir/dracut-init.sh + ( + cd "$initdir" + mkdir -p -- dev sys proc etc var/run tmp +@@ -94,7 +94,7 @@ test_setup() { + # second, install the files needed to make the root filesystem + ( + export initdir=$TESTDIR/overlay +- . $basedir/dracut-functions.sh ++ . $basedir/dracut-init.sh + inst_multiple sfdisk mke2fs poweroff cp umount dd grep + inst_hook initqueue 01 ./create-root.sh + inst_hook initqueue/finished 01 ./finished-false.sh +@@ -127,7 +127,7 @@ test_setup() { + + ( + export initdir=$TESTDIR/overlay +- . $basedir/dracut-functions.sh ++ . $basedir/dracut-init.sh + inst_multiple poweroff shutdown + inst_hook emergency 000 ./hard-off.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules +diff --git a/test/TEST-13-ENC-RAID-LVM/test.sh b/test/TEST-13-ENC-RAID-LVM/test.sh +index 14d8196..ea81697 100755 +--- a/test/TEST-13-ENC-RAID-LVM/test.sh ++++ b/test/TEST-13-ENC-RAID-LVM/test.sh +@@ -62,7 +62,7 @@ test_setup() { + # Create what will eventually be our root filesystem onto an overlay + ( + export initdir=$TESTDIR/overlay/source +- . $basedir/dracut-functions.sh ++ . $basedir/dracut-init.sh + ( + cd "$initdir" + mkdir -p -- dev sys proc etc var/run tmp +@@ -91,7 +91,7 @@ test_setup() { + # second, install the files needed to make the root filesystem + ( + export initdir=$TESTDIR/overlay +- . $basedir/dracut-functions.sh ++ . $basedir/dracut-init.sh + inst_multiple sfdisk mke2fs poweroff cp umount grep + inst_hook initqueue 01 ./create-root.sh + inst_hook initqueue/finished 01 ./finished-false.sh +@@ -121,7 +121,7 @@ test_setup() { + + ( + export initdir=$TESTDIR/overlay +- . $basedir/dracut-functions.sh ++ . $basedir/dracut-init.sh + inst_multiple poweroff shutdown + inst_hook emergency 000 ./hard-off.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules +diff --git a/test/TEST-14-IMSM/test.sh b/test/TEST-14-IMSM/test.sh +index 291f3c5..a05d091 100755 +--- a/test/TEST-14-IMSM/test.sh ++++ b/test/TEST-14-IMSM/test.sh +@@ -54,7 +54,7 @@ test_setup() { + # Create what will eventually be our root filesystem onto an overlay + ( + export initdir=$TESTDIR/overlay/source +- . $basedir/dracut-functions.sh ++ . $basedir/dracut-init.sh + ( + cd "$initdir" + mkdir -p -- dev sys proc etc var/run tmp +@@ -83,7 +83,7 @@ test_setup() { + # second, install the files needed to make the root filesystem + ( + export initdir=$TESTDIR/overlay +- . $basedir/dracut-functions.sh ++ . $basedir/dracut-init.sh + inst_multiple sfdisk mke2fs poweroff cp umount grep + inst_hook initqueue 01 ./create-root.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules +@@ -111,7 +111,7 @@ test_setup() { + echo $MD_UUID > $TESTDIR/mduuid + ( + export initdir=$TESTDIR/overlay +- . $basedir/dracut-functions.sh ++ . $basedir/dracut-init.sh + inst_multiple poweroff shutdown + inst_hook emergency 000 ./hard-off.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules +diff --git a/test/TEST-15-BTRFSRAID/test.sh b/test/TEST-15-BTRFSRAID/test.sh +index 7f99d8b..5a9b6e1 100755 +--- a/test/TEST-15-BTRFSRAID/test.sh ++++ b/test/TEST-15-BTRFSRAID/test.sh +@@ -26,7 +26,7 @@ test_setup() { + # Create what will eventually be our root filesystem onto an overlay + ( + export initdir=$TESTDIR/overlay/source +- . $basedir/dracut-functions.sh ++ . $basedir/dracut-init.sh + ( + cd "$initdir" + mkdir -p -- dev sys proc etc var/run tmp +@@ -55,7 +55,7 @@ test_setup() { + # second, install the files needed to make the root filesystem + ( + export initdir=$TESTDIR/overlay +- . $basedir/dracut-functions.sh ++ . $basedir/dracut-init.sh + inst_multiple sfdisk mkfs.btrfs poweroff cp umount + inst_hook initqueue 01 ./create-root.sh + inst_hook initqueue/finished 01 ./finished-false.sh +@@ -85,7 +85,7 @@ test_setup() { + + ( + export initdir=$TESTDIR/overlay +- . $basedir/dracut-functions.sh ++ . $basedir/dracut-init.sh + inst_multiple poweroff shutdown + inst_hook emergency 000 ./hard-off.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules +diff --git a/test/TEST-16-DMSQUASH/test.sh b/test/TEST-16-DMSQUASH/test.sh +index 338f7f4..7e5a7de 100755 +--- a/test/TEST-16-DMSQUASH/test.sh ++++ b/test/TEST-16-DMSQUASH/test.sh +@@ -30,7 +30,7 @@ test_setup() { + mkdir -p -- "$TESTDIR"/overlay + ( + export initdir="$TESTDIR"/overlay +- . "$basedir"/dracut-functions.sh ++ . "$basedir"/dracut-init.sh + inst_multiple poweroff shutdown + inst_hook emergency 000 ./hard-off.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules +@@ -49,7 +49,7 @@ test_setup() { + # Create what will eventually be our root filesystem onto an overlay + ( + export initdir="$TESTDIR"/root-source +- . "$basedir"/dracut-functions.sh ++ . "$basedir"/dracut-init.sh + ( + cd "$initdir" + mkdir -p -- dev sys proc etc var/run tmp +diff --git a/test/TEST-17-LVM-THIN/test.sh b/test/TEST-17-LVM-THIN/test.sh +index 811a66c..859d4dc 100755 +--- a/test/TEST-17-LVM-THIN/test.sh ++++ b/test/TEST-17-LVM-THIN/test.sh +@@ -24,7 +24,7 @@ test_setup() { + # Create what will eventually be our root filesystem onto an overlay + ( + export initdir=$TESTDIR/overlay/source +- . $basedir/dracut-functions.sh ++ . $basedir/dracut-init.sh + ( + cd "$initdir" + mkdir -p -- dev sys proc etc var/run tmp +@@ -54,7 +54,7 @@ test_setup() { + # second, install the files needed to make the root filesystem + ( + export initdir=$TESTDIR/overlay +- . $basedir/dracut-functions.sh ++ . $basedir/dracut-init.sh + inst_multiple sfdisk mke2fs poweroff cp umount + inst_hook initqueue 01 ./create-root.sh + inst_hook initqueue/finished 01 ./finished-false.sh +@@ -77,7 +77,7 @@ test_setup() { + grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.ext2 || return 1 + ( + export initdir=$TESTDIR/overlay +- . $basedir/dracut-functions.sh ++ . $basedir/dracut-init.sh + inst_multiple poweroff shutdown + inst_hook emergency 000 ./hard-off.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules +diff --git a/test/TEST-20-NFS/test.sh b/test/TEST-20-NFS/test.sh +index 04616ef..61e4c1a 100755 +--- a/test/TEST-20-NFS/test.sh ++++ b/test/TEST-20-NFS/test.sh +@@ -217,7 +217,7 @@ test_setup() { + + ( + export initdir=$TESTDIR/mnt +- . $basedir/dracut-functions.sh ++ . $basedir/dracut-init.sh + + for _f in modules.builtin.bin modules.builtin; do + [[ $srcmods/$_f ]] && break +@@ -283,7 +283,7 @@ test_setup() { + # Make client root inside server root + ( + export initdir=$TESTDIR/mnt/nfs/client +- . $basedir/dracut-functions.sh ++ . $basedir/dracut-init.sh + + inst_multiple sh shutdown poweroff stty cat ps ln ip \ + mount dmesg mkdir cp ping grep setsid ls vi /etc/virc less cat +@@ -331,7 +331,7 @@ test_setup() { + # Make an overlay with needed tools for the test harness + ( + export initdir=$TESTDIR/overlay +- . $basedir/dracut-functions.sh ++ . $basedir/dracut-init.sh + mkdir $TESTDIR/overlay + inst_multiple poweroff shutdown + inst_hook emergency 000 ./hard-off.sh +diff --git a/test/TEST-30-ISCSI/test.sh b/test/TEST-30-ISCSI/test.sh +index 2c082fe..59e9c5b 100755 +--- a/test/TEST-30-ISCSI/test.sh ++++ b/test/TEST-30-ISCSI/test.sh +@@ -103,7 +103,7 @@ test_setup() { + # Create what will eventually be our root filesystem onto an overlay + ( + export initdir=$TESTDIR/overlay/source +- . $basedir/dracut-functions.sh ++ . $basedir/dracut-init.sh + ( + cd "$initdir" + mkdir -p -- dev sys proc etc var/run tmp +@@ -128,7 +128,7 @@ test_setup() { + # second, install the files needed to make the root filesystem + ( + export initdir=$TESTDIR/overlay +- . $basedir/dracut-functions.sh ++ . $basedir/dracut-init.sh + inst_multiple sfdisk mkfs.ext3 poweroff cp umount setsid + inst_hook initqueue 01 ./create-root.sh + inst_hook initqueue/finished 01 ./finished-false.sh +@@ -164,7 +164,7 @@ test_setup() { + rm -- $TESTDIR/client.img + ( + export initdir=$TESTDIR/overlay +- . $basedir/dracut-functions.sh ++ . $basedir/dracut-init.sh + inst_multiple poweroff shutdown + inst_hook emergency 000 ./hard-off.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules +@@ -185,7 +185,7 @@ test_setup() { + kernel=$KVERSION + ( + export initdir=$TESTDIR/mnt +- . $basedir/dracut-functions.sh ++ . $basedir/dracut-init.sh + ( + cd "$initdir"; + mkdir -p dev sys proc etc var/run tmp var/lib/dhcpd /etc/iscsi +diff --git a/test/TEST-40-NBD/test.sh b/test/TEST-40-NBD/test.sh +index aa4b46b..39966ac 100755 +--- a/test/TEST-40-NBD/test.sh ++++ b/test/TEST-40-NBD/test.sh +@@ -192,7 +192,7 @@ make_encrypted_root() { + # Create what will eventually be our root filesystem onto an overlay + ( + export initdir=$TESTDIR/overlay/source +- . $basedir/dracut-functions.sh ++ . $basedir/dracut-init.sh + mkdir -p "$initdir" + ( + cd "$initdir"; mkdir -p dev sys proc etc var/run tmp +@@ -217,7 +217,7 @@ make_encrypted_root() { + # second, install the files needed to make the root filesystem + ( + export initdir=$TESTDIR/overlay +- . $basedir/dracut-functions.sh ++ . $basedir/dracut-init.sh + ( + cd "$initdir"; mkdir -p dev sys proc etc var/run tmp + mkdir -p root usr/bin usr/lib usr/lib64 usr/sbin +@@ -263,7 +263,7 @@ make_client_root() { + kernel=$KVERSION + ( + export initdir=$TESTDIR/mnt +- . $basedir/dracut-functions.sh ++ . $basedir/dracut-init.sh + mkdir -p "$initdir" + ( + cd "$initdir"; mkdir -p dev sys proc etc var/run tmp +@@ -304,7 +304,7 @@ make_server_root() { + kernel=$KVERSION + ( + export initdir=$TESTDIR/mnt +- . $basedir/dracut-functions.sh ++ . $basedir/dracut-init.sh + mkdir -p "$initdir" + ( + cd "$initdir"; +@@ -351,7 +351,7 @@ test_setup() { + # Make the test image + ( + export initdir=$TESTDIR/overlay +- . $basedir/dracut-functions.sh ++ . $basedir/dracut-init.sh + inst_multiple poweroff shutdown + inst_hook emergency 000 ./hard-off.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules +diff --git a/test/TEST-50-MULTINIC/test.sh b/test/TEST-50-MULTINIC/test.sh +index b292cc0..b878380 100755 +--- a/test/TEST-50-MULTINIC/test.sh ++++ b/test/TEST-50-MULTINIC/test.sh +@@ -146,7 +146,7 @@ test_setup() { + + ( + export initdir="$TESTDIR"/mnt +- . "$basedir"/dracut-functions.sh ++ . "$basedir"/dracut-init.sh + + ( + cd "$initdir"; +@@ -212,7 +212,7 @@ test_setup() { + # Make client root inside server root + ( + export initdir="$TESTDIR"/mnt/nfs/client +- . "$basedir"/dracut-functions.sh ++ . "$basedir"/dracut-init.sh + ( + cd "$initdir" + mkdir -p dev sys proc etc run +@@ -256,7 +256,7 @@ test_setup() { + # Make an overlay with needed tools for the test harness + ( + export initdir="$TESTDIR"/overlay +- . "$basedir"/dracut-functions.sh ++ . "$basedir"/dracut-init.sh + inst_multiple poweroff shutdown + inst_hook emergency 000 ./hard-off.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules diff --git a/0017-network-dhclient-script.sh-fixup-lease-time.patch b/0017-network-dhclient-script.sh-fixup-lease-time.patch new file mode 100644 index 0000000..204f8fe --- /dev/null +++ b/0017-network-dhclient-script.sh-fixup-lease-time.patch @@ -0,0 +1,25 @@ +From 8d09f493a634f0c6c44e99fb22618b75cbb41f0f Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Thu, 2 Jul 2015 19:48:25 +0200 +Subject: [PATCH] network/dhclient-script.sh: fixup lease time + +--- + modules.d/40network/dhclient-script.sh | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/modules.d/40network/dhclient-script.sh b/modules.d/40network/dhclient-script.sh +index a8b5b89..2550caf 100755 +--- a/modules.d/40network/dhclient-script.sh ++++ b/modules.d/40network/dhclient-script.sh +@@ -21,7 +21,10 @@ setup_interface() { + search=$(printf -- "$new_domain_search") + namesrv=$new_domain_name_servers + hostname=$new_host_name +- lease_time=$new_dhcp_lease_time ++ [ -n "$new_dhcp_lease_time" ] && lease_time=$new_dhcp_lease_time ++ [ -n "$new_max_life" ] && lease_time=$new_max_life ++ preferred_lft=$lease_time ++ [ -n "$new_preferred_life" ] && preferred_lft=$new_preferred_life + + [ -f /tmp/net.$netif.override ] && . /tmp/net.$netif.override + diff --git a/0018-90multipath-add-hostonly-multipath.conf-in-case-host.patch b/0018-90multipath-add-hostonly-multipath.conf-in-case-host.patch new file mode 100644 index 0000000..25a94b2 --- /dev/null +++ b/0018-90multipath-add-hostonly-multipath.conf-in-case-host.patch @@ -0,0 +1,90 @@ +From 77403e0032c0ca8bcd4c3951e3ead3bd8c23f8e6 Mon Sep 17 00:00:00 2001 +From: Dave Young +Date: Mon, 6 Jul 2015 15:31:26 +0800 +Subject: [PATCH] 90multipath: add hostonly multipath.conf in case hostonly + mode + +For large machine, suppose there's a lot of multipath devices, multipath layer +will use a lot of memory. For kdump kernel memory is very limited thus it causes +oom. To avoid oom, we only add necessary multipath devices in kdump kernel +multipath.conf. + +This is done by use mpathconf --allow, a new option which is like whitelist. + +Signed-off-by: Dave Young +--- + modules.d/90multipath/module-setup.sh | 42 ++++++++++++++++++++++++++++------- + 1 file changed, 34 insertions(+), 8 deletions(-) + +diff --git a/modules.d/90multipath/module-setup.sh b/modules.d/90multipath/module-setup.sh +index 29643d4..321f13e 100755 +--- a/modules.d/90multipath/module-setup.sh ++++ b/modules.d/90multipath/module-setup.sh +@@ -1,18 +1,28 @@ + #!/bin/bash + ++is_mpath() { ++ local _dev=$1 ++ [ -e /sys/dev/block/$_dev/dm/uuid ] || return 1 ++ [[ $(cat /sys/dev/block/$_dev/dm/uuid) =~ mpath- ]] && return 0 ++ return 1 ++} ++ ++majmin_to_mpath_dev() { ++ local _dev ++ for i in `ls -1 /dev/mapper/mpath*`; do ++ dev=$(get_maj_min $i) ++ if [ "$dev" = "$1" ]; then ++ echo $i ++ return ++ fi ++ done ++} + # called by dracut + check() { + local _rootdev + # if there's no multipath binary, no go. + require_binaries multipath || return 1 + +- is_mpath() { +- local _dev=$1 +- [ -e /sys/dev/block/$_dev/dm/uuid ] || return 1 +- [[ $(cat /sys/dev/block/$_dev/dm/uuid) =~ mpath- ]] && return 0 +- return 1 +- } +- + [[ $hostonly ]] || [[ $mount_needs ]] && { + for_each_host_dev_and_slaves is_mpath || return 255 + } +@@ -79,7 +89,18 @@ installkernel() { + + # called by dracut + install() { +- local _f ++ local _f _allow ++ add_hostonly_mpath_conf() { ++ is_mpath $1 && { ++ local _dev ++ ++ _dev=$(majmin_to_mpath_dev $1) ++ [ -z "$_dev" ] && return ++ strstr "$_allow" "$_dev" && return ++ _allow="$_allow --allow $_dev" ++ } ++ } ++ + inst_multiple -o \ + dmsetup \ + kpartx \ +@@ -93,6 +114,11 @@ install() { + /etc/multipath.conf \ + /etc/multipath/* + ++ [[ $hostonly ]] && { ++ for_each_host_dev_and_slaves_all add_hostonly_mpath_conf ++ [ -n "$_allow" ] && mpathconf $_allow --outfile ${initdir}/etc/multipath.conf ++ } ++ + inst $(command -v partx) /sbin/partx + + inst_libdir_file "libmultipath*" "multipath/*" diff --git a/0019-dmsquash-live-dmsquash-live-root.sh-fixup-checkisomd.patch b/0019-dmsquash-live-dmsquash-live-root.sh-fixup-checkisomd.patch new file mode 100644 index 0000000..a5aff93 --- /dev/null +++ b/0019-dmsquash-live-dmsquash-live-root.sh-fixup-checkisomd.patch @@ -0,0 +1,24 @@ +From 3d579309cde6c02a85ce7d3c396f61e7f064690b Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Tue, 7 Jul 2015 13:25:56 +0200 +Subject: [PATCH] dmsquash-live/dmsquash-live-root.sh: fixup checkisomd5 for + systemd + +systemd does not like a leading "-" for unit template filenames anymore. +--- + modules.d/90dmsquash-live/dmsquash-live-root.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/90dmsquash-live/dmsquash-live-root.sh b/modules.d/90dmsquash-live/dmsquash-live-root.sh +index a0a9ab9..531617e 100755 +--- a/modules.d/90dmsquash-live/dmsquash-live-root.sh ++++ b/modules.d/90dmsquash-live/dmsquash-live-root.sh +@@ -41,7 +41,7 @@ getarg rd.live.check -d check || check="" + if [ -n "$check" ]; then + type plymouth >/dev/null 2>&1 && plymouth --hide-splash + if [ -n "$DRACUT_SYSTEMD" ]; then +- p=$(str_replace "$livedev" "-" '\x2d') ++ p=$(dev_unit_name "$livedev") + systemctl start checkisomd5@${p}.service + else + checkisomd5 --verbose $livedev diff --git a/0020-skipcpio-skipcpio.c-linux-kernel-only-accepts-070701.patch b/0020-skipcpio-skipcpio.c-linux-kernel-only-accepts-070701.patch new file mode 100644 index 0000000..2e93673 --- /dev/null +++ b/0020-skipcpio-skipcpio.c-linux-kernel-only-accepts-070701.patch @@ -0,0 +1,25 @@ +From 6318baa45f2f09ecd821eddf401270d947664f1d Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Tue, 7 Jul 2015 13:26:38 +0200 +Subject: [PATCH] skipcpio/skipcpio.c: linux kernel only accepts "070701" + signature + +don't bother with other signatures +--- + skipcpio/skipcpio.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/skipcpio/skipcpio.c b/skipcpio/skipcpio.c +index 445d7f6..3069981 100644 +--- a/skipcpio/skipcpio.c ++++ b/skipcpio/skipcpio.c +@@ -60,8 +60,7 @@ int main(int argc, char **argv) + fseek(f, 0, SEEK_SET); + + /* check, if this is a cpio archive */ +- if ((buf[0] == 0x71 && buf[1] == 0xc7) +- || (buf[0] == '0' && buf[1] == '7' && buf[2] == '0' && buf[3] == '7' && buf[4] == '0' && buf[5] == '1')) { ++ if (buf[0] == '0' && buf[1] == '7' && buf[2] == '0' && buf[3] == '7' && buf[4] == '0' && buf[5] == '1') { + long pos = 0; + + /* Search for CPIO_END */ diff --git a/0021-Reset-IFS-variable.patch b/0021-Reset-IFS-variable.patch new file mode 100644 index 0000000..9da21d7 --- /dev/null +++ b/0021-Reset-IFS-variable.patch @@ -0,0 +1,30 @@ +From b8efaa00171135db1e1f09a73a2e0d8098f03867 Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +Date: Fri, 26 Jun 2015 16:55:52 +0200 +Subject: [PATCH] Reset IFS variable + +Setting and unsetting the IFS variable is tricky. To be on the +safe side we should always reset the IFS variable to its original +value after parsing. + +Signed-off-by: Hannes Reinecke +Signed-off-by: Thomas Renninger +--- + modules.d/95fcoe/parse-fcoe.sh | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/modules.d/95fcoe/parse-fcoe.sh b/modules.d/95fcoe/parse-fcoe.sh +index b66fa3e..a214007 100755 +--- a/modules.d/95fcoe/parse-fcoe.sh ++++ b/modules.d/95fcoe/parse-fcoe.sh +@@ -26,8 +26,10 @@ initqueue --onetime modprobe -b -q bnx2fc + udevadm settle --timeout=30 + + parse_fcoe_opts() { ++ local OLDIFS="$IFS" + local IFS=: + set $fcoe ++ IFS="$OLDIFS" + + case $# in + 2) diff --git a/0022-mkinitrd-suse.sh-Bail-out-with-exit-1-if-initrd-cann.patch b/0022-mkinitrd-suse.sh-Bail-out-with-exit-1-if-initrd-cann.patch new file mode 100644 index 0000000..0862a68 --- /dev/null +++ b/0022-mkinitrd-suse.sh-Bail-out-with-exit-1-if-initrd-cann.patch @@ -0,0 +1,66 @@ +From 01e60ca4f63536025d66610679a7a757907e71c8 Mon Sep 17 00:00:00 2001 +From: Thomas Renninger +Date: Fri, 26 Jun 2015 16:55:53 +0200 +Subject: [PATCH] mkinitrd-suse.sh: Bail out with exit 1 if initrd cannot be + generated + +Signed-off-by: Thomas Renninger +--- + mkinitrd-suse.sh | 17 ++++++++++++++++- + 1 file changed, 16 insertions(+), 1 deletion(-) + +diff --git a/mkinitrd-suse.sh b/mkinitrd-suse.sh +index af42cbe..c2b314f 100755 +--- a/mkinitrd-suse.sh ++++ b/mkinitrd-suse.sh +@@ -280,7 +280,8 @@ done + + [[ $targets && $kernels ]] || default_kernel_images + if [[ ! $targets || ! $kernels ]];then +- error "No kernel found in $boot_dir" ++ error "No kernel found in $boot_dir or bad modules dir in /lib/modules" ++ exit 1 + fi + + # We can have several targets/kernels, transform the list to an array +@@ -301,6 +302,8 @@ fi + [[ $domu_module_list ]] || domu_module_list="${DOMU_INITRD_MODULES}" + shopt -s extglob + ++failed="" ++ + for ((i=0 ; $i<${#targets[@]} ; i++)); do + + if [[ $img_vers ]];then +@@ -329,14 +332,18 @@ for ((i=0 ; $i<${#targets[@]} ; i++)); do + # expansion magics + if [ -n "${modules_all}" ];then + $dracut_cmd $dracut_args --force-drivers "${modules_all}" "$target" "$kernel" &>/dev/null ++ [ $? -ne 0 ] && failed="$failed $target" + else + $dracut_cmd $dracut_args "$target" "$kernel" &>/dev/null ++ [ $? -ne 0 ] && failed="$failed $target" + fi + else + if [ -n "${modules_all}" ];then + $dracut_cmd $dracut_args --force-drivers "${modules_all}" "$target" "$kernel" ++ [ $? -ne 0 ] && failed="$failed $target" + else + $dracut_cmd $dracut_args "$target" "$kernel" ++ [ $? -ne 0 ] && failed="$failed $target" + fi + fi + done +@@ -345,4 +352,12 @@ if [ "$skip_update_bootloader" ] ; then + echo 2>&1 "Did not refresh the bootloader. You might need to refresh it manually." + else + update-bootloader --refresh ++ [ $? -ne 0 ] && echo "Updating bootloader failed" && exit 1 ++fi ++ ++if [ "$failed" != "" ]; then ++ echo "Generating $failed targets failed" ++ exit 1 + fi ++ ++exit 0 diff --git a/0023-Use-the-uncompressed-kernel-file-on-arm-and-aarch-to.patch b/0023-Use-the-uncompressed-kernel-file-on-arm-and-aarch-to.patch new file mode 100644 index 0000000..bb63a00 --- /dev/null +++ b/0023-Use-the-uncompressed-kernel-file-on-arm-and-aarch-to.patch @@ -0,0 +1,67 @@ +From 162daf0c978ab67131f18856c816d3dbd5ed819f Mon Sep 17 00:00:00 2001 +From: Thomas Renninger +Date: Fri, 26 Jun 2015 16:55:54 +0200 +Subject: [PATCH] Use the uncompressed kernel file on arm and aarch to detect + kernel version + +This is due to file cannot read out the kernel version on these. + +Many thanks to Alexander Graf finding this in old SUSE mkinitrd code. +Converted by Thomas Renninger. + +Signed-off-by: Thomas Renninger + +https://bugzilla.suse.com/show_bug.cgi?id=908454 +Signed-off-by: Thomas Renninger +--- + mkinitrd-suse.sh | 30 +++++++++++++++++++++++++++++- + 1 file changed, 29 insertions(+), 1 deletion(-) + +diff --git a/mkinitrd-suse.sh b/mkinitrd-suse.sh +index c2b314f..0f2b3c4 100755 +--- a/mkinitrd-suse.sh ++++ b/mkinitrd-suse.sh +@@ -145,6 +145,33 @@ is_xen_kernel() { + return + } + ++# kernel_image_gz_from_image() and kernel_version_from_image() are helpers ++# for arm* kernels which produce zImage files which cannot be read from ++# get_kernel_version -> get rid of this workaround if possible ++kernel_image_gz_from_image() { ++ local arch=$(uname -i) ++ local r=${1}.gz ++ ++ # uImage kernels can't be extracted directly. Use the vmlinux.gz instead ++ r=${r//uImage/vmlinux} ++ ++ # on ARM a zImage can't be extracted directly. Other platforms define it ++ # as a gzipped vmlinux file, but not ARM. So only on ARM, use vmlinux.gz. ++ if [[ $arch =~ arm ]] || [[ $arch =~ aarch ]]; then ++ r=${r//zImage/vmlinux} ++ fi ++ ++ echo $r ++} ++ ++kernel_version_from_image() { ++ local kernel_image="$1" kernel_image_gz=$(kernel_image_gz_from_image "$1") ++ ++ if get_kernel_version "$kernel_image" 2>/dev/null; then ++ return ++ fi ++ get_kernel_version "$kernel_image_gz" 2>/dev/null ++} + + # Taken over from SUSE mkinitrd + default_kernel_images() { +@@ -183,7 +210,8 @@ default_kernel_images() { + + [ -L "$boot_dir/$kernel_image" ] && continue + [ "${kernel_image%%.gz}" != "$kernel_image" ] && continue +- kernel_version=$(/usr/bin/get_kernel_version \ ++ ++ kernel_version=$(kernel_version_from_image \ + $boot_dir/$kernel_image 2> /dev/null) + initrd_image=$(echo $kernel_image | sed -e "s|${regex}|initrd|") + if [ "$kernel_image" != "$initrd_image" -a \ diff --git a/0024-ensure-pre-mount-and-resume-run-before-root-fsck.patch b/0024-ensure-pre-mount-and-resume-run-before-root-fsck.patch new file mode 100644 index 0000000..85d4661 --- /dev/null +++ b/0024-ensure-pre-mount-and-resume-run-before-root-fsck.patch @@ -0,0 +1,48 @@ +From 6c9484f61440b71301f43cfa912fb9f1113352b1 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Fri, 26 Jun 2015 16:55:56 +0200 +Subject: [PATCH] ensure pre-mount (and resume) run before root fsck + +References: +https://bugzilla.suse.com/show_bug.cgi?id=906592 +Signed-off-by: Thomas Renninger +--- + modules.d/98dracut-systemd/rootfs-generator.sh | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +diff --git a/modules.d/98dracut-systemd/rootfs-generator.sh b/modules.d/98dracut-systemd/rootfs-generator.sh +index 670613e..5e79d0b 100755 +--- a/modules.d/98dracut-systemd/rootfs-generator.sh ++++ b/modules.d/98dracut-systemd/rootfs-generator.sh +@@ -65,6 +65,23 @@ generator_mount_rootfs() + fi + } + ++generator_fsck_after_pre_mount() ++{ ++ local _name ++ ++ [ -z "$1" ] && return 0 ++ ++ _name=$(dev_unit_name "$1") ++ [ -d /run/systemd/generator/systemd-fsck@${_name}.service.d ] || mkdir -p /run/systemd/generator/systemd-fsck@${_name}.service.d ++ if ! [ -f /run/systemd/generator/systemd-fsck@${_name}.service.d/after-pre-mount.conf ]; then ++ { ++ echo "[Unit]" ++ echo "After=dracut-pre-mount.service" ++ } > /run/systemd/generator/systemd-fsck@${_name}.service.d/after-pre-mount.conf ++ fi ++ ++} ++ + root=$(getarg root=) + case "$root" in + block:LABEL=*|LABEL=*) +@@ -95,6 +112,7 @@ GENERATOR_DIR="$1" + + if [ "$rootok" = "1" ]; then + generator_wait_for_dev "${root#block:}" "$RDRETRY" ++ generator_fsck_after_pre_mount "${root#block:}" + strstr "$(cat /proc/cmdline)" 'root=' || generator_mount_rootfs "${root#block:}" "$(getarg rootfstype=)" "$(getarg rootflags=)" + fi + diff --git a/0025-dracut-pre-mount.service-should-run-before-systemd-f.patch b/0025-dracut-pre-mount.service-should-run-before-systemd-f.patch new file mode 100644 index 0000000..7482179 --- /dev/null +++ b/0025-dracut-pre-mount.service-should-run-before-systemd-f.patch @@ -0,0 +1,23 @@ +From e860ef0e308364df3070d866950782544eb11950 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Tue, 7 Jul 2015 13:45:19 +0200 +Subject: [PATCH] dracut-pre-mount.service should run before + systemd-fsck-root.service + +--- + modules.d/98dracut-systemd/dracut-pre-mount.service | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/98dracut-systemd/dracut-pre-mount.service b/modules.d/98dracut-systemd/dracut-pre-mount.service +index 96ea995..1e4e29f 100644 +--- a/modules.d/98dracut-systemd/dracut-pre-mount.service ++++ b/modules.d/98dracut-systemd/dracut-pre-mount.service +@@ -11,7 +11,7 @@ + Description=dracut pre-mount hook + Documentation=man:dracut-pre-mount.service(8) + DefaultDependencies=no +-Before=initrd-root-fs.target sysroot.mount ++Before=initrd-root-fs.target sysroot.mount systemd-fsck-root.service + After=dracut-initqueue.service + After=cryptsetup.target + ConditionPathExists=/usr/lib/initrd-release diff --git a/0026-TEST-04-FULL-SYSTEMD-fixup-loadkeys-keymap-loading.patch b/0026-TEST-04-FULL-SYSTEMD-fixup-loadkeys-keymap-loading.patch new file mode 100644 index 0000000..277e31a --- /dev/null +++ b/0026-TEST-04-FULL-SYSTEMD-fixup-loadkeys-keymap-loading.patch @@ -0,0 +1,47 @@ +From 9ee2f1e2358c86dce0da1a65f2352e8e3cba5ea4 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Tue, 7 Jul 2015 14:29:22 +0200 +Subject: [PATCH] TEST-04-FULL-SYSTEMD: fixup loadkeys keymap loading + +--- + test/TEST-04-FULL-SYSTEMD/test.sh | 15 ++++++++++----- + 1 file changed, 10 insertions(+), 5 deletions(-) + +diff --git a/test/TEST-04-FULL-SYSTEMD/test.sh b/test/TEST-04-FULL-SYSTEMD/test.sh +index 1c12e4f..6ea9281 100755 +--- a/test/TEST-04-FULL-SYSTEMD/test.sh ++++ b/test/TEST-04-FULL-SYSTEMD/test.sh +@@ -171,13 +171,18 @@ EOF + inst /usr/lib/systemd/system/dbus.socket + inst /usr/lib/systemd/system/dbus.service + ++ ( ++ echo "FONT=latarcyrheb-sun16" ++ echo "KEYMAP=us" ++ ) >$initrd/etc/vconsole.conf ++ + # install basic keyboard maps and fonts + for i in \ + /usr/lib/kbd/consolefonts/eurlatgr* \ + /usr/lib/kbd/consolefonts/latarcyrheb-sun16* \ +- /usr/lib/kbd/keymaps/include/* \ +- /usr/lib/kbd/keymaps/i386/include/* \ +- /usr/lib/kbd/keymaps/i386/qwerty/us.*; do ++ /usr/lib/kbd/keymaps/{legacy/,/}include/* \ ++ /usr/lib/kbd/keymaps/{legacy/,/}i386/include/* \ ++ /usr/lib/kbd/keymaps/{legacy/,/}i386/qwerty/us.*; do + [[ -f $i ]] || continue + inst $i + done +@@ -260,9 +265,9 @@ EOF + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + ) + sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \ +- -a "debug systemd" \ ++ -a "debug systemd i18n" \ + -I "/etc/machine-id /etc/hostname" \ +- -o "dash network plymouth lvm mdraid resume crypt i18n caps dm terminfo usrmount kernel-network-modules" \ ++ -o "dash network plymouth lvm mdraid resume crypt caps dm terminfo usrmount kernel-network-modules" \ + -d "piix ide-gd_mod ata_piix btrfs sd_mod i6300esb ib700wdt" \ + --no-hostonly-cmdline -N \ + -f $TESTDIR/initramfs.testing $KVERSION || return 1 diff --git a/0027-TEST-14-IMSM-remove-rd.auto.patch b/0027-TEST-14-IMSM-remove-rd.auto.patch new file mode 100644 index 0000000..cd7866d --- /dev/null +++ b/0027-TEST-14-IMSM-remove-rd.auto.patch @@ -0,0 +1,32 @@ +From 3fa31c3a47be657a42640ba1669e0b77b8835534 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Tue, 7 Jul 2015 14:31:16 +0200 +Subject: [PATCH] TEST-14-IMSM: remove "rd.auto" + +otherwise rd.auto auto assembles the device +--- + test/TEST-14-IMSM/test.sh | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/test/TEST-14-IMSM/test.sh b/test/TEST-14-IMSM/test.sh +index a05d091..f4ea7ae 100755 +--- a/test/TEST-14-IMSM/test.sh ++++ b/test/TEST-14-IMSM/test.sh +@@ -30,13 +30,13 @@ client_run() { + test_run() { + read MD_UUID < $TESTDIR/mduuid + client_run rd.auto rd.md.imsm=0 || return 1 +- client_run rd.auto rd.md.uuid=$MD_UUID rd.dm=0 || return 1 ++ client_run rd.md.uuid=$MD_UUID rd.dm=0 || return 1 + # This test succeeds, because the mirror parts are found without + # assembling the mirror itsself, which is what we want +- client_run rd.auto rd.md.uuid=$MD_UUID rd.md=0 rd.md.imsm failme && return 1 +- client_run rd.auto rd.md.uuid=$MD_UUID rd.md=0 failme && return 1 ++ client_run rd.md.uuid=$MD_UUID rd.md=0 rd.md.imsm failme && return 1 ++ client_run rd.md.uuid=$MD_UUID rd.md=0 failme && return 1 + # the following test hangs on newer md +- client_run rd.auto rd.md.uuid=$MD_UUID rd.dm=0 rd.md.imsm rd.md.conf=0 || return 1 ++ client_run rd.md.uuid=$MD_UUID rd.dm=0 rd.md.imsm rd.md.conf=0 || return 1 + return 0 + } + diff --git a/0028-TEST-50-MULTINIC-test.sh-correctly-call-ldconfig.patch b/0028-TEST-50-MULTINIC-test.sh-correctly-call-ldconfig.patch new file mode 100644 index 0000000..beeecc3 --- /dev/null +++ b/0028-TEST-50-MULTINIC-test.sh-correctly-call-ldconfig.patch @@ -0,0 +1,22 @@ +From 7ecb36aef43f7573e1ae0489731000c9c01bc481 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Tue, 7 Jul 2015 15:34:30 +0200 +Subject: [PATCH] TEST-50-MULTINIC/test.sh: correctly call ldconfig + +--- + test/TEST-50-MULTINIC/test.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/test/TEST-50-MULTINIC/test.sh b/test/TEST-50-MULTINIC/test.sh +index b878380..fdeb840 100755 +--- a/test/TEST-50-MULTINIC/test.sh ++++ b/test/TEST-50-MULTINIC/test.sh +@@ -205,7 +205,7 @@ test_setup() { + inst /etc/group /etc/group + + cp -a -- /etc/ld.so.conf* "$initdir"/etc +- sudo ldconfig -r -- "$initdir" ++ ldconfig -r "$initdir" + dracut_kernel_post + ) + diff --git a/0029-network-dhclient-script.sh-remove-bashism.patch b/0029-network-dhclient-script.sh-remove-bashism.patch new file mode 100644 index 0000000..072b6f7 --- /dev/null +++ b/0029-network-dhclient-script.sh-remove-bashism.patch @@ -0,0 +1,22 @@ +From 78362bc5fea4fe640e7a767ebfbef7e3f5f57eba Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Wed, 8 Jul 2015 08:49:02 +0200 +Subject: [PATCH] network/dhclient-script.sh: remove bashism + +--- + modules.d/40network/dhclient-script.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/40network/dhclient-script.sh b/modules.d/40network/dhclient-script.sh +index 2550caf..c75ac89 100755 +--- a/modules.d/40network/dhclient-script.sh ++++ b/modules.d/40network/dhclient-script.sh +@@ -47,7 +47,7 @@ setup_interface() { + ${preferred_lft:+preferred_lft ${preferred_lft}} + + if [ -n "$gw" ] ; then +- if [ "$mask" == "255.255.255.255" ] ; then ++ if [ "$mask" = "255.255.255.255" ] ; then + # point-to-point connection => set explicit route to gateway + echo ip route add $gw dev $netif > /tmp/net.$netif.gw + fi diff --git a/0030-Add-all-btrfs-devices.patch b/0030-Add-all-btrfs-devices.patch new file mode 100644 index 0000000..8bcc862 --- /dev/null +++ b/0030-Add-all-btrfs-devices.patch @@ -0,0 +1,103 @@ +From 1cadc26fd44a602ffbcfb59786b400990541dc86 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Thu, 9 Jul 2015 13:18:13 +0200 +Subject: [PATCH] Add all btrfs devices + +We have to find them with "btrfs usage", which is cumbersome. +--- + dracut-functions.sh | 13 +++++++++++++ + dracut.sh | 22 ++++++++++++++++++++-- + modules.d/99base/module-setup.sh | 4 +++- + 3 files changed, 36 insertions(+), 3 deletions(-) + +diff --git a/dracut-functions.sh b/dracut-functions.sh +index f415f0d..639c5ae 100755 +--- a/dracut-functions.sh ++++ b/dracut-functions.sh +@@ -31,6 +31,10 @@ strstr() { [[ $1 = *"$2"* ]]; } + strglobin() { [[ $1 = *$2* ]]; } + # Generic glob matching function. If glob pattern $2 matches all of $1, OK + strglob() { [[ $1 = $2 ]]; } ++# returns OK if $1 contains literal string $2 at the beginning, and isn't empty ++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" ]; } + + # helper function for check() in module-setup.sh + # to check for required installed binaries +@@ -1815,3 +1819,12 @@ lvm_internal_dev() { + [[ ${DM_LV_LAYER} ]] || [[ ! -L /dev/${DM_VG_NAME}/${DM_LV_NAME} ]] + } + ++btrfs_devs() { ++ local _mp="$1" ++ btrfs device usage "$_mp" \ ++ | while read _dev _rest; do ++ str_starts "$_dev" "/" || continue ++ _dev=${_dev%,} ++ printf -- "%s\n" "$_dev" ++ done ++} +diff --git a/dracut.sh b/dracut.sh +index 8394cee..bf1886f 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -1146,6 +1146,11 @@ for line in "${fstab_lines[@]}"; do + ;; + esac + [ -z "$dev" ] && dwarn "Bad fstab entry $@" && continue ++ if [[ "$3" == btrfs ]]; then ++ for i in $(btrfs_devs "$2"); do ++ push_host_devs "$i" ++ done ++ fi + push_host_devs "$dev" + host_fs_types["$dev"]="$3" + done +@@ -1194,8 +1199,14 @@ if [[ $hostonly ]]; then + _bdev=$(readlink -f "/dev/block/$_dev") + [[ -b $_bdev ]] && _dev=$_bdev + push_host_devs $_dev +- [[ "$mp" == "/" ]] && root_dev="$_dev" ++ [[ "$mp" == "/" ]] && push root_devs "$_dev" + push_host_devs "$_dev" ++ if [[ $(find_mp_fstype "$mp") == btrfs ]]; then ++ for i in $(btrfs_devs "$mp"); do ++ [[ "$mp" == "/" ]] && push root_devs "$i" ++ push_host_devs "$i" ++ done ++ fi + done + + if [[ -f /proc/swaps ]] && [[ -f /etc/fstab ]]; then +@@ -1240,7 +1251,14 @@ if [[ $hostonly ]]; then + [[ "$_o" != *x-initrd.mount* ]] && continue + _dev=$(expand_persistent_dev "$_d") + _dev="$(readlink -f "$_dev")" +- [[ -b $_dev ]] && push_host_devs "$_dev" ++ [[ -b $_dev ]] || continue ++ ++ push_host_devs "$_dev" ++ if [[ "$_t" == btrfs ]]; then ++ for i in $(find_btrfs_devs "$_m"); do ++ push_host_devs "$i" ++ done ++ fi + done < /etc/fstab + fi + +diff --git a/modules.d/99base/module-setup.sh b/modules.d/99base/module-setup.sh +index bbc68ba..3fbdc41 100755 +--- a/modules.d/99base/module-setup.sh ++++ b/modules.d/99base/module-setup.sh +@@ -102,7 +102,9 @@ install() { + . "$moddir/dracut-lib.sh" + + for _dev in ${host_devs[@]}; do +- [[ "$_dev" == "$root_dev" ]] && continue ++ for _dev2 in ${root_devs[@]}; do ++ [[ "$_dev" == "$_dev2" ]] && continue 2 ++ done + + # We only actually wait for real devs - swap is only needed + # for resume and udev rules generated when parsing resume= diff --git a/0031-dracut.sh-remove-push.patch b/0031-dracut.sh-remove-push.patch new file mode 100644 index 0000000..d630ec1 --- /dev/null +++ b/0031-dracut.sh-remove-push.patch @@ -0,0 +1,155 @@ +From 5a66d51102bc3522d46c60d8bd8e5d6837420063 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Thu, 9 Jul 2015 14:13:44 +0200 +Subject: [PATCH] dracut.sh: remove push() + +can be done with var+=(val) +--- + dracut.sh | 77 +++++++++++++++++++++++---------------------------------------- + 1 file changed, 28 insertions(+), 49 deletions(-) + +diff --git a/dracut.sh b/dracut.sh +index bf1886f..f7609fa 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -209,30 +209,13 @@ For example: + EOF + } + +-# function push() +-# push values to a stack +-# $1 = stack variable +-# $2.. values +-# example: +-# push stack 1 2 "3 4" +-push() { +- local _i +- local __stack=$1; shift +- for _i in "$@"; do +- eval ${__stack}'[${#'${__stack}'[@]}]="$_i"' +- done +-} +- + # Fills up host_devs stack variable and makes sure there are no duplicates + push_host_devs() { + local _dev +- for _dev in ${host_devs[@]}; do +- [ "$_dev" = "$1" ] && return +- done +- push host_devs "$1" ++ [[ " ${host_devs[@]} " == *" $1 "* ]] && return ++ host_devs+=( "$1" ) + } + +- + # function pop() + # pops the last value from a stack + # assigns value to second argument variable +@@ -486,28 +469,25 @@ while :; do + PARMS_TO_STORE+=" $1"; + fi + case $1 in +- --kver) kernel="$2"; PARMS_TO_STORE+=" '$2'"; shift;; +- -a|--add) push add_dracutmodules_l "$2"; PARMS_TO_STORE+=" '$2'"; shift;; +- --force-add) push force_add_dracutmodules_l "$2"; PARMS_TO_STORE+=" '$2'"; shift;; +- --add-drivers) push add_drivers_l "$2"; PARMS_TO_STORE+=" '$2'"; shift;; +- --force-drivers) push force_drivers_l "$2"; PARMS_TO_STORE+=" '$2'"; shift;; +- --omit-drivers) push omit_drivers_l "$2"; PARMS_TO_STORE+=" '$2'"; shift;; +- -m|--modules) push dracutmodules_l "$2"; PARMS_TO_STORE+=" '$2'"; shift;; +- -o|--omit) push omit_dracutmodules_l "$2"; PARMS_TO_STORE+=" '$2'"; shift;; +- -d|--drivers) push drivers_l "$2"; PARMS_TO_STORE+=" '$2'"; shift;; +- --filesystems) push filesystems_l "$2"; PARMS_TO_STORE+=" '$2'"; shift;; +- -I|--install) push install_items_l "$2"; PARMS_TO_STORE+=" '$2'"; shift;; +- --install-optional) +- push install_optional_items_l \ +- "$2"; PARMS_TO_STORE+=" '$2'"; shift;; +- --fwdir) push fw_dir_l "$2"; PARMS_TO_STORE+=" '$2'"; shift;; +- --libdirs) push libdirs_l "$2"; PARMS_TO_STORE+=" '$2'"; shift;; +- --fscks) push fscks_l "$2"; PARMS_TO_STORE+=" '$2'"; shift;; +- --add-fstab) push add_fstab_l "$2"; PARMS_TO_STORE+=" '$2'"; shift;; +- --mount) push fstab_lines "$2"; PARMS_TO_STORE+=" '$2'"; shift;; +- --add-device|--device) +- push add_device_l "$2"; PARMS_TO_STORE+=" '$2'"; shift;; +- --kernel-cmdline) push kernel_cmdline_l "$2"; PARMS_TO_STORE+=" '$2'"; shift;; ++ --kver) kernel="$2"; PARMS_TO_STORE+=" '$2'"; shift;; ++ -a|--add) add_dracutmodules_l+=("$2"); PARMS_TO_STORE+=" '$2'"; shift;; ++ --force-add) force_add_dracutmodules_l+=("$2"); PARMS_TO_STORE+=" '$2'"; shift;; ++ --add-drivers) add_drivers_l+=("$2"); PARMS_TO_STORE+=" '$2'"; shift;; ++ --force-drivers) force_drivers_l+=("$2"); PARMS_TO_STORE+=" '$2'"; shift;; ++ --omit-drivers) omit_drivers_l+=("$2"); PARMS_TO_STORE+=" '$2'"; shift;; ++ -m|--modules) dracutmodules_l+=("$2"); PARMS_TO_STORE+=" '$2'"; shift;; ++ -o|--omit) omit_dracutmodules_l+=("$2"); PARMS_TO_STORE+=" '$2'"; shift;; ++ -d|--drivers) drivers_l+=("$2"); PARMS_TO_STORE+=" '$2'"; shift;; ++ --filesystems) filesystems_l+=("$2"); PARMS_TO_STORE+=" '$2'"; shift;; ++ -I|--install) install_items_l+=("$2"); PARMS_TO_STORE+=" '$2'"; shift;; ++ --install-optional) install_optional_items_l+=("$2"); PARMS_TO_STORE+=" '$2'"; shift;; ++ --fwdir) fw_dir_l+=("$2"); PARMS_TO_STORE+=" '$2'"; shift;; ++ --libdirs) libdirs_l+=("$2"); PARMS_TO_STORE+=" '$2'"; shift;; ++ --fscks) fscks_l+=("$2"); PARMS_TO_STORE+=" '$2'"; shift;; ++ --add-fstab) add_fstab_l+=("$2"); PARMS_TO_STORE+=" '$2'"; shift;; ++ --mount) fstab_lines+=("$2"); PARMS_TO_STORE+=" '$2'"; shift;; ++ --add-device|--device) add_device_l+=("$2"); PARMS_TO_STORE+=" '$2'"; shift;; ++ --kernel-cmdline) kernel_cmdline_l+=("$2"); PARMS_TO_STORE+=" '$2'"; shift;; + --nofscks) nofscks_l="yes";; + --ro-mnt) ro_mnt_l="yes";; + -k|--kmoddir) drivers_dir_l="$2"; PARMS_TO_STORE+=" '$2'"; shift;; +@@ -566,7 +546,7 @@ while :; do + persistent_policy_l="$2"; PARMS_TO_STORE+=" '$2'"; shift;; + --fstab) use_fstab_l="yes" ;; + -h|--help) long_usage; exit 1 ;; +- -i|--include) push include_src "$2"; PARMS_TO_STORE+=" '$2'"; ++ -i|--include) include_src+=("$2"); PARMS_TO_STORE+=" '$2'"; + shift;; + --bzip2) compress_l="bzip2";; + --lzma) compress_l="lzma";; +@@ -602,8 +582,8 @@ done + + while (($# > 0)); do + if [ "${1%%=*}" == "++include" ]; then +- push include_src "$2" +- push include_target "$3" ++ include_src+=("$2") ++ include_target+=("$3") + PARMS_TO_STORE+=" --include '$2' '$3'" + shift 2 + fi +@@ -746,7 +726,7 @@ fi + + if (( ${#fstab_lines_l[@]} )); then + while pop fstab_lines_l val; do +- push fstab_lines $val ++ fstab_lines+=($val) + done + fi + +@@ -1199,11 +1179,11 @@ if [[ $hostonly ]]; then + _bdev=$(readlink -f "/dev/block/$_dev") + [[ -b $_bdev ]] && _dev=$_bdev + push_host_devs $_dev +- [[ "$mp" == "/" ]] && push root_devs "$_dev" ++ [[ "$mp" == "/" ]] && root_devs+=("$_dev") + push_host_devs "$_dev" + if [[ $(find_mp_fstype "$mp") == btrfs ]]; then + for i in $(btrfs_devs "$mp"); do +- [[ "$mp" == "/" ]] && push root_devs "$i" ++ [[ "$mp" == "/" ]] && root_devs+=("$i") + push_host_devs "$i" + done + fi +@@ -1237,7 +1217,7 @@ if [[ $hostonly ]]; then + + _dev="$(readlink -f "$dev")" + push_host_devs "$_dev" +- push swap_devs "$_dev" ++ swap_devs+=("$_dev") + break + done < /etc/fstab + done < /proc/swaps +@@ -1262,7 +1242,6 @@ if [[ $hostonly ]]; then + done < /etc/fstab + fi + +- + # record all host modaliases + declare -A host_modalias + find /sys/devices/ -name uevent -print > "$initdir/.modalias" diff --git a/0032-dracut.conf-remove-example-parameters.patch b/0032-dracut.conf-remove-example-parameters.patch new file mode 100644 index 0000000..213515b --- /dev/null +++ b/0032-dracut.conf-remove-example-parameters.patch @@ -0,0 +1,68 @@ +From e833e26137b48063df59e777fe64e495ec538d0f Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Thu, 9 Jul 2015 14:31:26 +0200 +Subject: [PATCH] dracut.conf: remove example parameters + +--- + dracut.conf | 54 +++--------------------------------------------------- + 1 file changed, 3 insertions(+), 51 deletions(-) + +diff --git a/dracut.conf b/dracut.conf +index 8533f99..d6317a0 100644 +--- a/dracut.conf ++++ b/dracut.conf +@@ -1,51 +1,3 @@ +-# PUT YOUR CONFIG HERE OR IN separate files named *.conf +-# in /etc/dracut.conf.d +-# SEE man dracut.conf(5) +- +-# Sample dracut config file +- +-#logfile=/var/log/dracut.log +-#fileloglvl=6 +- +-# Exact list of dracut modules to use. Modules not listed here are not going +-# to be included. If you only want to add some optional modules use +-# add_dracutmodules option instead. +-#dracutmodules+="" +- +-# dracut modules to omit +-#omit_dracutmodules+="" +- +-# dracut modules to add to the default +-#add_dracutmodules+="" +- +-# additional kernel modules to the default +-#add_drivers+="" +- +-# list of kernel filesystem modules to be included in the generic initramfs +-#filesystems+="" +- +-# build initrd only to boot current hardware +-#hostonly="yes" +-# +- +-# install local /etc/mdadm.conf +-#mdadmconf="no" +- +-# install local /etc/lvm/lvm.conf +-#lvmconf="no" +- +-# A list of fsck tools to install. If it's not specified, module's hardcoded +-# default is used, currently: "umount mount /sbin/fsck* xfs_db xfs_check +-# xfs_repair e2fsck jfs_fsck reiserfsck btrfsck". The installation is +-# opportunistic, so non-existing tools are just ignored. +-#fscks="" +- +-# inhibit installation of any fsck tools +-#nofscks="yes" +- +-# mount / and /usr read-only by default +-#ro_mnt="no" +- +-# set the directory for temporary files +-# default: /var/tmp +-#tmpdir=/tmp ++# PUT YOUR CONFIG IN separate files ++# in /etc/dracut.conf.d named ".conf" ++# SEE man dracut.conf(5) for options diff --git a/0033-dracut.sh-remove-pop.patch b/0033-dracut.sh-remove-pop.patch new file mode 100644 index 0000000..6e115b8 --- /dev/null +++ b/0033-dracut.sh-remove-pop.patch @@ -0,0 +1,224 @@ +From 694725abf0d4956bb07b5f96b7887a75e0f430df Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Thu, 9 Jul 2015 14:33:24 +0200 +Subject: [PATCH] dracut.sh: remove pop() + +--- + dracut.sh | 119 ++++++++++++++------------------------------------------------ + 1 file changed, 27 insertions(+), 92 deletions(-) + +diff --git a/dracut.sh b/dracut.sh +index f7609fa..54358f3 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -212,35 +212,10 @@ EOF + # Fills up host_devs stack variable and makes sure there are no duplicates + push_host_devs() { + local _dev +- [[ " ${host_devs[@]} " == *" $1 "* ]] && return +- host_devs+=( "$1" ) +-} +- +-# function pop() +-# pops the last value from a stack +-# assigns value to second argument variable +-# or echo to stdout, if no second argument +-# $1 = stack variable +-# $2 = optional variable to store the value +-# example: +-# pop stack val +-# val=$(pop stack) +-pop() { +- local __stack=$1; shift +- local __resultvar=$1 +- local _value; +- # check for empty stack +- eval '[[ ${#'${__stack}'[@]} -eq 0 ]] && return 1' +- +- eval _value='${'${__stack}'[${#'${__stack}'[@]}-1]}' +- +- if [[ "$__resultvar" ]]; then +- eval $__resultvar="'$_value'" +- else +- printf "%s" "$_value" +- fi +- eval unset ${__stack}'[${#'${__stack}'[@]}-1]' +- return 0 ++ for _dev in "$@"; do ++ [[ " ${host_devs[@]} " == *" $_dev "* ]] && return ++ host_devs+=( "$_dev" ) ++ done + } + + # Little helper function for reading args from the commandline. +@@ -701,81 +676,52 @@ unset NPATH + + # these optins add to the stuff in the config file + if (( ${#add_dracutmodules_l[@]} )); then +- while pop add_dracutmodules_l val; do +- add_dracutmodules+=" $val " +- done ++ add_dracutmodules+=" ${add_dracutmodules_l[@]} " + fi + + if (( ${#force_add_dracutmodules_l[@]} )); then +- while pop force_add_dracutmodules_l val; do +- force_add_dracutmodules+=" $val " +- done ++ force_add_dracutmodules+=" ${force_add_dracutmodules_l[@]} " + fi + + if (( ${#fscks_l[@]} )); then +- while pop fscks_l val; do +- fscks+=" $val " +- done ++ fscks+=" ${fscks_l[@]} " + fi + + if (( ${#add_fstab_l[@]} )); then +- while pop add_fstab_l val; do +- add_fstab+=" $val " +- done ++ add_fstab+=" ${add_fstab_l[@]} " + fi + + if (( ${#fstab_lines_l[@]} )); then +- while pop fstab_lines_l val; do +- fstab_lines+=($val) +- done ++ fstab_lines+=( "${fstab_lines_l[@]}" ) + fi + + if (( ${#install_items_l[@]} )); then +- while pop install_items_l val; do +- install_items+=" $val " +- done ++ install_items+=" ${install_items_l[@]} " + fi + + if (( ${#install_optional_items_l[@]} )); then +- while pop install_optional_items_l val; do +- install_optional_items+=" $val " +- done ++ install_optional_items+=" ${install_optional_items_l[@]} " + fi + + # these options override the stuff in the config file + if (( ${#dracutmodules_l[@]} )); then +- dracutmodules='' +- while pop dracutmodules_l val; do +- dracutmodules+="$val " +- done ++ dracutmodules="${dracutmodules_l[@]}" + fi + + if (( ${#omit_dracutmodules_l[@]} )); then +- omit_dracutmodules='' +- while pop omit_dracutmodules_l val; do +- omit_dracutmodules+="$val " +- done ++ omit_dracutmodules="${omit_dracutmodules_l[@]}" + fi + + if (( ${#filesystems_l[@]} )); then +- filesystems='' +- while pop filesystems_l val; do +- filesystems+="$val " +- done ++ filesystems="${filesystems_l[@]}" + fi + + if (( ${#fw_dir_l[@]} )); then +- fw_dir='' +- while pop fw_dir_l val; do +- fw_dir+="$val " +- done ++ fw_dir="${fw_dir_l[@]}" + fi + + if (( ${#libdirs_l[@]} )); then +- libdirs='' +- while pop libdirs_l val; do +- libdirs+="$val " +- done ++ libdirs="${libdirs_l[@]}" + fi + + [[ $stdloglvl_l ]] && stdloglvl=$stdloglvl_l +@@ -925,38 +871,27 @@ dracutfunctions=$dracutbasedir/dracut-functions.sh + export dracutfunctions + + if (( ${#drivers_l[@]} )); then +- drivers='' +- while pop drivers_l val; do +- drivers+="$val " +- done ++ drivers="${drivers_l[@]}" + fi + drivers=${drivers/-/_} + + if (( ${#add_drivers_l[@]} )); then +- while pop add_drivers_l val; do +- add_drivers+=" $val " +- done ++ add_drivers+=" ${add_drivers_l[@]} " + fi + add_drivers=${add_drivers/-/_} + + if (( ${#force_drivers_l[@]} )); then +- while pop force_drivers_l val; do +- force_drivers+=" $val " +- done ++ force_drivers+=" ${force_drivers_l[@]} " + fi + force_drivers=${force_drivers/-/_} + + if (( ${#omit_drivers_l[@]} )); then +- while pop omit_drivers_l val; do +- omit_drivers+=" $val " +- done ++ omit_drivers+=" ${omit_drivers_l[@]} " + fi + omit_drivers=${omit_drivers/-/_} + + if (( ${#kernel_cmdline_l[@]} )); then +- while pop kernel_cmdline_l val; do +- kernel_cmdline+=" $val " +- done ++ kernel_cmdline+=" ${kernel_cmdline_l[@]} " + fi + + omit_drivers_corrected="" +@@ -1147,10 +1082,8 @@ for dev in $add_device; do + done + + if (( ${#add_device_l[@]} )); then +- while pop add_device_l val; do +- add_device+=" $val " +- push_host_devs "$val" +- done ++ add_device+=" ${add_device_l[@]} " ++ push_host_devs "${add_device_l[@]}" + fi + + if [[ $hostonly ]]; then +@@ -1527,7 +1460,7 @@ if [[ $kernel_only != yes ]]; then + + [[ $kernel_cmdline ]] && printf "%s\n" "$kernel_cmdline" >> "${initdir}/etc/cmdline.d/01-default.conf" + +- while pop fstab_lines line; do ++ for line in "${fstab_lines[@]}"; do + line=($line) + [ -z "${line[3]}" ] && line[3]="defaults" + [ -z "${line[4]}" ] && line[4]="0" +@@ -1566,7 +1499,9 @@ if [[ $kernel_only != yes ]]; then + done + fi + +-while pop include_src src && pop include_target target; do ++for ((i=0; i < ${#include_src[@]}; i++)); do ++ src="${include_src[$i]}" ++ target="${include_target[$i]}" + if [[ $src && $target ]]; then + if [[ -f $src ]]; then + inst $src $target diff --git a/0034-guard-arrays-with.patch b/0034-guard-arrays-with.patch new file mode 100644 index 0000000..63e7563 --- /dev/null +++ b/0034-guard-arrays-with.patch @@ -0,0 +1,182 @@ +From 3721635b2c5df033fca1e19181d7598e075f5308 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Thu, 9 Jul 2015 15:27:44 +0200 +Subject: [PATCH] guard ${arrays[@]} with "" + +--- + dracut-functions.sh | 8 ++++---- + dracut.sh | 6 +++--- + lsinitrd.sh | 2 +- + modules.d/90btrfs/module-setup.sh | 2 +- + modules.d/90kernel-modules/module-setup.sh | 2 +- + modules.d/95cifs/module-setup.sh | 2 +- + modules.d/95nfs/module-setup.sh | 2 +- + modules.d/95virtfs/module-setup.sh | 2 +- + modules.d/99base/module-setup.sh | 6 +++--- + 9 files changed, 16 insertions(+), 16 deletions(-) + +diff --git a/dracut-functions.sh b/dracut-functions.sh +index 639c5ae..3a0a5a2 100755 +--- a/dracut-functions.sh ++++ b/dracut-functions.sh +@@ -596,7 +596,7 @@ for_each_host_dev_fs() + local _dev + local _ret=1 + +- [[ "${!host_fs_types[@]}" ]] || return 0 ++ [[ "${#host_fs_types[@]}" ]] || return 0 + + for _dev in "${!host_fs_types[@]}"; do + $_func "$_dev" "${host_fs_types[$_dev]}" && _ret=0 +@@ -657,7 +657,7 @@ for_each_host_dev_and_slaves_all() + + [[ "${host_devs[@]}" ]] || return 0 + +- for _dev in ${host_devs[@]}; do ++ for _dev in "${host_devs[@]}"; do + [[ -b "$_dev" ]] || continue + if check_block_and_slaves_all $_func $(get_maj_min $_dev); then + _ret=0 +@@ -673,7 +673,7 @@ for_each_host_dev_and_slaves() + + [[ "${host_devs[@]}" ]] || return 0 + +- for _dev in ${host_devs[@]}; do ++ for _dev in "${host_devs[@]}"; do + [[ -b "$_dev" ]] || continue + check_block_and_slaves $_func $(get_maj_min $_dev) && return 0 + done +@@ -1276,7 +1276,7 @@ check_mount() { + local _ret + local _moddep + +- [ "${#host_fs_types[*]}" -le 0 ] && return 1 ++ [ "${#host_fs_types[@]}" -le 0 ] && return 1 + + # If we are already scheduled to be loaded, no need to check again. + [[ " $mods_to_load " == *\ $_mod\ * ]] && return 0 +diff --git a/dracut.sh b/dracut.sh +index 54358f3..fc84a41 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -1220,7 +1220,7 @@ _get_fs_type() { + return 1 + } + +-for dev in ${host_devs[@]}; do ++for dev in "${host_devs[@]}"; do + _get_fs_type "$dev" + check_block_and_slaves_all _get_fs_type "$(get_maj_min "$dev")" + done +@@ -1455,8 +1455,8 @@ if [[ $no_kernel != yes ]]; then + fi + + if [[ $kernel_only != yes ]]; then +- (( ${#install_items[@]} > 0 )) && inst_multiple ${install_items[@]} +- (( ${#install_optional_items[@]} > 0 )) && inst_multiple -o ${install_optional_items[@]} ++ (( ${#install_items[@]} > 0 )) && inst_multiple "${install_items[@]}" ++ (( ${#install_optional_items[@]} > 0 )) && inst_multiple -o "${install_optional_items[@]}" + + [[ $kernel_cmdline ]] && printf "%s\n" "$kernel_cmdline" >> "${initdir}/etc/cmdline.d/01-default.conf" + +diff --git a/lsinitrd.sh b/lsinitrd.sh +index 94674af..d2ddd76 100755 +--- a/lsinitrd.sh ++++ b/lsinitrd.sh +@@ -117,7 +117,7 @@ dracutlibdirs() { + extract_files() + { + (( ${#filenames[@]} == 1 )) && nofileinfo=1 +- for f in ${!filenames[@]}; do ++ for f in "${!filenames[@]}"; do + [[ $nofileinfo ]] || echo "initramfs:/$f" + [[ $nofileinfo ]] || echo "========================================================================" + $CAT $image | cpio --extract --verbose --quiet --to-stdout $f 2>/dev/null +diff --git a/modules.d/90btrfs/module-setup.sh b/modules.d/90btrfs/module-setup.sh +index 0771132..9303dbe 100755 +--- a/modules.d/90btrfs/module-setup.sh ++++ b/modules.d/90btrfs/module-setup.sh +@@ -8,7 +8,7 @@ check() { + require_binaries btrfs || return 1 + + [[ $hostonly ]] || [[ $mount_needs ]] && { +- for fs in ${host_fs_types[@]}; do ++ for fs in "${host_fs_types[@]}"; do + [[ "$fs" == "btrfs" ]] && return 0 + done + return 255 +diff --git a/modules.d/90kernel-modules/module-setup.sh b/modules.d/90kernel-modules/module-setup.sh +index 40803df..41bf37d 100755 +--- a/modules.d/90kernel-modules/module-setup.sh ++++ b/modules.d/90kernel-modules/module-setup.sh +@@ -74,7 +74,7 @@ installkernel() { + instmods '=fs' + fi + else +- for i in $(host_fs_all); do ++ for i in "${host_fs_types[@]}"; do + hostonly='' instmods $i + done + fi +diff --git a/modules.d/95cifs/module-setup.sh b/modules.d/95cifs/module-setup.sh +index 0e69845..f711458 100755 +--- a/modules.d/95cifs/module-setup.sh ++++ b/modules.d/95cifs/module-setup.sh +@@ -6,7 +6,7 @@ check() { + require_binaries mount.cifs || return 1 + + [[ $hostonly ]] || [[ $mount_needs ]] && { +- for fs in ${host_fs_types[@]}; do ++ for fs in "${host_fs_types[@]}"; do + [[ "$fs" == "cifs" ]] && return 0 + done + return 255 +diff --git a/modules.d/95nfs/module-setup.sh b/modules.d/95nfs/module-setup.sh +index 8eb542c..9b5b8c8 100755 +--- a/modules.d/95nfs/module-setup.sh ++++ b/modules.d/95nfs/module-setup.sh +@@ -7,7 +7,7 @@ check() { + require_binaries rpc.statd mount.nfs mount.nfs4 umount || return 1 + + [[ $hostonly ]] || [[ $mount_needs ]] && { +- for fs in ${host_fs_types[@]}; do ++ for fs in "${host_fs_types[@]}"; do + [[ "$fs" == "nfs" ]] && return 0 + [[ "$fs" == "nfs3" ]] && return 0 + [[ "$fs" == "nfs4" ]] && return 0 +diff --git a/modules.d/95virtfs/module-setup.sh b/modules.d/95virtfs/module-setup.sh +index 97d39b9..96036ee 100755 +--- a/modules.d/95virtfs/module-setup.sh ++++ b/modules.d/95virtfs/module-setup.sh +@@ -3,7 +3,7 @@ + # called by dracut + check() { + [[ $hostonly ]] || [[ $mount_needs ]] && { +- for fs in ${host_fs_types[@]}; do ++ for fs in "${host_fs_types[@]}"; do + [[ "$fs" == "9p" ]] && return 0 + done + return 255 +diff --git a/modules.d/99base/module-setup.sh b/modules.d/99base/module-setup.sh +index 3fbdc41..cc94d00 100755 +--- a/modules.d/99base/module-setup.sh ++++ b/modules.d/99base/module-setup.sh +@@ -101,15 +101,15 @@ install() { + + . "$moddir/dracut-lib.sh" + +- for _dev in ${host_devs[@]}; do +- for _dev2 in ${root_devs[@]}; do ++ for _dev in "${host_devs[@]}"; do ++ for _dev2 in "${root_devs[@]}"; do + [[ "$_dev" == "$_dev2" ]] && continue 2 + done + + # We only actually wait for real devs - swap is only needed + # for resume and udev rules generated when parsing resume= + # argument take care of the waiting for us +- for _dev2 in ${swap_devs[@]}; do ++ for _dev2 in "${swap_devs[@]}"; do + [[ "$_dev" == "$_dev2" ]] && continue 2 + done + diff --git a/0035-dracut-functions.sh-simplify-some-for-loops.patch b/0035-dracut-functions.sh-simplify-some-for-loops.patch new file mode 100644 index 0000000..81920ec --- /dev/null +++ b/0035-dracut-functions.sh-simplify-some-for-loops.patch @@ -0,0 +1,139 @@ +From 32de4eb5d30b728c2fb42f802e5104095a4bc74c Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Thu, 9 Jul 2015 15:34:47 +0200 +Subject: [PATCH] dracut-functions.sh: simplify some for loops + +continue early, if condition is not met +--- + dracut-functions.sh | 73 +++++++++++++++++++++++------------------------------ + 1 file changed, 32 insertions(+), 41 deletions(-) + +diff --git a/dracut-functions.sh b/dracut-functions.sh +index 3a0a5a2..d559903 100755 +--- a/dracut-functions.sh ++++ b/dracut-functions.sh +@@ -937,26 +937,23 @@ inst_rules() { + for _rule in "$@"; do + if [ "${_rule#/}" = "$_rule" ]; then + for r in ${udevdir}/rules.d ${hostonly:+/etc/udev/rules.d}; do +- if [[ -e $r/$_rule ]]; then +- _found="$r/$_rule" +- inst_rule_programs "$_found" +- inst_rule_group_owner "$_found" +- inst_rule_initqueue "$_found" +- inst_simple "$_found" +- fi ++ [[ -e $r/$_rule ]] || continue ++ _found="$r/$_rule" ++ inst_rule_programs "$_found" ++ inst_rule_group_owner "$_found" ++ inst_rule_initqueue "$_found" ++ inst_simple "$_found" + done + fi + for r in '' $dracutbasedir/rules.d/; do + # skip rules without an absolute path + [[ "${r}$_rule" != /* ]] && continue +- +- if [[ -f ${r}$_rule ]]; then +- _found="${r}$_rule" +- inst_rule_programs "$_found" +- inst_rule_group_owner "$_found" +- inst_rule_initqueue "$_found" +- inst_simple "$_found" "$_target/${_found##*/}" +- fi ++ [[ -f ${r}$_rule ]] || continue ++ _found="${r}$_rule" ++ inst_rule_programs "$_found" ++ inst_rule_group_owner "$_found" ++ inst_rule_initqueue "$_found" ++ inst_simple "$_found" "$_target/${_found##*/}" + done + [[ $_found ]] || dinfo "Skipping udev rule: $_rule" + done +@@ -968,23 +965,21 @@ inst_rules_wildcard() { + inst_dir "${udevdir}/rules.d" + inst_dir "$_target" + for _rule in ${udevdir}/rules.d/$1 ${dracutbasedir}/rules.d/$1 ; do +- if [[ -e $_rule ]]; then ++ [[ -e $_rule ]] || continue ++ inst_rule_programs "$_rule" ++ inst_rule_group_owner "$_rule" ++ inst_rule_initqueue "$_rule" ++ inst_simple "$_rule" ++ _found=$_rule ++ done ++ if [[ -n ${hostonly} ]] ; then ++ for _rule in ${_target}/$1 ; do ++ [[ -f $_rule ]] || continue + inst_rule_programs "$_rule" + inst_rule_group_owner "$_rule" + inst_rule_initqueue "$_rule" + inst_simple "$_rule" + _found=$_rule +- fi +- done +- if [[ -n ${hostonly} ]] ; then +- for _rule in ${_target}/$1 ; do +- if [[ -f $_rule ]]; then +- inst_rule_programs "$_rule" +- inst_rule_group_owner "$_rule" +- inst_rule_initqueue "$_rule" +- inst_simple "$_rule" +- _found=$_rule +- fi + done + fi + [[ $_found ]] || dinfo "Skipping udev rule: $_rule" +@@ -1051,10 +1046,9 @@ inst_any() { + [[ $1 = '-d' ]] && to="$2" && shift 2 + + for f in "$@"; do +- if [[ -e $f ]]; then +- [[ $to ]] && inst "$f" "$to" && return 0 +- inst "$f" && return 0 +- fi ++ [[ -e $f ]] || continue ++ [[ $to ]] && inst "$f" "$to" && return 0 ++ inst "$f" && return 0 + done + + return 1 +@@ -1118,8 +1112,7 @@ inst_decompress() { + inst_opt_decompress() { + local _src + +- for _src in $@ +- do ++ for _src in $@; do + inst_decompress "${_src}" || inst "${_src}" + done + } +@@ -1482,10 +1475,9 @@ install_kmod_with_fw() { + for _fw in $(modinfo -k $kernel -F firmware $1 2>/dev/null); do + _found='' + for _fwdir in $fw_dir; do +- if [[ -d $_fwdir && -f $_fwdir/$_fw ]]; then +- inst_simple "$_fwdir/$_fw" "/lib/firmware/$_fw" +- _found=yes +- fi ++ [[ -d $_fwdir && -f $_fwdir/$_fw ]] || continue ++ inst_simple "$_fwdir/$_fw" "/lib/firmware/$_fw" ++ _found=yes + done + if [[ $_found != yes ]]; then + if ! [[ -d $(echo /sys/module/${_modname//-/_}|{ read a b; echo $a; }) ]]; then +@@ -1557,10 +1549,9 @@ dracut_kernel_post() { + else + for _fw in $(xargs -r modinfo -k $kernel -F firmware < "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist.dep"); do + for _fwdir in $fw_dir; do +- if [[ -d $_fwdir && -f $_fwdir/$_fw ]]; then +- inst_simple "$_fwdir/$_fw" "/lib/firmware/$_fw" +- break +- fi ++ [[ -d $_fwdir && -f $_fwdir/$_fw ]] || continue ++ inst_simple "$_fwdir/$_fw" "/lib/firmware/$_fw" ++ break + done + done + fi diff --git a/0036-dracut.sh-reduce-code.patch b/0036-dracut.sh-reduce-code.patch new file mode 100644 index 0000000..bae71ba --- /dev/null +++ b/0036-dracut.sh-reduce-code.patch @@ -0,0 +1,117 @@ +From cb0913db0d23bb0880e525e5cb3d7a179b0c7a20 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Thu, 9 Jul 2015 18:02:44 +0200 +Subject: [PATCH] dracut.sh: reduce code + +--- + dracut.sh | 80 ++++++++++++++------------------------------------------------- + 1 file changed, 18 insertions(+), 62 deletions(-) + +diff --git a/dracut.sh b/dracut.sh +index fc84a41..21d29bf 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -674,55 +674,21 @@ done + export PATH="${NPATH#:}" + unset NPATH + +-# these optins add to the stuff in the config file +-if (( ${#add_dracutmodules_l[@]} )); then +- add_dracutmodules+=" ${add_dracutmodules_l[@]} " +-fi +- +-if (( ${#force_add_dracutmodules_l[@]} )); then +- force_add_dracutmodules+=" ${force_add_dracutmodules_l[@]} " +-fi +- +-if (( ${#fscks_l[@]} )); then +- fscks+=" ${fscks_l[@]} " +-fi +- +-if (( ${#add_fstab_l[@]} )); then +- add_fstab+=" ${add_fstab_l[@]} " +-fi +- +-if (( ${#fstab_lines_l[@]} )); then +- fstab_lines+=( "${fstab_lines_l[@]}" ) +-fi +- +-if (( ${#install_items_l[@]} )); then +- install_items+=" ${install_items_l[@]} " +-fi +- +-if (( ${#install_optional_items_l[@]} )); then +- install_optional_items+=" ${install_optional_items_l[@]} " +-fi ++# these options add to the stuff in the config file ++(( ${#add_dracutmodules_l[@]} )) && add_dracutmodules+=" ${add_dracutmodules_l[@]} " ++(( ${#force_add_dracutmodules_l[@]} )) && force_add_dracutmodules+=" ${force_add_dracutmodules_l[@]} " ++(( ${#fscks_l[@]} )) && fscks+=" ${fscks_l[@]} " ++(( ${#add_fstab_l[@]} )) && add_fstab+=" ${add_fstab_l[@]} " ++(( ${#fstab_lines_l[@]} )) && fstab_lines+=( "${fstab_lines_l[@]}" ) ++(( ${#install_items_l[@]} )) && install_items+=" ${install_items_l[@]} " ++(( ${#install_optional_items_l[@]} )) && install_optional_items+=" ${install_optional_items_l[@]} " + + # these options override the stuff in the config file +-if (( ${#dracutmodules_l[@]} )); then +- dracutmodules="${dracutmodules_l[@]}" +-fi +- +-if (( ${#omit_dracutmodules_l[@]} )); then +- omit_dracutmodules="${omit_dracutmodules_l[@]}" +-fi +- +-if (( ${#filesystems_l[@]} )); then +- filesystems="${filesystems_l[@]}" +-fi +- +-if (( ${#fw_dir_l[@]} )); then +- fw_dir="${fw_dir_l[@]}" +-fi +- +-if (( ${#libdirs_l[@]} )); then +- libdirs="${libdirs_l[@]}" +-fi ++(( ${#dracutmodules_l[@]} )) && dracutmodules="${dracutmodules_l[@]}" ++(( ${#omit_dracutmodules_l[@]} )) && omit_dracutmodules="${omit_dracutmodules_l[@]}" ++(( ${#filesystems_l[@]} )) && filesystems="${filesystems_l[@]}" ++(( ${#fw_dir_l[@]} )) && fw_dir="${fw_dir_l[@]}" ++(( ${#libdirs_l[@]} ))&& libdirs="${libdirs_l[@]}" + + [[ $stdloglvl_l ]] && stdloglvl=$stdloglvl_l + [[ ! $stdloglvl ]] && stdloglvl=4 +@@ -870,29 +836,19 @@ fi + dracutfunctions=$dracutbasedir/dracut-functions.sh + export dracutfunctions + +-if (( ${#drivers_l[@]} )); then +- drivers="${drivers_l[@]}" +-fi ++(( ${#drivers_l[@]} )) && drivers="${drivers_l[@]}" + drivers=${drivers/-/_} + +-if (( ${#add_drivers_l[@]} )); then +- add_drivers+=" ${add_drivers_l[@]} " +-fi ++(( ${#add_drivers_l[@]} )) && add_drivers+=" ${add_drivers_l[@]} " + add_drivers=${add_drivers/-/_} + +-if (( ${#force_drivers_l[@]} )); then +- force_drivers+=" ${force_drivers_l[@]} " +-fi ++(( ${#force_drivers_l[@]} )) && force_drivers+=" ${force_drivers_l[@]} " + force_drivers=${force_drivers/-/_} + +-if (( ${#omit_drivers_l[@]} )); then +- omit_drivers+=" ${omit_drivers_l[@]} " +-fi ++(( ${#omit_drivers_l[@]} )) && omit_drivers+=" ${omit_drivers_l[@]} " + omit_drivers=${omit_drivers/-/_} + +-if (( ${#kernel_cmdline_l[@]} )); then +- kernel_cmdline+=" ${kernel_cmdline_l[@]} " +-fi ++(( ${#kernel_cmdline_l[@]} )) && kernel_cmdline+=" ${kernel_cmdline_l[@]} " + + omit_drivers_corrected="" + for d in $omit_drivers; do diff --git a/0037-dracut.sh-remember-0-for-regenerate-all.patch b/0037-dracut.sh-remember-0-for-regenerate-all.patch new file mode 100644 index 0000000..a724e29 --- /dev/null +++ b/0037-dracut.sh-remember-0-for-regenerate-all.patch @@ -0,0 +1,66 @@ +From e8f19bcf26304282301c7aa34dff10f51d5f6172 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Thu, 9 Jul 2015 18:22:15 +0200 +Subject: [PATCH] dracut.sh: remember $0 for --regenerate-all + +--- + dracut.sh | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +diff --git a/dracut.sh b/dracut.sh +index 21d29bf..77da887 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -23,6 +23,7 @@ + + # store for logging + dracut_args=( "$@" ) ++readonly dracut_cmd="$(readlink -f $0)" + + set -o pipefail + +@@ -34,7 +35,7 @@ usage() { + + # 80x25 linebreak here ^ + cat << EOF +-Usage: $0 [OPTION]... [ []] ++Usage: $dracut_cmd [OPTION]... [ []] + + Version: $DRACUT_VERSION + +@@ -59,7 +60,7 @@ long_usage() { + + # 80x25 linebreak here ^ + cat << EOF +-Usage: $0 [OPTION]... [ []] ++Usage: $dracut_cmd [OPTION]... [ []] + + Version: $DRACUT_VERSION + +@@ -586,7 +587,7 @@ if [[ $regenerate_all == "yes" ]]; then + cd /lib/modules + for i in *; do + [[ -f $i/modules.dep ]] || [[ -f $i/modules.dep.bin ]] || continue +- dracut --kver="$i" "${dracut_args[@]}" ++ "$dracut_cmd" --kver="$i" "${dracut_args[@]}" + ((ret+=$?)) + done + exit $ret +@@ -814,7 +815,7 @@ if [[ -f $dracutbasedir/dracut-init.sh ]]; then + else + printf "%s\n" "dracut: Cannot find $dracutbasedir/dracut-init.sh." >&2 + printf "%s\n" "dracut: Are you running from a git checkout?" >&2 +- printf "%s\n" "dracut: Try passing -l as an argument to $0" >&2 ++ printf "%s\n" "dracut: Try passing -l as an argument to $dracut_cmd" >&2 + exit 1 + fi + +@@ -866,7 +867,7 @@ for ((i=0; i < ${#dracut_args[@]}; i++)); do + #" keep vim happy + done + +-dinfo "Executing: $0 ${dracut_args[@]}" ++dinfo "Executing: $dracut_cmd ${dracut_args[@]}" + + [[ $do_list = yes ]] && { + for mod in $dracutbasedir/modules.d/*; do diff --git a/0038-dracut.sh-early-check-for-bash-version.patch b/0038-dracut.sh-early-check-for-bash-version.patch new file mode 100644 index 0000000..33468f8 --- /dev/null +++ b/0038-dracut.sh-early-check-for-bash-version.patch @@ -0,0 +1,40 @@ +From ee44f6297293f895f2e446690a19e7114eff7ae8 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Thu, 9 Jul 2015 19:44:30 +0200 +Subject: [PATCH] dracut.sh: early check for bash version + +--- + dracut.sh | 13 +++++++------ + 1 file changed, 7 insertions(+), 6 deletions(-) + +diff --git a/dracut.sh b/dracut.sh +index 77da887..b7456dc 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -22,6 +22,13 @@ + # + + # store for logging ++ ++# Verify bash version, current minimum is 4 ++if (( BASH_VERSINFO[0] < 4 )); then ++ printf -- 'You need at least Bash 4 to use dracut, sorry.' >&2 ++ exit 1 ++fi ++ + dracut_args=( "$@" ) + readonly dracut_cmd="$(readlink -f $0)" + +@@ -828,12 +835,6 @@ if ! [[ $print_cmdline ]]; then + rm -fr -- ${initdir}/* + fi + +-# Verify bash version, current minimum is 4 +-if (( BASH_VERSINFO[0] < 4 )); then +- dfatal 'You need at least Bash 4 to use dracut, sorry.' +- exit 1 +-fi +- + dracutfunctions=$dracutbasedir/dracut-functions.sh + export dracutfunctions + diff --git a/0039-dracut.spec-add-dracut-init.sh.patch b/0039-dracut.spec-add-dracut-init.sh.patch new file mode 100644 index 0000000..96e40f3 --- /dev/null +++ b/0039-dracut.spec-add-dracut-init.sh.patch @@ -0,0 +1,21 @@ +From d63a455ffda280899bf9d3d7988789a74ac9ad8c Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Fri, 10 Jul 2015 11:21:51 +0200 +Subject: [PATCH] dracut.spec: add dracut-init.sh + +--- + dracut.spec | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/dracut.spec b/dracut.spec +index 4775210..08b281d 100644 +--- a/dracut.spec ++++ b/dracut.spec +@@ -315,6 +315,7 @@ rm -rf -- $RPM_BUILD_ROOT + %dir %{dracutlibdir} + %dir %{dracutlibdir}/modules.d + %{dracutlibdir}/dracut-functions.sh ++%{dracutlibdir}/dracut-init.sh + %{dracutlibdir}/dracut-functions + %{dracutlibdir}/dracut-version.sh + %{dracutlibdir}/dracut-logger.sh diff --git a/dracut.spec b/dracut.spec index 923733f..53bc8f6 100644 --- a/dracut.spec +++ b/dracut.spec @@ -11,7 +11,7 @@ Name: dracut Version: 043 -Release: 2%{?dist} +Release: 40.git20150710%{?dist} Summary: Initramfs generator using udev %if 0%{?fedora} || 0%{?rhel} @@ -30,6 +30,45 @@ URL: https://dracut.wiki.kernel.org/ # Source can be generated by # http://git.kernel.org/?p=boot/dracut/dracut.git;a=snapshot;h=%{version};sf=tgz Source0: http://www.kernel.org/pub/linux/utils/boot/dracut/dracut-%{version}.tar.xz +Patch1: 0001-Fix-default-udev-systemd-dir-detection-in-usr-merge-.patch +Patch2: 0002-rootfs-generator-check-for-rootok-before-doing-any-a.patch +Patch3: 0003-uefi-lib-remove-bogus-comment.patch +Patch4: 0004-dracut.spec-move-dmsquash-and-livnet-to-subpackage.patch +Patch5: 0005-dracut.spec-Recommends-grubby.patch +Patch6: 0006-dracut.spec-turn-requires-in-recommends.patch +Patch7: 0007-Revert-lvm-Don-t-activate-LVs-with-activationskip-se.patch +Patch8: 0008-systemd-if-kdbus-is-available-include-the-kernel-mod.patch +Patch9: 0009-network-dhclient-script.sh-add-RENEW-REBIND.patch +Patch10: 0010-network-dhclient-script.sh-make-IPv4-DHCP-lease-time.patch +Patch11: 0011-network-don-t-use-ifup-m.patch +Patch12: 0012-lower-the-log-level-for-dfatal.patch +Patch13: 0013-dracut.sh-add-devices-with-x-initrd.mount-in-etc-fst.patch +Patch14: 0014-dracut-lib.sh-info-output-info-to-stderr.patch +Patch15: 0015-nfs-nfs-lib.sh-add-anaconda_nfsv6_to_var.patch +Patch16: 0016-splitup-dracut-init.sh-from-dracut-functions.sh.patch +Patch17: 0017-network-dhclient-script.sh-fixup-lease-time.patch +Patch18: 0018-90multipath-add-hostonly-multipath.conf-in-case-host.patch +Patch19: 0019-dmsquash-live-dmsquash-live-root.sh-fixup-checkisomd.patch +Patch20: 0020-skipcpio-skipcpio.c-linux-kernel-only-accepts-070701.patch +Patch21: 0021-Reset-IFS-variable.patch +Patch22: 0022-mkinitrd-suse.sh-Bail-out-with-exit-1-if-initrd-cann.patch +Patch23: 0023-Use-the-uncompressed-kernel-file-on-arm-and-aarch-to.patch +Patch24: 0024-ensure-pre-mount-and-resume-run-before-root-fsck.patch +Patch25: 0025-dracut-pre-mount.service-should-run-before-systemd-f.patch +Patch26: 0026-TEST-04-FULL-SYSTEMD-fixup-loadkeys-keymap-loading.patch +Patch27: 0027-TEST-14-IMSM-remove-rd.auto.patch +Patch28: 0028-TEST-50-MULTINIC-test.sh-correctly-call-ldconfig.patch +Patch29: 0029-network-dhclient-script.sh-remove-bashism.patch +Patch30: 0030-Add-all-btrfs-devices.patch +Patch31: 0031-dracut.sh-remove-push.patch +Patch32: 0032-dracut.conf-remove-example-parameters.patch +Patch33: 0033-dracut.sh-remove-pop.patch +Patch34: 0034-guard-arrays-with.patch +Patch35: 0035-dracut-functions.sh-simplify-some-for-loops.patch +Patch36: 0036-dracut.sh-reduce-code.patch +Patch37: 0037-dracut.sh-remember-0-for-regenerate-all.patch +Patch38: 0038-dracut.sh-early-check-for-bash-version.patch +Patch39: 0039-dracut.spec-add-dracut-init.sh.patch Source1: https://www.gnu.org/licenses/lgpl-2.1.txt @@ -93,11 +132,21 @@ Requires: cpio Requires: filesystem >= 2.1.0 Requires: findutils Requires: grep -Requires: hardlink -Requires: gzip xz Requires: kmod Requires: sed + +%if 0%{?fedora} > 22 +Recommends: grubby +Recommends: hardlink +Recommends: gzip +Recommends: xz +Recommends: kpartx +%else +Requires: hardlink +Requires: gzip +Requires: xz Requires: kpartx +%endif %if 0%{?fedora} || 0%{?rhel} > 6 Requires: util-linux >= 2.21 @@ -169,6 +218,16 @@ Requires: libcap This package requires everything which is needed to build an initramfs with dracut, which drops capabilities. +%package live +Summary: dracut modules to build a dracut initramfs with live image capabilities +Requires: %{name} = %{version}-%{release} +Requires: %{name}-network = %{version}-%{release} +Requires: tar gzip coreutils bash device-mapper curl + +%description live +This package requires everything which is needed to build an +initramfs with dracut, with live image capabilities, like Live CDs. + %package config-generic Summary: dracut configuration to turn off hostonly image generation Requires: %{name} = %{version}-%{release} @@ -296,6 +355,7 @@ rm -rf -- $RPM_BUILD_ROOT %dir %{dracutlibdir} %dir %{dracutlibdir}/modules.d %{dracutlibdir}/dracut-functions.sh +%{dracutlibdir}/dracut-init.sh %{dracutlibdir}/dracut-functions %{dracutlibdir}/dracut-version.sh %{dracutlibdir}/dracut-logger.sh @@ -346,7 +406,6 @@ rm -rf -- $RPM_BUILD_ROOT %{dracutlibdir}/modules.d/90crypt %{dracutlibdir}/modules.d/90dm %{dracutlibdir}/modules.d/90dmraid -%{dracutlibdir}/modules.d/90dmsquash-live %{dracutlibdir}/modules.d/90kernel-modules %{dracutlibdir}/modules.d/90lvm %{dracutlibdir}/modules.d/90mdraid @@ -380,7 +439,6 @@ rm -rf -- $RPM_BUILD_ROOT %{dracutlibdir}/modules.d/98usrmount %{dracutlibdir}/modules.d/99base %{dracutlibdir}/modules.d/99fs-lib -%{dracutlibdir}/modules.d/99img-lib %{dracutlibdir}/modules.d/99shutdown %attr(0644,root,root) %ghost %config(missingok,noreplace) %{_localstatedir}/log/dracut.log %dir %{_sharedstatedir}/initramfs @@ -414,7 +472,6 @@ rm -rf -- $RPM_BUILD_ROOT %{dracutlibdir}/modules.d/90kernel-network-modules %{dracutlibdir}/modules.d/95fcoe %{dracutlibdir}/modules.d/95iscsi -%{dracutlibdir}/modules.d/90livenet %{dracutlibdir}/modules.d/90qemu-net %{dracutlibdir}/modules.d/95cifs %{dracutlibdir}/modules.d/95nbd @@ -441,6 +498,12 @@ rm -rf -- $RPM_BUILD_ROOT %defattr(-,root,root,0755) %{dracutlibdir}/modules.d/02caps +%files live +%defattr(-,root,root,0755) +%{dracutlibdir}/modules.d/99img-lib +%{dracutlibdir}/modules.d/90dmsquash-live +%{dracutlibdir}/modules.d/90livenet + %files tools %defattr(-,root,root,0755) @@ -466,6 +529,9 @@ rm -rf -- $RPM_BUILD_ROOT %endif %changelog +* Fri Jul 10 2015 Harald Hoyer 043-40.git20150710 +- git snapshot + * Wed Jun 17 2015 Fedora Release Engineering - 043-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild