aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilly Tarreau <w@1wt.eu>2018-09-09 05:46:48 -0400
committerPaul E. McKenney <paulmck@linux.ibm.com>2018-11-09 00:52:55 -0500
commit825fa4cdfb10d8cbf784ebdadd6d5d93130a0cb5 (patch)
tree05ade42035e34f4ad243ab2974df2b3fc77c6119
parent18d7bf8ed3a1628ee653d3abde051703642ecd60 (diff)
rcutorture: Check initrd/init instead of initrd only
If the build fails, we can end up with an empty initrd directory which prevents the build script from operating again. Better rely on the resulting init executable instead. Signed-off-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/mkinitrd.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/testing/selftests/rcutorture/bin/mkinitrd.sh b/tools/testing/selftests/rcutorture/bin/mkinitrd.sh
index dbb6f0160281..56a56ea06983 100755
--- a/tools/testing/selftests/rcutorture/bin/mkinitrd.sh
+++ b/tools/testing/selftests/rcutorture/bin/mkinitrd.sh
@@ -28,8 +28,8 @@ if [ ! -d "$D" ]; then
28 echo >&2 "$D does not exist: Malformed kernel source tree?" 28 echo >&2 "$D does not exist: Malformed kernel source tree?"
29 exit 1 29 exit 1
30fi 30fi
31if [ -d "$D/initrd" ]; then 31if [ -s "$D/initrd/init" ]; then
32 echo "$D/initrd already exists, no need to create it" 32 echo "$D/initrd/init already exists, no need to create it"
33 exit 0 33 exit 0
34fi 34fi
35 35
@@ -65,7 +65,7 @@ then
65 # Filesystem creation 65 # Filesystem creation
66 dracut --force --no-hostonly --no-hostonly-cmdline --module "base" $T/initramfs.img 66 dracut --force --no-hostonly --no-hostonly-cmdline --module "base" $T/initramfs.img
67 cd $D 67 cd $D
68 mkdir initrd 68 mkdir -p initrd
69 cd initrd 69 cd initrd
70 zcat $T/initramfs.img | cpio -id 70 zcat $T/initramfs.img | cpio -id
71 cp $T/init init 71 cp $T/init init
@@ -79,7 +79,7 @@ fi
79# future-proof than dracut. 79# future-proof than dracut.
80echo "Could not find dracut, attempting C initrd" 80echo "Could not find dracut, attempting C initrd"
81cd $D 81cd $D
82mkdir initrd 82mkdir -p initrd
83cd initrd 83cd initrd
84cat > init.c << '___EOF___' 84cat > init.c << '___EOF___'
85#include <unistd.h> 85#include <unistd.h>