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 <lveyde@redhat.com>
xz="$(/bin/echo -e '\xfd7zXZ')"
gz="$(/bin/echo -e '\x1f\x8b')"
zs="$(/bin/echo -e '\x28\xB5\x2F\xFD')"
- headerblock="$(dd ${1:+if=$1} bs=262 count=1 2> /dev/null)"
+ headerblock="$(dd ${1:+if=$1} bs=262 count=1 2> /dev/null | tr -d '\0')"
case "$headerblock" in
$xz*) echo "xz" ;;
$gz*) echo "gzip" ;;
# called by dracut
check() {
- require_binaries tar gzip dd echo || return 1
+ require_binaries tar gzip dd echo tr || return 1
return 255
}
# called by dracut
install() {
- inst_multiple tar gzip dd echo
+ inst_multiple tar gzip dd echo 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"