Improved quoting of variables.
This commit is contained in:
parent
35fc5eccd6
commit
ff41ffabaf
@ -28,8 +28,8 @@ trap cleanup EXIT # make sure the script cleans up after itself before closing.
|
|||||||
cleanup() {
|
cleanup() {
|
||||||
if [[ $mounted -eq 0 ]]; then
|
if [[ $mounted -eq 0 ]]; then
|
||||||
umount -R /mnt
|
umount -R /mnt
|
||||||
partx -d ${loopdev}
|
partx -d "${loopdev}"
|
||||||
losetup --detach ${loopdev}
|
losetup --detach "${loopdev}"
|
||||||
fi
|
fi
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
@ -123,12 +123,12 @@ url[4]="http://os.archlinuxarm.org/os/ArchLinuxARM-rpi-aarch64-latest.tar.gz"
|
|||||||
|
|
||||||
fallocate -l $imageSize "$imageName"
|
fallocate -l $imageSize "$imageName"
|
||||||
loopdev="$(losetup --find --show "${imageName}")"
|
loopdev="$(losetup --find --show "${imageName}")"
|
||||||
parted --script ${loopdev} mklabel msdos mkpart primary fat32 0% 100M mkpart primary ext4 100M 100%
|
parted --script "${loopdev}" mklabel msdos mkpart primary fat32 0% 100M mkpart primary ext4 100M 100%
|
||||||
mkfs.vfat -F32 ${loopdev}p1
|
mkfs.vfat -F32 "${loopdev}p1"
|
||||||
mkfs.ext4 -F ${loopdev}p2
|
mkfs.ext4 -F "${loopdev}p2"
|
||||||
mount ${loopdev}p2 /mnt
|
mount "${loopdev}p2" /mnt
|
||||||
mkdir /mnt/boot
|
mkdir /mnt/boot
|
||||||
mount ${loopdev}p1 /mnt/boot
|
mount "${loopdev}p1" /mnt/boot
|
||||||
# Things are mounted now, so set mounted to 0 (bash true)
|
# Things are mounted now, so set mounted to 0 (bash true)
|
||||||
mounted=0
|
mounted=0
|
||||||
wget "${url[$imageVersion]}" -O- | bsdtar -xpf - -C /mnt
|
wget "${url[$imageVersion]}" -O- | bsdtar -xpf - -C /mnt
|
||||||
|
Loading…
Reference in New Issue
Block a user