Allow overriding boot.ini.template

master
Dessa Simpson 2023-12-05 23:26:47 -07:00
parent cc45226e7d
commit 9708fc1744
1 changed files with 9 additions and 5 deletions

View File

@ -11,10 +11,12 @@ if [ -f "/mnt/$DISK_FILENAME" ]; then
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; }
[ -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; }
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>/${DISK_FILENAME}/" \
-e "s/<EXIT>/${EXIT_CMD}/" /boot.ini.template > /boot.ini