summaryrefslogtreecommitdiff
path: root/create_hdd.sh
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2018-02-17 09:57:35 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2018-02-17 09:57:35 +0100
commitf196c39e26f58a561f5c127cba0734f488612c5c (patch)
tree045da57395e4e1b4f71379c7fe78d3f18baa2684 /create_hdd.sh
parentafcf6e9a9d006a2697c92b1069af97708a281a36 (diff)
downloadbootstrap32-f196c39e26f58a561f5c127cba0734f488612c5c.tar.xz
fixed all shellcheck bugs
Diffstat (limited to 'create_hdd.sh')
-rwxr-xr-xcreate_hdd.sh9
1 files changed, 5 insertions, 4 deletions
diff --git a/create_hdd.sh b/create_hdd.sh
index d1d735c..3170a64 100755
--- a/create_hdd.sh
+++ b/create_hdd.sh
@@ -1,11 +1,12 @@
#!/bin/sh
+# shellcheck source=./default.conf
. "./default.conf"
# builds a hard disk image for a stage 1 system:
# no ramdisk, no modules, no fancy startup, just a shell script
-cd $CROSS_HOME
+cd $CROSS_HOME || exit 1
umount mnt
rm -rf mnt
@@ -27,7 +28,7 @@ mkdir mnt
sudo mount /dev/loop2p1 mnt
sudo cp -a i486-root/* mnt/.
sudo chown -R cross:cross mnt/.
-cd mnt
+cd mnt || exit 1
# A simple ISOlinux boot loader booting from first partition, starting
# uinit wich start /etc/init/boot
@@ -78,7 +79,7 @@ ssh-keygen -b 521 -t ecdsa -f etc/ssh/ssh_host_ecdsa_key -N ''
ssh-keygen -b 2048 -t ed25519 -f etc/ssh/ssh_host_ed25519_key -N ''
chmod 0400 etc/ssh/ssh_host_*_key
mkdir root/.ssh
-cp $HOME/.ssh/id_rsa.pub root/.ssh/authorized_keys
+cp "$HOME/.ssh/id_rsa.pub" root/.ssh/authorized_keys
# add some test programs to test the C and C++ compiler
@@ -113,7 +114,7 @@ sudo chmod 0775 etc/init/boot
# umount and clean up partitions and loopback devices
-cd ..
+cd .. || exit 1
sudo umount mnt
sudo partx -v --delete /dev/loop2
sudo losetup -d /dev/loop2