summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/rcutorture
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@kernel.org>2023-07-14 03:29:36 +0200
committerPaul E. McKenney <paulmck@kernel.org>2023-07-21 02:54:53 +0200
commit7c25ee819f39a6c84d5fbe87fee4a7f78dd204a1 (patch)
treee6dbf7cd267e770cad31e7e86024ccc66b818f23 /tools/testing/selftests/rcutorture
parenttorture: Make init program dump command-line arguments (diff)
downloadlinux-7c25ee819f39a6c84d5fbe87fee4a7f78dd204a1.tar.xz
linux-7c25ee819f39a6c84d5fbe87fee4a7f78dd204a1.zip
torture: Cause mkinitrd.sh to indicate failure on compile errors
Currently, if the C program created by mkinitrd.sh has compile errors, the errors are printed, but kvm.sh soldiers on, building kernels that have init-less initrd setups. The kernels then fail on boot when they attempt to mount non-existent root filesystems. This commit therefore improves user friendliness by making mkinitrd.sh return non-zero exit status on compile errors, which in turn causes kvm.sh to take an early exit, with the compile errors still clearly visible. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'tools/testing/selftests/rcutorture')
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/mkinitrd.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/testing/selftests/rcutorture/bin/mkinitrd.sh b/tools/testing/selftests/rcutorture/bin/mkinitrd.sh
index 558f5a669dbd..212c52ca90b5 100755
--- a/tools/testing/selftests/rcutorture/bin/mkinitrd.sh
+++ b/tools/testing/selftests/rcutorture/bin/mkinitrd.sh
@@ -74,8 +74,16 @@ if echo -e "#if __x86_64__||__i386__||__i486__||__i586__||__i686__" \
${CROSS_COMPILE}gcc -fno-asynchronous-unwind-tables -fno-ident \
-nostdlib -include ../../../../include/nolibc/nolibc.h \
-s -static -Os -o init init.c -lgcc
+ ret=$?
else
${CROSS_COMPILE}gcc -s -static -Os -o init init.c
+ ret=$?
+fi
+
+if [ "$ret" -ne 0 ]
+then
+ echo "Failed to create a statically linked C-language initrd"
+ exit "$ret"
fi
rm init.c