aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/rcutorture/bin/mkinitrd.sh
diff options
context:
space:
mode:
authorWilly Tarreau <w@1wt.eu>2018-09-09 11:46:48 +0200
committerPaul E. McKenney <paulmck@linux.ibm.com>2018-11-08 21:52:55 -0800
commit825fa4cdfb10d8cbf784ebdadd6d5d93130a0cb5 (patch)
tree05ade42035e34f4ad243ab2974df2b3fc77c6119 /tools/testing/selftests/rcutorture/bin/mkinitrd.sh
parentrcutorture: Always strip using the cross-compiler (diff)
downloadlinux-dev-825fa4cdfb10d8cbf784ebdadd6d5d93130a0cb5.tar.xz
linux-dev-825fa4cdfb10d8cbf784ebdadd6d5d93130a0cb5.zip
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>
Diffstat (limited to '')
-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
echo >&2 "$D does not exist: Malformed kernel source tree?"
exit 1
fi
-if [ -d "$D/initrd" ]; then
- echo "$D/initrd already exists, no need to create it"
+if [ -s "$D/initrd/init" ]; then
+ echo "$D/initrd/init already exists, no need to create it"
exit 0
fi
@@ -65,7 +65,7 @@ then
# Filesystem creation
dracut --force --no-hostonly --no-hostonly-cmdline --module "base" $T/initramfs.img
cd $D
- mkdir initrd
+ mkdir -p initrd
cd initrd
zcat $T/initramfs.img | cpio -id
cp $T/init init
@@ -79,7 +79,7 @@ fi
# future-proof than dracut.
echo "Could not find dracut, attempting C initrd"
cd $D
-mkdir initrd
+mkdir -p initrd
cd initrd
cat > init.c << '___EOF___'
#include <unistd.h>