From 5284eb01986ab128dc0f2411bf2c5dddcbb2e7ad Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Fri, 31 Mar 2023 01:23:23 +0200 Subject: [PATCH] dracut-049-224.git20230330 Resolves: #1952400 --- 0223.patch | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++ dracut.spec | 6 +++++- 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 0223.patch diff --git a/0223.patch b/0223.patch new file mode 100644 index 0000000..26eb9e9 --- /dev/null +++ b/0223.patch @@ -0,0 +1,55 @@ +From 8525d05be0896f5016e71d501d979ece02373ac1 Mon Sep 17 00:00:00 2001 +From: Lev Veyde +Date: Thu, 22 Apr 2021 01:11:55 +0300 +Subject: [PATCH] fix(img-lib): ignored null byte in input + +The system currently throws numerous nasty warning messages during +the boot, about ignored null bytes in input. + +This patch adds a filter to the dd command, to filter these null +bytes out, and thus to prevent these warning messages. + +Signed-off-by: Lev Veyde + +(Cherry-picked from commit: cf04e49512c244dae5d785869ebfb9c8f4710c7e) +Resolves: rhbz#1952400 +--- + modules.d/99img-lib/img-lib.sh | 2 +- + modules.d/99img-lib/module-setup.sh | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/modules.d/99img-lib/img-lib.sh b/modules.d/99img-lib/img-lib.sh +index f4774153..ada35ccb 100755 +--- a/modules.d/99img-lib/img-lib.sh ++++ b/modules.d/99img-lib/img-lib.sh +@@ -9,7 +9,7 @@ + det_archive() { + # NOTE: echo -e works in ash and bash, but not dash + local bz="BZh" xz="$(echo -e '\xfd7zXZ')" gz="$(echo -e '\x1f\x8b')" zs="$(echo -e '\x28\xB5\x2F\xFD')" +- local headerblock="$(dd ${1:+if=$1} bs=262 count=1 2>/dev/null)" ++ local headerblock="$(dd ${1:+if=$1} bs=262 count=1 2>/dev/null | tr -d '\0')" + case "$headerblock" in + $xz*) echo "xz" ;; + $gz*) echo "gzip" ;; +diff --git a/modules.d/99img-lib/module-setup.sh b/modules.d/99img-lib/module-setup.sh +index fe1eca1a..92c1d1dd 100755 +--- a/modules.d/99img-lib/module-setup.sh ++++ b/modules.d/99img-lib/module-setup.sh +@@ -3,7 +3,7 @@ + + # called by dracut + check() { +- require_binaries tar gzip dd bash || return 1 ++ require_binaries tar gzip dd bash tr || return 1 + return 255 + } + +@@ -14,7 +14,7 @@ depends() { + + # called by dracut + install() { +- inst_multiple tar gzip dd bash ++ inst_multiple tar gzip dd bash tr + # TODO: make this conditional on a cmdline flag / config option + inst_multiple -o cpio xz bzip2 zstd + inst_simple "$moddir/img-lib.sh" "/lib/img-lib.sh" diff --git a/dracut.spec b/dracut.spec index 0cdb185..98750ec 100644 --- a/dracut.spec +++ b/dracut.spec @@ -5,7 +5,7 @@ # strip the automatically generated dep here and instead co-own the # directory. %global __requires_exclude pkg-config -%define dist_free_release 223.git20230119 +%define dist_free_release 224.git20230330 Name: dracut Version: 049 @@ -250,6 +250,7 @@ Patch219: 0219.patch Patch220: 0220.patch Patch221: 0221.patch Patch222: 0222.patch +Patch223: 0223.patch Source1: https://www.gnu.org/licenses/lgpl-2.1.txt @@ -704,6 +705,9 @@ echo '# Since rhel-8.3 dracut moved to use NetworkManager add_dracutmodules+=" network-legacy "' > /etc/dracut.conf.d/50-network-legacy.conf %changelog +* Fri Mar 31 2023 Pavel Valena - 049-224.git20230330 +- fix(img-lib): ignored null byte in input + * Thu Jan 19 2023 Pavel Valena - 049-223.git20230119 - fix(dracut-init): use ldconfig directly instead of - fix(dracut-init.sh): backport common paths