diff options
| author | Willy Tarreau <w@1wt.eu> | 2018-09-09 05:46:48 -0400 |
|---|---|---|
| committer | Paul E. McKenney <paulmck@linux.ibm.com> | 2018-11-09 00:52:55 -0500 |
| commit | 825fa4cdfb10d8cbf784ebdadd6d5d93130a0cb5 (patch) | |
| tree | 05ade42035e34f4ad243ab2974df2b3fc77c6119 | |
| parent | 18d7bf8ed3a1628ee653d3abde051703642ecd60 (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-x | tools/testing/selftests/rcutorture/bin/mkinitrd.sh | 8 |
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 |
| 30 | fi | 30 | fi |
| 31 | if [ -d "$D/initrd" ]; then | 31 | if [ -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 |
| 34 | fi | 34 | fi |
| 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. |
| 80 | echo "Could not find dracut, attempting C initrd" | 80 | echo "Could not find dracut, attempting C initrd" |
| 81 | cd $D | 81 | cd $D |
| 82 | mkdir initrd | 82 | mkdir -p initrd |
| 83 | cd initrd | 83 | cd initrd |
| 84 | cat > init.c << '___EOF___' | 84 | cat > init.c << '___EOF___' |
| 85 | #include <unistd.h> | 85 | #include <unistd.h> |
