From 0c0a0c9f9086503bcabcbd1ac3635de325f1a773 Mon Sep 17 00:00:00 2001 From: aheirman <48590738+aheirman@users.noreply.github.com> Date: Tue, 6 Apr 2021 12:52:44 +0000 Subject: [PATCH] Error if loopback failed in createimg.sh --- createimg.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/createimg.sh b/createimg.sh index de7d8f3..dd450c8 100755 --- a/createimg.sh +++ b/createimg.sh @@ -30,7 +30,11 @@ w PARTITION_START2=$((${PARTITION_START} * 512)) echo "PARTITION_START2: ${PARTITION_START2}" LOOPBACK=$(losetup -o ${PARTITION_START2} -s -f iglunix.img) -echo "LOOPBACK: ${LOOPBACK}" +echo "loopback interface: ${LOOPBACK}" + +#ERROR IF NO LOOPBACK +[ -z "$LOOPBACK" ] && echo "loopback creation failed!" && exit -1 + mke2fs -t ext4 -L "__IGLUNIX_ROOT" ${LOOPBACK} ROOT=/mnt/__IGLUNIX_ROOT @@ -51,6 +55,8 @@ cp /etc/hostname ${ROOT}/hostname echo "Using the host keymap" cp /etc/vconsole.conf ${ROOT}/etc/vconsole.conf +#TODO: this is a systemd file, +# use udev/kbd echo "Unmounting & closing loopback"