From 1a1b1c1436d89c883d3d90293d9d33f1b8d9c30d Mon Sep 17 00:00:00 2001 From: Kroese Date: Sun, 16 Apr 2023 16:11:41 +0200 Subject: [PATCH 1/3] Storage --- run/disk.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/run/disk.sh b/run/disk.sh index 0e50f12..8a0a146 100644 --- a/run/disk.sh +++ b/run/disk.sh @@ -1,10 +1,10 @@ #!/usr/bin/env bash set -eu -BOOT="$IMG/boot.img" +BOOT="$STORAGE/boot.img" [ ! -f "$BOOT" ] && echo "ERROR: Boot image does not exist ($BOOT)" && exit 81 -DATA="${IMG}/data.img" +DATA="${STORAGE}/data.img" DISK_SIZE=$(echo "${DISK_SIZE}" | sed 's/MB/M/g;s/GB/G/g;s/TB/T/g') DATA_SIZE=$(numfmt --from=iec "${DISK_SIZE}") @@ -19,7 +19,7 @@ if [ -f "${DATA}" ]; then REQ=$((DATA_SIZE-OLD_SIZE)) # Check free diskspace - SPACE=$(df --output=avail -B 1 "${IMG}" | tail -n 1) + SPACE=$(df --output=avail -B 1 "${STORAGE}" | tail -n 1) if (( REQ > SPACE )); then echo "ERROR: Not enough free space to resize virtual disk." && exit 84 @@ -45,7 +45,7 @@ fi if [ ! -f "${DATA}" ]; then # Check free diskspace - SPACE=$(df --output=avail -B 1 "${IMG}" | tail -n 1) + SPACE=$(df --output=avail -B 1 "${STORAGE}" | tail -n 1) if (( DATA_SIZE > SPACE )); then echo "ERROR: Not enough free space to create virtual disk." && exit 86 From ce3938370caf1d6dd5b7746a668e7c33d56a07ea Mon Sep 17 00:00:00 2001 From: Kroese Date: Sun, 16 Apr 2023 16:12:18 +0200 Subject: [PATCH 2/3] Storage --- run/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run/install.sh b/run/install.sh index 69071c0..05fe7a5 100644 --- a/run/install.sh +++ b/run/install.sh @@ -21,6 +21,6 @@ if ((SIZE<1000000)); then echo "Invalid ISO file: Size is smaller than 1 MB." && exit 62 fi -FILE="$IMG/boot.img" +FILE="$STORAGE/boot.img" mv -f "$TMP" "$FILE" From 136fc16c91531c710f84dbfde4b6519b4b7d08ba Mon Sep 17 00:00:00 2001 From: Kroese Date: Sun, 16 Apr 2023 16:13:35 +0200 Subject: [PATCH 3/3] Storage --- run/run.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/run/run.sh b/run/run.sh index d33f40b..aa886fe 100755 --- a/run/run.sh +++ b/run/run.sh @@ -3,10 +3,10 @@ set -eu echo "Starting QEMU..." -IMG="/storage" -[ ! -d "$IMG" ] && echo "Storage folder (${IMG}) not found!" && exit 69 +STORAGE="/storage" +[ ! -d "$STORAGE" ] && echo "Storage folder (${STORAGE}) not found!" && exit 69 -if [ -f "$IMG/boot.img" ]; then +if [ -f "$STORAGE/boot.img" ]; then . /run/install.sh fi