From: Mimi Zohar Date: Wed, 24 Nov 2021 07:08:00 +0000 (+0530) Subject: selftest/kexec: fix "ignored null byte in input" warning X-Git-Tag: howlett/maple/20220722_2~1465^2~3 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=cef5cd25a453805237f0c4e789218d987d674290;p=users%2Fjedix%2Flinux-maple.git selftest/kexec: fix "ignored null byte in input" warning Instead of assigning the string to a variable, which might contain a null character, redirect the output and grep for the string directly. Reviewed-by: Petr Vorel Signed-off-by: Mimi Zohar --- diff --git a/tools/testing/selftests/kexec/test_kexec_file_load.sh b/tools/testing/selftests/kexec/test_kexec_file_load.sh index 2ff600388c30b..99f6fc23ee314 100755 --- a/tools/testing/selftests/kexec/test_kexec_file_load.sh +++ b/tools/testing/selftests/kexec/test_kexec_file_load.sh @@ -97,10 +97,11 @@ check_for_imasig() check_for_modsig() { local module_sig_string="~Module signature appended~" - local sig="$(tail --bytes $((${#module_sig_string} + 1)) $KERNEL_IMAGE)" local ret=0 - if [ "$sig" == "$module_sig_string" ]; then + tail --bytes $((${#module_sig_string} + 1)) $KERNEL_IMAGE | \ + grep -q "$module_sig_string" + if [ $? -eq 0 ]; then ret=1 log_info "kexec kernel image modsig signed" else