fix(iso): honor TMPDIR for the QEMU boot-test disk/serial log

Both the 20G sparse qcow2 test disk and the serial console log were
hardcoded to /tmp regardless of $TMPDIR, so pointing the ISO release
build at a disk-backed scratch dir (to avoid tmpfs space pressure)
would not have covered this stage. Falls back to /tmp when TMPDIR is
unset — no behavior change for existing callers.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
archipelago 2026-07-31 19:46:12 -04:00
parent c4e1375c81
commit 6c2b6668dc

View File

@ -8,10 +8,14 @@
# --bios Force legacy BIOS mode (default: UEFI)
# --nographic No GUI window, serial console only (great for logging)
#
# Serial log is always written to /tmp/archipelago-qemu-serial.log
# Serial log and the 20G test disk are written under ${TMPDIR:-/tmp} — set
# TMPDIR to a disk-backed directory if /tmp is space-constrained (both were
# previously hardcoded to /tmp, which could ENOSPC a tmpfs-backed /tmp on a
# 20G sparse qcow2 regardless of what the caller set TMPDIR to).
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
SERIAL_LOG="/tmp/archipelago-qemu-serial.log"
QEMU_TMPDIR="${TMPDIR:-/tmp}"
SERIAL_LOG="$QEMU_TMPDIR/archipelago-qemu-serial.log"
FORCE_BIOS=false
NOGRAPHIC=false
TIMEOUT=0
@ -64,7 +68,7 @@ echo " Serial: $SERIAL_LOG"
echo ""
# Create test disk if it doesn't exist
DISK="/tmp/archipelago-test-disk.qcow2"
DISK="$QEMU_TMPDIR/archipelago-test-disk.qcow2"
if [ ! -f "$DISK" ]; then
echo "Creating 20GB test disk..."
qemu-img create -f qcow2 "$DISK" 20G