Skip to content

Commit 85eb968

Browse files
lveydeharaldh
authored andcommitted
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 <[email protected]>
1 parent 782ac8f commit 85eb968

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

modules.d/99img-lib/img-lib.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ det_archive() {
1313
xz="$(/bin/echo -e '\xfd7zXZ')"
1414
gz="$(/bin/echo -e '\x1f\x8b')"
1515
zs="$(/bin/echo -e '\x28\xB5\x2F\xFD')"
16-
headerblock="$(dd ${1:+if=$1} bs=262 count=1 2> /dev/null)"
16+
headerblock="$(dd ${1:+if=$1} bs=262 count=1 2> /dev/null | tr -d '\0')"
1717
case "$headerblock" in
1818
$xz*) echo "xz" ;;
1919
$gz*) echo "gzip" ;;

modules.d/99img-lib/module-setup.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# called by dracut
55
check() {
6-
require_binaries tar gzip dd echo || return 1
6+
require_binaries tar gzip dd echo tr || return 1
77
return 255
88
}
99

@@ -14,7 +14,7 @@ depends() {
1414

1515
# called by dracut
1616
install() {
17-
inst_multiple tar gzip dd echo
17+
inst_multiple tar gzip dd echo tr
1818
# TODO: make this conditional on a cmdline flag / config option
1919
inst_multiple -o cpio xz bzip2 zstd
2020
inst_simple "$moddir/img-lib.sh" "/lib/img-lib.sh"

0 commit comments

Comments
 (0)