From 9708fc17446008c757e1f93ea60c347f4756b99f Mon Sep 17 00:00:00 2001 From: Dessa Simpson Date: Tue, 5 Dec 2023 23:26:47 -0700 Subject: [PATCH] Allow overriding boot.ini.template --- docker/startup.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/docker/startup.sh b/docker/startup.sh index 54f541f..19f5b60 100755 --- a/docker/startup.sh +++ b/docker/startup.sh @@ -10,11 +10,13 @@ if [ -f "/mnt/$DISK_FILENAME" ]; then [ -w "/mnt/$DISK_FILENAME" ] || { echo "Disk /mnt/$DISK_FILENAME exists and is not writable"; exit 1; } echo "Disk found and is writable." else - [ -w "/mnt/" ] || { echo "Disk /mnt/$DISK_FILENAME not found and /mnt not writable"; exit 1; } - [ -f "/rq0.dsk.gz" ] || { echo "Disk /mnt/$DISK_FILENAME not found and image was not built with a default disk"; exit 1; } - echo "Disk not found." - echo "Extracting default disk image..." - gzip -cd /rq0.dsk.gz > "/mnt/$DISK_FILENAME" || { echo "Failed to extract default disk image to /mnt/$DISK_FILENAME"; exit 1; } + [ -w "/mnt/" ] || { echo "Disk /mnt/$DISK_FILENAME not found and /mnt not writable"; exit 1; } + [ -f "/rq0.dsk.gz" ] || + { echo "Disk /mnt/$DISK_FILENAME not found and image was not built with a default disk"; exit 1; } + echo "Disk not found." + echo "Extracting default disk image..." + gzip -cd /rq0.dsk.gz > "/mnt/$DISK_FILENAME" || + { echo "Failed to extract default disk image to /mnt/$DISK_FILENAME"; exit 1; } fi # Start CoreDNS as soon as possible after validations done @@ -26,6 +28,8 @@ coredns "$COREDNS_QUIET" -conf /Corefile & [ -z "$NOEXIT" ] && EXIT_CMD="exit" || EXIT_CMD="" echo "Configuring simh..." +# Allow overriding boot.ini.template +[ -f /mnt/boot.ini.template ] && cp -f /mnt/boot.ini.template /mnt/boot.ini.template sed -e "s//${DISK_FILENAME}/" \ -e "s//${EXIT_CMD}/" /boot.ini.template > /boot.ini