diff --git a/image-recipe/_archived/test-iso-qemu.sh b/image-recipe/_archived/test-iso-qemu.sh index f44521e1..ec2d6f8a 100755 --- a/image-recipe/_archived/test-iso-qemu.sh +++ b/image-recipe/_archived/test-iso-qemu.sh @@ -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