From b7366e786ecec56cde7f74016a266bbe19c54652 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 17 May 2021 13:36:55 +0200 Subject: [PATCH] version 054 --- .gitignore | 1 + ...-41cfdfc-to-fix-RHBZ-1936781-per-ryn.patch | 31 - ...ules-add-watchdog-drivers-for-generi.patch | 32 - ...r.sh-double-dash-trigger-unknown-log.patch | 38 -- ...ger-nm-run.service-don-t-kill-forked.patch | 46 -- ...ger-no-default-deps-for-nm-run.servi.patch | 27 - ...ger-only-run-NetworkManager-if-rd.ne.patch | 47 -- 0001.patch | 23 + ...ger-use-run-NetworkManager-initrd-ne.patch | 55 -- 0002.patch | 24 + 0003.patch | 555 ++++++++++++++++++ 0004.patch | 38 ++ dracut.spec | 68 +-- sources | 2 +- 14 files changed, 671 insertions(+), 316 deletions(-) delete mode 100644 0001-Partially-revert-41cfdfc-to-fix-RHBZ-1936781-per-ryn.patch delete mode 100644 0001-fix-90kernel-modules-add-watchdog-drivers-for-generi.patch delete mode 100644 0001-fix-dracut-logger.sh-double-dash-trigger-unknown-log.patch delete mode 100644 0001-fix-network-manager-nm-run.service-don-t-kill-forked.patch delete mode 100644 0001-fix-network-manager-no-default-deps-for-nm-run.servi.patch delete mode 100644 0001-fix-network-manager-only-run-NetworkManager-if-rd.ne.patch create mode 100644 0001.patch delete mode 100644 0002-fix-network-manager-use-run-NetworkManager-initrd-ne.patch create mode 100644 0002.patch create mode 100644 0003.patch create mode 100644 0004.patch diff --git a/.gitignore b/.gitignore index e27cb71..4372dee 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,4 @@ /dracut-050.tar.xz /dracut-051.tar.xz /dracut-053.tar.xz +/dracut-054.tar.xz diff --git a/0001-Partially-revert-41cfdfc-to-fix-RHBZ-1936781-per-ryn.patch b/0001-Partially-revert-41cfdfc-to-fix-RHBZ-1936781-per-ryn.patch deleted file mode 100644 index a706714..0000000 --- a/0001-Partially-revert-41cfdfc-to-fix-RHBZ-1936781-per-ryn.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 9db78bc16fc66d1200ab032bd667809a4404c869 Mon Sep 17 00:00:00 2001 -From: Adam Williamson -Date: Mon, 19 Apr 2021 08:33:38 -0700 -Subject: [PATCH] Partially revert 41cfdfc to fix RHBZ #1936781 per @ryncsn - -Signed-off-by: Adam Williamson ---- - dracut.sh | 7 +++++-- - 1 file changed, 5 insertions(+), 2 deletions(-) - -diff --git a/dracut.sh b/dracut.sh -index 062ed6c1..71942ce1 100755 ---- a/dracut.sh -+++ b/dracut.sh -@@ -2059,8 +2059,11 @@ if dracut_module_included "squash"; then - - # Remove duplicated files - for folder in "${squash_candidate[@]}"; do -- find "$initdir/$folder/" -not -type d \ -- -exec bash -c 'mv -f "$squash_dir${1#$initdir}" "$1"' -- "{}" \; -+ for file in $(find $initdir/$folder/ -not -type d); do -+ if [[ -e $squash_dir${file#$initdir} ]]; then -+ mv -f $squash_dir${file#$initdir} $file -+ fi -+ done - done - fi - --- -2.31.1 - diff --git a/0001-fix-90kernel-modules-add-watchdog-drivers-for-generi.patch b/0001-fix-90kernel-modules-add-watchdog-drivers-for-generi.patch deleted file mode 100644 index 79bba94..0000000 --- a/0001-fix-90kernel-modules-add-watchdog-drivers-for-generi.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 82549210c375075bf79ad77bb915ed2d0808d60a Mon Sep 17 00:00:00 2001 -From: Peter Robinson -Date: Wed, 21 Apr 2021 12:50:41 +0100 -Subject: [PATCH] fix(90kernel-modules): add watchdog drivers for generic - initrd - -The watchdog module pulls in the device specific watchdog if that -module is enabled, but in the case where we need a generic initrd -we don't get all watchdog drivers which means if we have a watchdog -enabled for that usecase it may get kicked too late in the boot -process so we need the drivers in the initrd for the generic case too. - -Signed-off-by: Peter Robinson ---- - modules.d/90kernel-modules/module-setup.sh | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/modules.d/90kernel-modules/module-setup.sh b/modules.d/90kernel-modules/module-setup.sh -index 1a1b56a2..b3c91f21 100755 ---- a/modules.d/90kernel-modules/module-setup.sh -+++ b/modules.d/90kernel-modules/module-setup.sh -@@ -59,6 +59,7 @@ - "=drivers/pci/host" \ - "=drivers/pci/controller" \ - "=drivers/pinctrl" \ -+ "=drivers/watchdog" \ - ${NULL} - - instmods \ --- -2.31.1 - diff --git a/0001-fix-dracut-logger.sh-double-dash-trigger-unknown-log.patch b/0001-fix-dracut-logger.sh-double-dash-trigger-unknown-log.patch deleted file mode 100644 index 2511dab..0000000 --- a/0001-fix-dracut-logger.sh-double-dash-trigger-unknown-log.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 4fbccde50456f513d388cdfd858018cd889890dc Mon Sep 17 00:00:00 2001 -From: Dusty Mabe -Date: Wed, 14 Apr 2021 16:23:29 -0400 -Subject: [PATCH] fix(dracut-logger.sh): double dash trigger unknown logger - warnings during run - -There are a bunch of `logger: unknown facility name: --user` errors -during a run. This is because logger is getting passed something like: - -``` -logger -p --user.info -``` - -Where it should be something like: - -``` -logger -p user.info -``` ---- - dracut-logger.sh | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/dracut-logger.sh b/dracut-logger.sh -index c36525d0..07389285 100755 ---- a/dracut-logger.sh -+++ b/dracut-logger.sh -@@ -241,7 +241,7 @@ _lvl2char() { - # @retval 0 if @a lvl is correct. - # @result Echoes logger priority. - _lvl2syspri() { -- printf "%s" -- "$syslogfacility." -+ printf -- "%s" "$syslogfacility." - case "$1" in - 1) echo crit;; - 2) echo error;; --- -2.30.2 - diff --git a/0001-fix-network-manager-nm-run.service-don-t-kill-forked.patch b/0001-fix-network-manager-nm-run.service-don-t-kill-forked.patch deleted file mode 100644 index 73bebc4..0000000 --- a/0001-fix-network-manager-nm-run.service-don-t-kill-forked.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 1f21fac646daa46cbe184ef8ff7705842f06ba15 Mon Sep 17 00:00:00 2001 -From: Dusty Mabe -Date: Wed, 14 Apr 2021 10:46:12 -0400 -Subject: [PATCH] fix(network-manager): nm-run.service: don't kill forked - processes - -If teaming is set up via NetworkManager we don't want systemd to take -down the userspace teamd process when NetworkManager quits. `KillMode=process` -will allow it to leave those processes behind. - -This is fallout from the change to run NetworkManager via systemd (c17c5b7). - -With `KillMode=process` we get something like: - -``` -sh-5.1# journalctl -u nm-run -o cat | tail - [1618411262.7030] quitting now that startup is complete - [1618411262.7030] device (team0): carrier: link connected - [1618411262.7033] device (team0): team port ens2 was released - [1618411262.7033] device (team0): team port ens3 was released - [1618411262.7033] manager: NetworkManager state is now CONNECTED_SITE - [1618411262.7034] exiting (success) -nm-run.service: Deactivated successfully. -nm-run.service: Unit process 476 (teamd) remains running after unit stopped. -Finished nm-run.service. -``` ---- - modules.d/35network-manager/nm-run.service | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/modules.d/35network-manager/nm-run.service b/modules.d/35network-manager/nm-run.service -index f3493c41..b667ce37 100644 ---- a/modules.d/35network-manager/nm-run.service -+++ b/modules.d/35network-manager/nm-run.service -@@ -23,6 +23,8 @@ ConditionPathExistsGlob=|/etc/sysconfig/network-scripts/ifcfg-* - #run the script and wait before it finishes - Type=oneshot - ExecStart=/usr/sbin/NetworkManager --configure-and-quit=initrd --no-daemon -+#don't kill forked off processes (for example: teamd for teaming) -+KillMode=process - - [Install] - WantedBy=initrd.target --- -2.30.2 - diff --git a/0001-fix-network-manager-no-default-deps-for-nm-run.servi.patch b/0001-fix-network-manager-no-default-deps-for-nm-run.servi.patch deleted file mode 100644 index 38c06cd..0000000 --- a/0001-fix-network-manager-no-default-deps-for-nm-run.servi.patch +++ /dev/null @@ -1,27 +0,0 @@ -From ba4bcf5f4f11ad624c647ddf4f566997186135e7 Mon Sep 17 00:00:00 2001 -From: Harald Hoyer -Date: Wed, 31 Mar 2021 16:11:41 +0200 -Subject: [PATCH] fix(network-manager): no default deps for nm-run.service - -Otherwise nm-run.service will run only in basic.target, which is too -late in the initramfs. ---- - modules.d/35network-manager/nm-run.service | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/modules.d/35network-manager/nm-run.service b/modules.d/35network-manager/nm-run.service -index 63fe7564..f3493c41 100644 ---- a/modules.d/35network-manager/nm-run.service -+++ b/modules.d/35network-manager/nm-run.service -@@ -2,6 +2,8 @@ - # SPDX-License-Identifier: GPL-2.0-or-later - - [Unit] -+DefaultDependencies=no -+ - #make sure all devices showed up - Wants=systemd-udev-settle.service - After=systemd-udev-settle.service --- -2.31.1 - diff --git a/0001-fix-network-manager-only-run-NetworkManager-if-rd.ne.patch b/0001-fix-network-manager-only-run-NetworkManager-if-rd.ne.patch deleted file mode 100644 index 25d40df..0000000 --- a/0001-fix-network-manager-only-run-NetworkManager-if-rd.ne.patch +++ /dev/null @@ -1,47 +0,0 @@ -From ac0e8f7dcc81432311906c3fca0d4211f6a2f68c Mon Sep 17 00:00:00 2001 -From: Dusty Mabe -Date: Tue, 13 Apr 2021 11:36:21 -0400 -Subject: [PATCH 1/2] fix(network-manager): only run NetworkManager if - rd.neednet=1 - -Don't run the new systemd unit (nm-run.service) if rd.neednet=1 -isn't set. nm-initrd-generator will generate configuration even -without rd.neednet=1 so determining if we should start based on -just if connection profiles exist isn't enough. We need some other -indicator. In this case we lay down a /run/NetworkManager/initrd/neednet -if rd.neednet=1, which is used by nm-run.service to determine the -need to run. ---- - modules.d/35network-manager/nm-lib.sh | 1 + - modules.d/35network-manager/nm-run.service | 3 +++ - 2 files changed, 4 insertions(+) - -diff --git a/modules.d/35network-manager/nm-lib.sh b/modules.d/35network-manager/nm-lib.sh -index fe053cf..d756022 100644 ---- a/modules.d/35network-manager/nm-lib.sh -+++ b/modules.d/35network-manager/nm-lib.sh -@@ -14,6 +14,7 @@ nm_generate_connections() - /etc/sysconfig/network-scripts/ifcfg-*; do - [ -f "$i" ] || continue - echo '[ -f /tmp/nm.done ]' >$hookdir/initqueue/finished/nm.sh -+ : > /run/NetworkManager/initrd/neednet # activate nm-run.service - break - done - fi -diff --git a/modules.d/35network-manager/nm-run.service b/modules.d/35network-manager/nm-run.service -index b667ce3..f041ade 100644 ---- a/modules.d/35network-manager/nm-run.service -+++ b/modules.d/35network-manager/nm-run.service -@@ -15,6 +15,9 @@ Before=network.target network-online.target - #run before we try to mount anything from the dracut hooks - Before=dracut-initqueue.service - -+#do not run if networking not needed -+ConditionPathExists=/run/NetworkManager/initrd/neednet -+ - #do not run, if there is no configuration - ConditionPathExistsGlob=|/usr/lib/NetworkManager/system-connections/* - ConditionPathExistsGlob=|/run/NetworkManager/system-connections/* --- -2.30.2 - diff --git a/0001.patch b/0001.patch new file mode 100644 index 0000000..76c6824 --- /dev/null +++ b/0001.patch @@ -0,0 +1,23 @@ +From f634448b293ed232009b25c824f6dcd66961426f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?J=C3=B3hann=20B=2E=20Gu=C3=B0mundsson?= +Date: Fri, 14 May 2021 13:46:23 +0000 +Subject: [PATCH] fix(packit): downstream has renamed the master branch to main + +--- + .packit.yml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/.packit.yml b/.packit.yml +index 8a995efe..482b4c4d 100644 +--- a/.packit.yml ++++ b/.packit.yml +@@ -33,7 +33,7 @@ jobs: + - job: propose_downstream + trigger: release + metadata: +- dist_git_branches: master ++ dist_git_branches: main + + - job: tests + trigger: pull_request + diff --git a/0002-fix-network-manager-use-run-NetworkManager-initrd-ne.patch b/0002-fix-network-manager-use-run-NetworkManager-initrd-ne.patch deleted file mode 100644 index e187e0e..0000000 --- a/0002-fix-network-manager-use-run-NetworkManager-initrd-ne.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 6a37c6f6302f950df608db3fd45acf9342ee3de2 Mon Sep 17 00:00:00 2001 -From: Dusty Mabe -Date: Tue, 13 Apr 2021 11:45:35 -0400 -Subject: [PATCH 2/2] fix(network-manager): use - /run/NetworkManager/initrd/neednet in initqueue - -We don't want to start NetworkManager if networking is not needed. -Right now nm-config.sh lays down /usr/lib/dracut/hooks/initqueue/finished/nm.sh -which will cause the initqueue to run. If nothing exists in -/usr/lib/dracut/hooks/initqueue/finished/ then it will short circuit and -the initqueue won't run anything. But what if something else needed -something to run in the initqueue? nm-run.sh would still get started, -even though /usr/lib/dracut/hooks/initqueue/finished/nm.sh didn't exist. -In this case let's just trigger off of /run/NetworkManager/initrd/neednet -like we are doing in the systemd unit (nm-run.service). ---- - modules.d/35network-manager/nm-run.sh | 22 +++++++++++++--------- - 1 file changed, 13 insertions(+), 9 deletions(-) - -diff --git a/modules.d/35network-manager/nm-run.sh b/modules.d/35network-manager/nm-run.sh -index d48028df..359bc9ee 100755 ---- a/modules.d/35network-manager/nm-run.sh -+++ b/modules.d/35network-manager/nm-run.sh -@@ -6,15 +6,19 @@ if [ -e /tmp/nm.done ]; then - return - fi - --[ -z "$DRACUT_SYSTEMD" ] && \ --for i in /usr/lib/NetworkManager/system-connections/* \ -- /run/NetworkManager/system-connections/* \ -- /etc/NetworkManager/system-connections/* \ -- /etc/sysconfig/network-scripts/ifcfg-*; do -- [ -f "$i" ] || continue -- /usr/sbin/NetworkManager --configure-and-quit=initrd --no-daemon -- break --done -+if [ -z "$DRACUT_SYSTEMD" ]; then -+ # Only start NM if networking is needed -+ if [ -e /run/NetworkManager/initrd/neednet ]; then -+ for i in /usr/lib/NetworkManager/system-connections/* \ -+ /run/NetworkManager/system-connections/* \ -+ /etc/NetworkManager/system-connections/* \ -+ /etc/sysconfig/network-scripts/ifcfg-*; do -+ [ -f "$i" ] || continue -+ /usr/sbin/NetworkManager --configure-and-quit=initrd --no-daemon -+ break -+ done -+ fi -+fi - - if [ -s /run/NetworkManager/initrd/hostname ]; then - cat /run/NetworkManager/initrd/hostname > /proc/sys/kernel/hostname --- -2.30.2 - diff --git a/0002.patch b/0002.patch new file mode 100644 index 0000000..859cc2b --- /dev/null +++ b/0002.patch @@ -0,0 +1,24 @@ +From b9b6f0ee5b859a562e46a8c4e0dee0261fabf74d Mon Sep 17 00:00:00 2001 +From: Lars Wendler +Date: Fri, 14 May 2021 16:00:27 +0200 +Subject: [PATCH] fix(dracut-util): print error message with trailing newline + +Signed-off-by: Lars Wendler +--- + src/util/util.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/util/util.c b/src/util/util.c +index 8ae06d6c..b3498df6 100644 +--- a/src/util/util.c ++++ b/src/util/util.c +@@ -123,7 +123,7 @@ static void usage(enum EXEC_MODE enumExecMode, int ret, char *msg) + { + switch (enumExecMode) { + case UNDEFINED: +- fprintf(stderr, "ERROR: 'dracut-util' has to be called via a symlink to the tool name."); ++ fprintf(stderr, "ERROR: 'dracut-util' has to be called via a symlink to the tool name.\n"); + break; + case GETARG: + fprintf(stderr, "ERROR: %s\nUsage: dracut-getarg [=[]]\n", msg); + diff --git a/0003.patch b/0003.patch new file mode 100644 index 0000000..9914b10 --- /dev/null +++ b/0003.patch @@ -0,0 +1,555 @@ +From c08bc8109d4c43beacfa4bcdc20a356102da6d02 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Mon, 17 May 2021 11:00:22 +0200 +Subject: [PATCH] fix(base): split out `dracut-dev-lib.sh` + +To share the `wait_for_dev` function and use it without side effects on +install time, split out the needed functions in an extra library. +--- + modules.d/99base/dracut-dev-lib.sh | 119 +++++++++++++++++++++++++++++++++++++ + modules.d/99base/dracut-lib.sh | 115 +---------------------------------- + modules.d/99base/module-setup.sh | 9 ++- + test/TEST-01-BASIC/test.sh | 1 + + test/TEST-02-SYSTEMD/test.sh | 1 + + test/TEST-03-USR-MOUNT/test.sh | 1 + + test/TEST-04-FULL-SYSTEMD/test.sh | 1 + + test/TEST-10-RAID/test.sh | 1 + + test/TEST-11-LVM/test.sh | 1 + + test/TEST-12-RAID-DEG/test.sh | 1 + + test/TEST-13-ENC-RAID-LVM/test.sh | 1 + + test/TEST-14-IMSM/test.sh | 1 + + test/TEST-15-BTRFSRAID/test.sh | 1 + + test/TEST-16-DMSQUASH/test.sh | 1 + + test/TEST-17-LVM-THIN/test.sh | 1 + + test/TEST-20-NFS/test.sh | 1 + + test/TEST-30-ISCSI/test.sh | 1 + + test/TEST-35-ISCSI-MULTI/test.sh | 1 + + test/TEST-40-NBD/test.sh | 2 + + test/TEST-50-MULTINIC/test.sh | 1 + + test/TEST-98-GETARG/test.sh | 2 + + 21 files changed, 145 insertions(+), 118 deletions(-) + +diff --git a/modules.d/99base/dracut-dev-lib.sh b/modules.d/99base/dracut-dev-lib.sh +new file mode 100755 +index 00000000..5083f4f2 +--- /dev/null ++++ b/modules.d/99base/dracut-dev-lib.sh +@@ -0,0 +1,119 @@ ++#!/bin/sh ++ ++# get a systemd-compatible unit name from a path ++# (mimicks unit_name_from_path_instance()) ++dev_unit_name() { ++ local dev="$1" ++ ++ if command -v systemd-escape > /dev/null; then ++ systemd-escape -p -- "$dev" ++ return $? ++ fi ++ ++ if [ "$dev" = "/" -o -z "$dev" ]; then ++ printf -- "-" ++ return 0 ++ fi ++ ++ dev="${1%%/}" ++ dev="${dev##/}" ++ # shellcheck disable=SC1003 ++ dev="$(str_replace "$dev" '\' '\x5c')" ++ dev="$(str_replace "$dev" '-' '\x2d')" ++ if [ "${dev##.}" != "$dev" ]; then ++ dev="\x2e${dev##.}" ++ fi ++ dev="$(str_replace "$dev" '/' '-')" ++ ++ printf -- "%s" "$dev" ++} ++ ++# set_systemd_timeout_for_dev [-n] [] ++# Set 'rd.timeout' as the systemd timeout for ++set_systemd_timeout_for_dev() { ++ local _name ++ local _needreload ++ local _noreload ++ local _timeout ++ ++ [ -z "$DRACUT_SYSTEMD" ] && return 0 ++ ++ if [ "$1" = "-n" ]; then ++ _noreload=1 ++ shift ++ fi ++ ++ if [ -n "$2" ]; then ++ _timeout="$2" ++ else ++ _timeout=$(getarg rd.timeout) ++ fi ++ ++ _timeout=${_timeout:-0} ++ ++ _name=$(dev_unit_name "$1") ++ if ! [ -L "${PREFIX}/etc/systemd/system/initrd.target.wants/${_name}.device" ]; then ++ [ -d "${PREFIX}"/etc/systemd/system/initrd.target.wants ] || mkdir -p "${PREFIX}"/etc/systemd/system/initrd.target.wants ++ ln -s ../"${_name}".device "${PREFIX}/etc/systemd/system/initrd.target.wants/${_name}.device" ++ type mark_hostonly > /dev/null 2>&1 && mark_hostonly /etc/systemd/system/initrd.target.wants/"${_name}".device ++ _needreload=1 ++ fi ++ ++ if ! [ -f "${PREFIX}/etc/systemd/system/${_name}.device.d/timeout.conf" ]; then ++ mkdir -p "${PREFIX}/etc/systemd/system/${_name}.device.d" ++ { ++ echo "[Unit]" ++ echo "JobTimeoutSec=$_timeout" ++ echo "JobRunningTimeoutSec=$_timeout" ++ } > "${PREFIX}/etc/systemd/system/${_name}.device.d/timeout.conf" ++ type mark_hostonly > /dev/null 2>&1 && mark_hostonly /etc/systemd/system/"${_name}".device.d/timeout.conf ++ _needreload=1 ++ fi ++ ++ if [ -z "$PREFIX" ] && [ "$_needreload" = 1 ] && [ -z "$_noreload" ]; then ++ /sbin/initqueue --onetime --unique --name daemon-reload systemctl daemon-reload ++ fi ++} ++ ++# wait_for_dev [] ++# ++# Installs a initqueue-finished script, ++# which will cause the main loop only to exit, ++# if the device is recognized by the system. ++wait_for_dev() { ++ local _name ++ local _noreload ++ ++ if [ "$1" = "-n" ]; then ++ _noreload=-n ++ shift ++ fi ++ ++ _name="$(str_replace "$1" '/' '\x2f')" ++ ++ type mark_hostonly > /dev/null 2>&1 && mark_hostonly "$hookdir/initqueue/finished/devexists-${_name}.sh" ++ ++ [ -e "${PREFIX}$hookdir/initqueue/finished/devexists-${_name}.sh" ] && return 0 ++ ++ printf '[ -e "%s" ]\n' "$1" \ ++ >> "${PREFIX}$hookdir/initqueue/finished/devexists-${_name}.sh" ++ { ++ printf '[ -e "%s" ] || ' "$1" ++ printf 'warn "\"%s\" does not exist"\n' "$1" ++ } >> "${PREFIX}$hookdir/emergency/80-${_name}.sh" ++ ++ set_systemd_timeout_for_dev $_noreload "$@" ++} ++ ++cancel_wait_for_dev() { ++ local _name ++ _name="$(str_replace "$1" '/' '\x2f')" ++ rm -f -- "$hookdir/initqueue/finished/devexists-${_name}.sh" ++ rm -f -- "$hookdir/emergency/80-${_name}.sh" ++ if [ -n "$DRACUT_SYSTEMD" ]; then ++ _name=$(dev_unit_name "$1") ++ rm -f -- "${PREFIX}/etc/systemd/system/initrd.target.wants/${_name}.device" ++ rm -f -- "${PREFIX}/etc/systemd/system/${_name}.device.d/timeout.conf" ++ /sbin/initqueue --onetime --unique --name daemon-reload systemctl daemon-reload ++ fi ++} +diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh +index c35658fa..dc94e93f 100755 +--- a/modules.d/99base/dracut-lib.sh ++++ b/modules.d/99base/dracut-lib.sh +@@ -1,5 +1,7 @@ + #!/bin/sh + ++type wait_for_dev > /dev/null 2>&1 || . /lib/dracut-dev-lib.sh ++ + export DRACUT_SYSTEMD + export NEWROOT + if [ -n "$NEWROOT" ]; then +@@ -838,119 +840,6 @@ wait_for_mount() { + } >> "$hookdir/emergency/90-${_name}.sh" + } + +-# get a systemd-compatible unit name from a path +-# (mimicks unit_name_from_path_instance()) +-dev_unit_name() { +- local dev="$1" +- +- if command -v systemd-escape > /dev/null; then +- systemd-escape -p -- "$dev" +- return +- fi +- +- if [ "$dev" = "/" -o -z "$dev" ]; then +- printf -- "-" +- exit 0 +- fi +- +- dev="${1%%/}" +- dev="${dev##/}" +- # shellcheck disable=SC1003 +- dev="$(str_replace "$dev" '\' '\x5c')" +- dev="$(str_replace "$dev" '-' '\x2d')" +- if [ "${dev##.}" != "$dev" ]; then +- dev="\x2e${dev##.}" +- fi +- dev="$(str_replace "$dev" '/' '-')" +- +- printf -- "%s" "$dev" +-} +- +-# set_systemd_timeout_for_dev +-# Set 'rd.timeout' as the systemd timeout for +- +-set_systemd_timeout_for_dev() { +- local _name +- local _needreload +- local _noreload +- local _timeout +- +- if [ "$1" = "-n" ]; then +- _noreload=1 +- shift +- fi +- +- _timeout=$(getarg rd.timeout) +- _timeout=${_timeout:-0} +- +- if [ -n "$DRACUT_SYSTEMD" ]; then +- _name=$(dev_unit_name "$1") +- if ! [ -L "${PREFIX}/etc/systemd/system/initrd.target.wants/${_name}.device" ]; then +- [ -d "${PREFIX}"/etc/systemd/system/initrd.target.wants ] || mkdir -p "${PREFIX}"/etc/systemd/system/initrd.target.wants +- ln -s ../"${_name}".device "${PREFIX}/etc/systemd/system/initrd.target.wants/${_name}.device" +- type mark_hostonly > /dev/null 2>&1 && mark_hostonly /etc/systemd/system/initrd.target.wants/"${_name}".device +- _needreload=1 +- fi +- +- if ! [ -f "${PREFIX}/etc/systemd/system/${_name}.device.d/timeout.conf" ]; then +- mkdir -p "${PREFIX}/etc/systemd/system/${_name}.device.d" +- { +- echo "[Unit]" +- echo "JobTimeoutSec=$_timeout" +- echo "JobRunningTimeoutSec=$_timeout" +- } > "${PREFIX}/etc/systemd/system/${_name}.device.d/timeout.conf" +- type mark_hostonly > /dev/null 2>&1 && mark_hostonly /etc/systemd/system/"${_name}".device.d/timeout.conf +- _needreload=1 +- fi +- +- if [ -z "$PREFIX" ] && [ "$_needreload" = 1 ] && [ -z "$_noreload" ]; then +- /sbin/initqueue --onetime --unique --name daemon-reload systemctl daemon-reload +- fi +- fi +-} +-# wait_for_dev +-# +-# Installs a initqueue-finished script, +-# which will cause the main loop only to exit, +-# if the device is recognized by the system. +-wait_for_dev() { +- local _name +- local _noreload +- +- if [ "$1" = "-n" ]; then +- _noreload=-n +- shift +- fi +- +- _name="$(str_replace "$1" '/' '\x2f')" +- +- type mark_hostonly > /dev/null 2>&1 && mark_hostonly "$hookdir/initqueue/finished/devexists-${_name}.sh" +- +- [ -e "${PREFIX}$hookdir/initqueue/finished/devexists-${_name}.sh" ] && return 0 +- +- printf '[ -e "%s" ]\n' "$1" \ +- >> "${PREFIX}$hookdir/initqueue/finished/devexists-${_name}.sh" +- { +- printf '[ -e "%s" ] || ' "$1" +- printf 'warn "\"%s\" does not exist"\n' "$1" +- } >> "${PREFIX}$hookdir/emergency/80-${_name}.sh" +- +- set_systemd_timeout_for_dev $_noreload "$1" +-} +- +-cancel_wait_for_dev() { +- local _name +- _name="$(str_replace "$1" '/' '\x2f')" +- rm -f -- "$hookdir/initqueue/finished/devexists-${_name}.sh" +- rm -f -- "$hookdir/emergency/80-${_name}.sh" +- if [ -n "$DRACUT_SYSTEMD" ]; then +- _name=$(dev_unit_name "$1") +- rm -f -- "${PREFIX}/etc/systemd/system/initrd.target.wants/${_name}.device" +- rm -f -- "${PREFIX}/etc/systemd/system/${_name}.device.d/timeout.conf" +- /sbin/initqueue --onetime --unique --name daemon-reload systemctl daemon-reload +- fi +-} +- + killproc() { + debug_off + local _exe +diff --git a/modules.d/99base/module-setup.sh b/modules.d/99base/module-setup.sh +index a52c643e..7eb0a277 100755 +--- a/modules.d/99base/module-setup.sh ++++ b/modules.d/99base/module-setup.sh +@@ -50,6 +50,7 @@ install() { + mkdir -p "${initdir}"/tmp + + inst_simple "$moddir/dracut-lib.sh" "/lib/dracut-lib.sh" ++ inst_simple "$moddir/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh" + mkdir -p "${initdir}"/var + + if ! dracut_module_included "systemd"; then +@@ -117,10 +118,8 @@ install() { + fi + export PREFIX="$initdir" + +- # suppress getarg for `rd.memdebug` +- export DEBUG_MEM_LEVEL=0 +- # shellcheck source=dracut-lib.sh +- . "$moddir/dracut-lib.sh" ++ # shellcheck source=dracut-dev-lib.sh ++ . "$moddir/dracut-dev-lib.sh" + + for _dev in "${host_devs[@]}"; do + for _dev2 in "${root_devs[@]}"; do +@@ -137,7 +136,7 @@ install() { + _pdev=$(get_persistent_dev "$_dev") + + case "$_pdev" in +- /dev/?*) wait_for_dev "$_pdev" ;; ++ /dev/?*) wait_for_dev "$_pdev" 0 ;; + *) ;; + esac + done +diff --git a/test/TEST-01-BASIC/test.sh b/test/TEST-01-BASIC/test.sh +index 7ac2a8b9..012f2e5a 100755 +--- a/test/TEST-01-BASIC/test.sh ++++ b/test/TEST-01-BASIC/test.sh +@@ -49,6 +49,7 @@ test_setup() { + inst "$basedir/modules.d/35network-legacy/ifup.sh" "/sbin/ifup" + + inst_simple "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh" ++ inst_simple "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh" + inst_binary "${basedir}/dracut-util" "/usr/bin/dracut-util" + ln -s dracut-util "${initdir}/usr/bin/dracut-getarg" + ln -s dracut-util "${initdir}/usr/bin/dracut-getargs" +diff --git a/test/TEST-02-SYSTEMD/test.sh b/test/TEST-02-SYSTEMD/test.sh +index a8185b09..8b6b5930 100755 +--- a/test/TEST-02-SYSTEMD/test.sh ++++ b/test/TEST-02-SYSTEMD/test.sh +@@ -48,6 +48,7 @@ test_setup() { + inst "$basedir/modules.d/35network-legacy/ifup.sh" "/sbin/ifup" + + inst_simple "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh" ++ inst_simple "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh" + inst_binary "${basedir}/dracut-util" "/usr/bin/dracut-util" + ln -s dracut-util "${initdir}/usr/bin/dracut-getarg" + ln -s dracut-util "${initdir}/usr/bin/dracut-getargs" +diff --git a/test/TEST-03-USR-MOUNT/test.sh b/test/TEST-03-USR-MOUNT/test.sh +index 13361173..3bb7fab7 100755 +--- a/test/TEST-03-USR-MOUNT/test.sh ++++ b/test/TEST-03-USR-MOUNT/test.sh +@@ -69,6 +69,7 @@ test_setup() { + inst "$basedir/modules.d/35network-legacy/ifup.sh" "/sbin/ifup" + + inst_simple "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh" ++ inst_simple "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh" + inst_binary "${basedir}/dracut-util" "/usr/bin/dracut-util" + ln -s dracut-util "${initdir}/usr/bin/dracut-getarg" + ln -s dracut-util "${initdir}/usr/bin/dracut-getargs" +diff --git a/test/TEST-04-FULL-SYSTEMD/test.sh b/test/TEST-04-FULL-SYSTEMD/test.sh +index 9b8fab24..38cb1464 100755 +--- a/test/TEST-04-FULL-SYSTEMD/test.sh ++++ b/test/TEST-04-FULL-SYSTEMD/test.sh +@@ -93,6 +93,7 @@ test_setup() { + inst_multiple -o {,/usr}/lib/systemd/system/"dracut*" + + inst_simple "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh" ++ inst_simple "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh" + inst_binary "${basedir}/dracut-util" "/usr/bin/dracut-util" + ln -s dracut-util "${initdir}/usr/bin/dracut-getarg" + ln -s dracut-util "${initdir}/usr/bin/dracut-getargs" +diff --git a/test/TEST-10-RAID/test.sh b/test/TEST-10-RAID/test.sh +index f03d2952..918d2a71 100755 +--- a/test/TEST-10-RAID/test.sh ++++ b/test/TEST-10-RAID/test.sh +@@ -46,6 +46,7 @@ test_setup() { + inst_multiple -o ${_terminfodir}/l/linux + + inst_simple "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh" ++ inst_simple "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh" + inst_binary "${basedir}/dracut-util" "/usr/bin/dracut-util" + ln -s dracut-util "${initdir}/usr/bin/dracut-getarg" + ln -s dracut-util "${initdir}/usr/bin/dracut-getargs" +diff --git a/test/TEST-11-LVM/test.sh b/test/TEST-11-LVM/test.sh +index e44b21ff..12384c09 100755 +--- a/test/TEST-11-LVM/test.sh ++++ b/test/TEST-11-LVM/test.sh +@@ -50,6 +50,7 @@ test_setup() { + inst "$basedir/modules.d/35network-legacy/ifup.sh" "/sbin/ifup" + + inst_simple "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh" ++ inst_simple "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh" + inst_binary "${basedir}/dracut-util" "/usr/bin/dracut-util" + ln -s dracut-util "${initdir}/usr/bin/dracut-getarg" + ln -s dracut-util "${initdir}/usr/bin/dracut-getargs" +diff --git a/test/TEST-12-RAID-DEG/test.sh b/test/TEST-12-RAID-DEG/test.sh +index 8d56f658..beb81381 100755 +--- a/test/TEST-12-RAID-DEG/test.sh ++++ b/test/TEST-12-RAID-DEG/test.sh +@@ -80,6 +80,7 @@ test_setup() { + inst "$basedir/modules.d/35network-legacy/ifup.sh" "/sbin/ifup" + + inst_simple "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh" ++ inst_simple "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh" + inst_binary "${basedir}/dracut-util" "/usr/bin/dracut-util" + ln -s dracut-util "${initdir}/usr/bin/dracut-getarg" + ln -s dracut-util "${initdir}/usr/bin/dracut-getargs" +diff --git a/test/TEST-13-ENC-RAID-LVM/test.sh b/test/TEST-13-ENC-RAID-LVM/test.sh +index 2d76c982..968eafe7 100755 +--- a/test/TEST-13-ENC-RAID-LVM/test.sh ++++ b/test/TEST-13-ENC-RAID-LVM/test.sh +@@ -78,6 +78,7 @@ test_setup() { + inst "$basedir/modules.d/35network-legacy/ifup.sh" "/sbin/ifup" + + inst_simple "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh" ++ inst_simple "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh" + inst_binary "${basedir}/dracut-util" "/usr/bin/dracut-util" + ln -s dracut-util "${initdir}/usr/bin/dracut-getarg" + ln -s dracut-util "${initdir}/usr/bin/dracut-getargs" +diff --git a/test/TEST-14-IMSM/test.sh b/test/TEST-14-IMSM/test.sh +index ab4f8119..78b087f5 100755 +--- a/test/TEST-14-IMSM/test.sh ++++ b/test/TEST-14-IMSM/test.sh +@@ -75,6 +75,7 @@ test_setup() { + inst "$basedir/modules.d/35network-legacy/ifup.sh" "/sbin/ifup" + + inst_simple "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh" ++ inst_simple "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh" + inst_binary "${basedir}/dracut-util" "/usr/bin/dracut-util" + ln -s dracut-util "${initdir}/usr/bin/dracut-getarg" + ln -s dracut-util "${initdir}/usr/bin/dracut-getargs" +diff --git a/test/TEST-15-BTRFSRAID/test.sh b/test/TEST-15-BTRFSRAID/test.sh +index 75e97703..47edac81 100755 +--- a/test/TEST-15-BTRFSRAID/test.sh ++++ b/test/TEST-15-BTRFSRAID/test.sh +@@ -53,6 +53,7 @@ test_setup() { + inst "$basedir/modules.d/35network-legacy/ifup.sh" "/sbin/ifup" + + inst_simple "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh" ++ inst_simple "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh" + inst_binary "${basedir}/dracut-util" "/usr/bin/dracut-util" + ln -s dracut-util "${initdir}/usr/bin/dracut-getarg" + ln -s dracut-util "${initdir}/usr/bin/dracut-getargs" +diff --git a/test/TEST-16-DMSQUASH/test.sh b/test/TEST-16-DMSQUASH/test.sh +index 73c4c7f1..2a68f305 100755 +--- a/test/TEST-16-DMSQUASH/test.sh ++++ b/test/TEST-16-DMSQUASH/test.sh +@@ -88,6 +88,7 @@ test_setup() { + inst "$basedir/modules.d/35network-legacy/ifup.sh" "/sbin/ifup" + + inst_simple "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh" ++ inst_simple "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh" + inst_binary "${basedir}/dracut-util" "/usr/bin/dracut-util" + ln -s dracut-util "${initdir}/usr/bin/dracut-getarg" + ln -s dracut-util "${initdir}/usr/bin/dracut-getargs" +diff --git a/test/TEST-17-LVM-THIN/test.sh b/test/TEST-17-LVM-THIN/test.sh +index 6f6886ec..7dbcca51 100755 +--- a/test/TEST-17-LVM-THIN/test.sh ++++ b/test/TEST-17-LVM-THIN/test.sh +@@ -48,6 +48,7 @@ test_setup() { + inst "$basedir/modules.d/35network-legacy/ifup.sh" "/sbin/ifup" + + inst_simple "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh" ++ inst_simple "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh" + inst_binary "${basedir}/dracut-util" "/usr/bin/dracut-util" + ln -s dracut-util "${initdir}/usr/bin/dracut-getarg" + ln -s dracut-util "${initdir}/usr/bin/dracut-getargs" +diff --git a/test/TEST-20-NFS/test.sh b/test/TEST-20-NFS/test.sh +index dc9fa0b0..0be60a80 100755 +--- a/test/TEST-20-NFS/test.sh ++++ b/test/TEST-20-NFS/test.sh +@@ -320,6 +320,7 @@ test_setup() { + done + + inst_simple "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh" ++ inst_simple "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh" + inst_binary "${basedir}/dracut-util" "/usr/bin/dracut-util" + ln -s dracut-util "${initdir}/usr/bin/dracut-getarg" + ln -s dracut-util "${initdir}/usr/bin/dracut-getargs" +diff --git a/test/TEST-30-ISCSI/test.sh b/test/TEST-30-ISCSI/test.sh +index e1d10265..5f0063f8 100755 +--- a/test/TEST-30-ISCSI/test.sh ++++ b/test/TEST-30-ISCSI/test.sh +@@ -162,6 +162,7 @@ test_setup() { + inst_simple /etc/os-release + + inst_simple "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh" ++ inst_simple "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh" + inst_binary "${basedir}/dracut-util" "/usr/bin/dracut-util" + ln -s dracut-util "${initdir}/usr/bin/dracut-getarg" + ln -s dracut-util "${initdir}/usr/bin/dracut-getargs" +diff --git a/test/TEST-35-ISCSI-MULTI/test.sh b/test/TEST-35-ISCSI-MULTI/test.sh +index 09b939ab..628131e0 100755 +--- a/test/TEST-35-ISCSI-MULTI/test.sh ++++ b/test/TEST-35-ISCSI-MULTI/test.sh +@@ -174,6 +174,7 @@ test_setup() { + inst_simple /etc/os-release + + inst_simple "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh" ++ inst_simple "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh" + inst_binary "${basedir}/dracut-util" "/usr/bin/dracut-util" + ln -s dracut-util "${initdir}/usr/bin/dracut-getarg" + ln -s dracut-util "${initdir}/usr/bin/dracut-getargs" +diff --git a/test/TEST-40-NBD/test.sh b/test/TEST-40-NBD/test.sh +index df1bcb2f..178dff40 100755 +--- a/test/TEST-40-NBD/test.sh ++++ b/test/TEST-40-NBD/test.sh +@@ -219,6 +219,7 @@ make_encrypted_root() { + inst_multiple -o ${_terminfodir}/l/linux + + inst_simple "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh" ++ inst_simple "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh" + inst_binary "${basedir}/dracut-util" "/usr/bin/dracut-util" + ln -s dracut-util "${initdir}/usr/bin/dracut-getarg" + ln -s dracut-util "${initdir}/usr/bin/dracut-getargs" +@@ -299,6 +300,7 @@ make_client_root() { + inst_multiple -o ${_terminfodir}/l/linux + + inst_simple "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh" ++ inst_simple "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh" + inst_binary "${basedir}/dracut-util" "/usr/bin/dracut-util" + ln -s dracut-util "${initdir}/usr/bin/dracut-getarg" + ln -s dracut-util "${initdir}/usr/bin/dracut-getargs" +diff --git a/test/TEST-50-MULTINIC/test.sh b/test/TEST-50-MULTINIC/test.sh +index e96cef7c..81b1f685 100755 +--- a/test/TEST-50-MULTINIC/test.sh ++++ b/test/TEST-50-MULTINIC/test.sh +@@ -270,6 +270,7 @@ test_setup() { + done + + inst_simple "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh" ++ inst_simple "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh" + inst_binary "${basedir}/dracut-util" "/usr/bin/dracut-util" + ln -s dracut-util "${initdir}/usr/bin/dracut-getarg" + ln -s dracut-util "${initdir}/usr/bin/dracut-getargs" +diff --git a/test/TEST-98-GETARG/test.sh b/test/TEST-98-GETARG/test.sh +index 9a00470b..012396ba 100755 +--- a/test/TEST-98-GETARG/test.sh ++++ b/test/TEST-98-GETARG/test.sh +@@ -15,6 +15,7 @@ test_setup() { + ln -sfnr "$basedir"/dracut-util "$TESTDIR"/dracut-getarg + ln -sfnr "$basedir"/dracut-util "$TESTDIR"/dracut-getargs + ln -sfnr "$basedir"/modules.d/99base/dracut-lib.sh "$TESTDIR"/dracut-lib.sh ++ ln -sfnr "$basedir"/modules.d/99base/dracut-dev-lib.sh "$TESTDIR"/dracut-dev-lib.sh + return 0 + } + +@@ -85,6 +86,7 @@ test_run() { + + export PATH=".:$PATH" + ++ . dracut-dev-lib.sh + . dracut-lib.sh + + debug_off() { + diff --git a/0004.patch b/0004.patch new file mode 100644 index 0000000..9736fbe --- /dev/null +++ b/0004.patch @@ -0,0 +1,38 @@ +From 7275c6f6a0f6808cd939ea5bdf1244c7bd13ba44 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Mon, 17 May 2021 14:22:10 +0200 +Subject: [PATCH] feat(dracut.sh): detect running in a container + +Don't try to `mknod` by setting DRACUT_NO_MKNOD. +Don't try to `cp` extended attributrs by setting DRACUT_NO_XATTR. +--- + dracut.sh | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/dracut.sh b/dracut.sh +index bfb7a1ac..24e1c2e7 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -1171,6 +1171,13 @@ if [[ -f $dracutbasedir/dracut-version.sh ]]; then + . "$dracutbasedir"/dracut-version.sh + fi + ++if systemd-detect-virt -c &> /dev/null; then ++ export DRACUT_NO_MKNOD=1 DRACUT_NO_XATTR=1 ++ if [[ $hostonly ]]; then ++ printf "%s\n" "dracut: WARNING: running in hostonly mode in a container!!" ++ fi ++fi ++ + if [[ -f $dracutbasedir/dracut-init.sh ]]; then + # shellcheck source=./dracut-init.sh + . "$dracutbasedir"/dracut-init.sh +@@ -1888,7 +1895,7 @@ if [[ $kernel_only != yes ]]; then + # shellcheck disable=SC2174 + mkdir -m 0755 -p "${initdir}/lib/dracut/hooks/$_d" + done +- if [[ $EUID == "0" ]]; then ++ if [[ $EUID == "0" ]] && ! [[ $DRACUT_NO_MKNOD ]]; then + [[ -c ${initdir}/dev/null ]] || mknod "${initdir}"/dev/null c 1 3 + [[ -c ${initdir}/dev/kmsg ]] || mknod "${initdir}"/dev/kmsg c 1 11 + [[ -c ${initdir}/dev/console ]] || mknod "${initdir}"/dev/console c 5 1 diff --git a/dracut.spec b/dracut.spec index b30a82a..683454b 100644 --- a/dracut.spec +++ b/dracut.spec @@ -5,10 +5,10 @@ # strip the automatically generated dep here and instead co-own the # directory. %global __requires_exclude pkg-config -%define dist_free_release 5 +%define dist_free_release 5.git20210517 Name: dracut -Version: 053 +Version: 054 Release: %{dist_free_release}%{?dist} Summary: Initramfs generator using udev @@ -21,38 +21,21 @@ Group: System/Base # The entire source code is GPLv2+ # except install/* which is LGPLv2+ -License: GPLv2+ and LGPLv2+ +# except util/* which is GPLv2 +License: GPLv2+ and LGPLv2+ and GPLv2 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.patch +Patch2: 0002.patch +Patch3: 0003.patch +Patch4: 0004.patch Source1: https://www.gnu.org/licenses/lgpl-2.1.txt -# https://github.com/dracutdevs/dracut/commit/ba4bcf5f4f11ad624c647ddf4f566997186135e7 -# Fixes boot failure with some encrypted LVM configurations, see: -# https://bugzilla.redhat.com/show_bug.cgi?id=1946074 -# https://bugzilla.redhat.com/show_bug.cgi?id=1945596 -Patch0: 0001-fix-network-manager-no-default-deps-for-nm-run.servi.patch -# https://bugzilla.redhat.com/show_bug.cgi?id=1936781#c6 -# Should fix loss of critical system files with kdump enabled -Patch1: 0001-Partially-revert-41cfdfc-to-fix-RHBZ-1936781-per-ryn.patch -# Fix logger error when building initramfs -# https://github.com/dracutdevs/dracut/pull/1351 -Patch2: 0001-fix-dracut-logger.sh-double-dash-trigger-unknown-log.patch -# Fix issue where teaming would get brought down by systemd -# https://github.com/dracutdevs/dracut/pull/1349 -Patch3: 0001-fix-network-manager-nm-run.service-don-t-kill-forked.patch -# Fix issue where NM was getting brought up unconditionally -# https://github.com/dracutdevs/dracut/pull/1347 -Patch4: 0001-fix-network-manager-only-run-NetworkManager-if-rd.ne.patch -Patch5: 0002-fix-network-manager-use-run-NetworkManager-initrd-ne.patch -# add watchdog drivers for generic initrd -# https://github.com/dracutdevs/dracut/pull/1377 -Patch6: 0001-fix-90kernel-modules-add-watchdog-drivers-for-generi.patch - BuildRequires: bash BuildRequires: git-core BuildRequires: pkgconfig(libkmod) >= 23 @@ -78,11 +61,6 @@ BuildRequires: docbook-xsl-stylesheets libxslt BuildRequires: asciidoc %endif -%if 0%{?suse_version} > 9999 -Obsoletes: mkinitrd < 2.6.1 -Provides: mkinitrd = 2.6.1 -%endif - Obsoletes: dracut-fips <= 047 Provides: dracut-fips = %{version}-%{release} Obsoletes: dracut-fips-aesni <= 047 @@ -287,9 +265,7 @@ rm -f $RPM_BUILD_ROOT%{_mandir}/man?/*suse* %endif %if 0%{?fedora} == 0 && 0%{?rhel} == 0 && 0%{?suse_version} <= 9999 -rm -f -- $RPM_BUILD_ROOT%{_bindir}/mkinitrd rm -f -- $RPM_BUILD_ROOT%{_bindir}/lsinitrd -rm -f -- $RPM_BUILD_ROOT%{_mandir}/man8/mkinitrd.8* rm -f -- $RPM_BUILD_ROOT%{_mandir}/man1/lsinitrd.1* %endif @@ -298,7 +274,7 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ %files %if %{with doc} -%doc README.md HACKING.md AUTHORS NEWS.md dracut.html dracut.png dracut.svg +%doc README.md docs/HACKING.md AUTHORS NEWS.md dracut.html docs/dracut.png docs/dracut.svg %endif %{!?_licensedir:%global license %%doc} %license COPYING lgpl-2.1.txt @@ -306,7 +282,6 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ %{_datadir}/bash-completion/completions/dracut %{_datadir}/bash-completion/completions/lsinitrd %if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} > 9999 -%{_bindir}/mkinitrd %{_bindir}/lsinitrd %endif %dir %{dracutlibdir} @@ -318,6 +293,7 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ %{dracutlibdir}/dracut-logger.sh %{dracutlibdir}/dracut-initramfs-restore %{dracutlibdir}/dracut-install +%{dracutlibdir}/dracut-util %{dracutlibdir}/skipcpio %config(noreplace) %{_sysconfdir}/dracut.conf %if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} @@ -332,12 +308,8 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ %{_mandir}/man8/dracut.8* %{_mandir}/man8/*service.8* %if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} > 9999 -%{_mandir}/man8/mkinitrd.8* %{_mandir}/man1/lsinitrd.1* %endif -%if 0%{?suse_version} -%{_mandir}/man8/mkinitrd-suse.8* -%endif %{_mandir}/man7/dracut.kernel.7* %{_mandir}/man7/dracut.cmdline.7* %{_mandir}/man7/dracut.modules.7* @@ -349,19 +321,32 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ %endif %{dracutlibdir}/modules.d/00bash %{dracutlibdir}/modules.d/00systemd +%{dracutlibdir}/modules.d/00systemd-network-management %ifnarch s390 s390x %{dracutlibdir}/modules.d/00warpclock %endif %if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} %{dracutlibdir}/modules.d/01fips %endif +%{dracutlibdir}/modules.d/01systemd-ac-power %{dracutlibdir}/modules.d/01systemd-ask-password %{dracutlibdir}/modules.d/01systemd-coredump +%{dracutlibdir}/modules.d/01systemd-hostnamed %{dracutlibdir}/modules.d/01systemd-initrd +%{dracutlibdir}/modules.d/01systemd-journald +%{dracutlibdir}/modules.d/01systemd-ldconfig %{dracutlibdir}/modules.d/01systemd-modules-load %{dracutlibdir}/modules.d/01systemd-repart +%{dracutlibdir}/modules.d/01systemd-resolved +%{dracutlibdir}/modules.d/01systemd-rfkill +%{dracutlibdir}/modules.d/01systemd-sysext %{dracutlibdir}/modules.d/01systemd-sysctl %{dracutlibdir}/modules.d/01systemd-sysusers +%{dracutlibdir}/modules.d/01systemd-timedated +%{dracutlibdir}/modules.d/01systemd-timesyncd +%{dracutlibdir}/modules.d/01systemd-tmpfiles +%{dracutlibdir}/modules.d/01systemd-udevd +%{dracutlibdir}/modules.d/01systemd-veritysetup %{dracutlibdir}/modules.d/03modsign %{dracutlibdir}/modules.d/03rescue %{dracutlibdir}/modules.d/04watchdog @@ -376,6 +361,7 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ %{dracutlibdir}/modules.d/45url-lib %{dracutlibdir}/modules.d/50drm %{dracutlibdir}/modules.d/50plymouth +%{dracutlibdir}/modules.d/62bluetooth %{dracutlibdir}/modules.d/80lvmmerge %{dracutlibdir}/modules.d/90btrfs %{dracutlibdir}/modules.d/90crypt @@ -391,6 +377,7 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ %{dracutlibdir}/modules.d/90qemu %{dracutlibdir}/modules.d/91crypt-gpg %{dracutlibdir}/modules.d/91crypt-loop +%{dracutlibdir}/modules.d/91tpm2-tss %{dracutlibdir}/modules.d/95debug %{dracutlibdir}/modules.d/95fstab-sys %{dracutlibdir}/modules.d/95lunmask @@ -451,7 +438,7 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ %{_prefix}/lib/kernel/install.d/50-dracut.install %files network -%{dracutlibdir}/modules.d/02systemd-networkd +%{dracutlibdir}/modules.d/01systemd-networkd %{dracutlibdir}/modules.d/35network-manager %{dracutlibdir}/modules.d/35network-legacy %{dracutlibdir}/modules.d/35network-wicked @@ -501,6 +488,9 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ %{_prefix}/lib/kernel/install.d/51-dracut-rescue.install %changelog +* Mon May 17 2021 Harald Hoyer - 054-4.git20210517 +- version 054 + * Thu Apr 22 2021 Peter Robinson - 053-5 - Backport: fix(90kernel-modules): add watchdog drivers for generic initrd (rhbz 1592148) diff --git a/sources b/sources index e5f97ee..e2febc9 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (dracut-053.tar.xz) = 4736f84442bda208a38d3285ffeb8b845f06e52e3bf60d2aaea121240cf695e1369208c2d2cee1137a6c1d3f8f7794385675006beaf5cd86ade259d5f42d039a +SHA512 (dracut-054.tar.xz) = 7cff87b9cc6c7323044610c4ddda9685a8eba4ebd320fa39071707d6c324ed69da722ecb0257be9bbf2bb8bc11fed6a3dc7c34c5d8229e00b6f261835a33503b