@@ -21,13 +21,13 @@ case $target_arch in
21
21
esac
22
22
23
23
# Sanity checks.
24
- [ ! -f " /etc/arch-release" ] && \
24
+ [[ ! -f " /etc/arch-release" ] ] && \
25
25
fatal This script is designed for arch linux only, sorry!
26
26
27
27
check_exists kerndev-create.chroot.sh kerndev-build kerndev-install pacstrap \
28
28
truncate mkfs.ext4 arch-chroot
29
29
30
- [ -n $USE_EXISTING_IMAGE ] && [ ! -f $KERNDEV_PATH /rootfs.img ] && \
30
+ [[ -n $USE_EXISTING_IMAGE ]] && [[ ! -f $KERNDEV_PATH /rootfs.img ] ] && \
31
31
fatal " can't find existing rootfs image"
32
32
33
33
chroot_script_path=$( which kerndev-create.chroot.sh)
@@ -36,7 +36,7 @@ chroot_script_path=$(which kerndev-create.chroot.sh)
36
36
elevate $@
37
37
38
38
# We want access to the underlying user.
39
- [ -z " $SUDO_USER " ] && fatal please run this using sudo!
39
+ [[ -z " $SUDO_USER " ] ] && fatal please run this using sudo!
40
40
41
41
# If this fails due to being unable to unmount /mnt, mount below will fail so we
42
42
# can get away with ||true here.
@@ -46,7 +46,7 @@ mkdir -p $KERNDEV_PATH
46
46
47
47
push_kerndev
48
48
49
- if [ -z " $USE_EXISTING_IMAGE " ]; then
49
+ if [[ -z " $USE_EXISTING_IMAGE " ] ]; then
50
50
echo Creating and formatting rootfs image file...
51
51
rm -f rootfs.img
52
52
truncate -s $IMAGE_SIZE rootfs.img
58
58
mount_image rootfs.img
59
59
trap " umount /mnt" EXIT
60
60
61
- if [ -z " $USE_EXISTING_IMAGE " ]; then
61
+ if [[ -z " $USE_EXISTING_IMAGE " ] ]; then
62
62
echo Downloading and installing rootfs into image...
63
63
pacstrap /mnt base base-devel & > /dev/null
64
64
fi
78
78
79
79
echo ...chroot-ed script complete!
80
80
81
- if [ -z " $USE_EXISTING_IMAGE " ] && [ -n " $ENABLE_GCOV " ]; then
81
+ if [[ -z " $USE_EXISTING_IMAGE " ]] && [[ -n " $ENABLE_GCOV " ] ]; then
82
82
echo Generating gcov script...
83
83
84
84
# Create 'cov' tool to check coverage for a specific file in the kernel tree.
@@ -87,7 +87,7 @@ if [ -z "$USE_EXISTING_IMAGE" ] && [ -n "$ENABLE_GCOV" ]; then
87
87
cat > $cov_path << -EOF
88
88
#!/bin/bash
89
89
90
- [ -z "\$ 1" ] && echo "usage: \$ (basename \$ 0) [relative path to source file]" >&2 && exit 1
90
+ [[ -z "\$ 1" ] ] && echo "usage: \$ (basename \$ 0) [relative path to source file]" >&2 && exit 1
91
91
92
92
# ref: https://goo.gl/rnd6yo
93
93
args=\$ {@:1:-1}
@@ -106,7 +106,7 @@ if [ -z "$USE_EXISTING_IMAGE" ] && [ -n "$ENABLE_GCOV" ]; then
106
106
pop
107
107
fi
108
108
109
- if [ -n " $ACCESS_CHROOT " ]; then
109
+ if [[ -n " $ACCESS_CHROOT " ] ]; then
110
110
echo Entering chroot shell...
111
111
arch-chroot /mnt
112
112
echo ...chroot shell done!
0 commit comments