Skip to content

Commit

Permalink
rcutorture: Check initrd/init instead of initrd only
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Willy Tarreau authored and Paul E. McKenney committed Nov 9, 2018
1 parent 18d7bf8 commit 825fa4c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tools/testing/selftests/rcutorture/bin/mkinitrd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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>
Expand Down

0 comments on commit 825fa4c

Please sign in to comment.