From 1d7923f9c4e9d154aebdfc06a11ff048ab8a42ef Mon Sep 17 00:00:00 2001 From: Sam James Date: Wed, 10 Jun 2026 04:51:38 +0100 Subject: [PATCH] sys-kernel/dracut: another dash fix Bug: https://bugs.gentoo.org/971601 Signed-off-by: Sam James --- ...dracut-111.ebuild => dracut-111-r1.ebuild} | 1 + .../dracut/files/dracut-111-dash-printf.patch | 39 +++++++++++++++++++ 2 files changed, 40 insertions(+) rename sys-kernel/dracut/{dracut-111.ebuild => dracut-111-r1.ebuild} (99%) create mode 100644 sys-kernel/dracut/files/dracut-111-dash-printf.patch diff --git a/sys-kernel/dracut/dracut-111.ebuild b/sys-kernel/dracut/dracut-111-r1.ebuild similarity index 99% rename from sys-kernel/dracut/dracut-111.ebuild rename to sys-kernel/dracut/dracut-111-r1.ebuild index 4cea390792b29..7a25f4bd26cea 100644 --- a/sys-kernel/dracut/dracut-111.ebuild +++ b/sys-kernel/dracut/dracut-111-r1.ebuild @@ -103,6 +103,7 @@ QA_MULTILIB_PATHS="usr/lib/dracut/.*" PATCHES=( "${FILESDIR}"/gentoo-ldconfig-paths-r1.patch + "${FILESDIR}"/${PN}-111-dash-printf.patch ) pkg_setup() { diff --git a/sys-kernel/dracut/files/dracut-111-dash-printf.patch b/sys-kernel/dracut/files/dracut-111-dash-printf.patch new file mode 100644 index 0000000000000..a4564d010230d --- /dev/null +++ b/sys-kernel/dracut/files/dracut-111-dash-printf.patch @@ -0,0 +1,39 @@ +https://bugs.gentoo.org/971601 +https://github.com/dracut-ng/dracut/pull/2453 + +From cd2b33734f3cbead1e0f728ac838252cf16535f4 Mon Sep 17 00:00:00 2001 +From: fiftydinar <65243233+fiftydinar@users.noreply.github.com> +Date: Thu, 28 May 2026 17:07:19 +0200 +Subject: [PATCH] fix(base): use printf instead of echo for hook variable + +Use printf instead of echo in list_hooks() to avoid dash's echo interpreting \x2f hex escapes, which corrupts hook file paths containing escaped slashes. + +1. parse-root.sh creates a hook file with \x2f-escaped device paths via str_replace() +2. list_hooks() finds the file via glob but outputs it with echo, which dash interprets as hex escapes +3. The corrupted path causes check_finished() to never find the real hook, looping until timeout (~5 min boot delay) +--- + modules.d/80base/dracut-lib.sh | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/modules.d/80base/dracut-lib.sh b/modules.d/80base/dracut-lib.sh +index 339567d9a..09b20bf5b 100755 +--- a/modules.d/80base/dracut-lib.sh ++++ b/modules.d/80base/dracut-lib.sh +@@ -378,14 +378,14 @@ list_hooks() { + # priority, '/etc/dracut/hooks' comes after and '/usr/lib/dracut/hooks' is the + # least priviliged location. + for hook in "/var/lib/dracut/hooks/$dir/"$pattern; do +- [ -f "$hook" ] && echo "$hook" ++ [ -f "$hook" ] && printf '%s\n' "$hook" + done + for hook in "/etc/dracut/hooks/$dir/"$pattern; do +- [ -f "$hook" ] && [ ! -f "/var/lib/dracut/hooks/$dir/${hook##*/}" ] && echo "$hook" ++ [ -f "$hook" ] && [ ! -f "/var/lib/dracut/hooks/$dir/${hook##*/}" ] && printf '%s\n' "$hook" + done + for hook in "/usr/lib/dracut/hooks/$dir/"$pattern; do + [ -f "$hook" ] && [ ! -f "/var/lib/dracut/hooks/$dir/${hook##*/}" ] \ +- && [ ! -f "/etc/dracut/hooks/$dir/${hook##*/}" ] && echo "$hook" ++ && [ ! -f "/etc/dracut/hooks/$dir/${hook##*/}" ] && printf '%s\n' "$hook" + done + } +