]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut.sh: suppress "ignored null byte in input" warning
authorJonas Witschel <diabonas@gmx.de>
Fri, 30 Aug 2019 12:45:15 +0000 (14:45 +0200)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Tue, 3 Sep 2019 11:28:56 +0000 (11:28 +0000)
Since Bash 4.4, command substitutions containing null bytes produce a
warning of the form

/usr/sbin/dracut: line 1958: warning: command substitution: ignored null byte in input

Remove the trailing null byte from the UEFI kernel command line file
before printing it to suppress this warning.

dracut.sh

index 31eb97d55d7a51e0d298ab220c5e8022b19cbfbf..87fcddfed672ca642fca6fc551846a9a77958fa8 100755 (executable)
--- a/dracut.sh
+++ b/dracut.sh
@@ -1955,7 +1955,7 @@ if [[ $uefi = yes ]]; then
     echo -ne "\x00" >> "$uefi_outdir/cmdline.txt"
 
     dinfo "Using UEFI kernel cmdline:"
-    dinfo $(< "$uefi_outdir/cmdline.txt")
+    dinfo $(tr -d '\000' < "$uefi_outdir/cmdline.txt")
 
     [[ -s /usr/lib/os-release ]] && uefi_osrelease="/usr/lib/os-release"
     [[ -s /etc/os-release ]] && uefi_osrelease="/etc/os-release"