feat: add live-qemu target with 12GB RAM for nix package headroom
Live session is a pure-RAM tmpfs overlay. Cinnamon takes ~2.5GB, nix packages take ~4GB — 6GB QEMU was too tight. 12GB gives comfortable headroom. Real XPS 9700 (32GB) already works fine. - tests/launch-live-qemu.sh: dedicated QEMU launcher, RAM_MB=12288 - Makefile: 'make live-qemu' target
This commit is contained in:
59
tests/launch-live-qemu.sh
Executable file
59
tests/launch-live-qemu.sh
Executable file
@@ -0,0 +1,59 @@
|
||||
#!/bin/bash
|
||||
# Launch the live desktop ISO under QEMU for interactive testing.
|
||||
# Uses 12 GB RAM so nix packages (~4 GB) can install into the tmpfs overlay.
|
||||
#
|
||||
# Usage:
|
||||
# bash tests/launch-live-qemu.sh # uses out/void-live-stable.iso
|
||||
# ISO=out/my.iso bash tests/launch-live-qemu.sh
|
||||
# RAM_MB=16384 bash tests/launch-live-qemu.sh # override RAM
|
||||
|
||||
set -Eeuo pipefail
|
||||
|
||||
PROJECT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
OUT_DIR="$PROJECT_DIR/out"
|
||||
|
||||
ISO="${ISO:-$(ls -t "$OUT_DIR"/void-live-stable*.iso 2>/dev/null | head -1 || true)}"
|
||||
[[ -r "$ISO" ]] || { echo "no ISO found — run 'make live' first"; exit 1; }
|
||||
|
||||
RAM_MB="${RAM_MB:-12288}" # 12 GB: Cinnamon ~2.5GB + nix store ~4GB + headroom
|
||||
SMP="${SMP:-4}"
|
||||
|
||||
OVMF_CODE="${OVMF_CODE:-}"
|
||||
OVMF_VARS_TPL="${OVMF_VARS_TPL:-}"
|
||||
for c in /usr/share/OVMF/OVMF_CODE.fd /usr/share/edk2-ovmf/x64/OVMF_CODE.fd \
|
||||
/usr/share/edk2/x64/OVMF_CODE.fd /usr/share/qemu/OVMF_CODE.fd; do
|
||||
[[ -z "$OVMF_CODE" && -r "$c" ]] && OVMF_CODE="$c"
|
||||
done
|
||||
for v in /usr/share/OVMF/OVMF_VARS.fd /usr/share/edk2-ovmf/x64/OVMF_VARS.fd \
|
||||
/usr/share/edk2/x64/OVMF_VARS.fd /usr/share/qemu/OVMF_VARS.fd; do
|
||||
[[ -z "$OVMF_VARS_TPL" && -r "$v" ]] && OVMF_VARS_TPL="$v"
|
||||
done
|
||||
[[ -r "$OVMF_CODE" ]] || { echo "OVMF_CODE not found — install ovmf"; exit 1; }
|
||||
[[ -r "$OVMF_VARS_TPL" ]] || { echo "OVMF_VARS not found — install ovmf"; exit 1; }
|
||||
|
||||
VARS="$OUT_DIR/OVMF_VARS.live.fd"
|
||||
[[ -f "$VARS" ]] || cp "$OVMF_VARS_TPL" "$VARS"
|
||||
|
||||
mkdir -p "$OUT_DIR"
|
||||
|
||||
echo ">>> launching live ISO: $ISO"
|
||||
echo " RAM: ${RAM_MB} MB CPUs: $SMP"
|
||||
echo " serial: $OUT_DIR/live-serial.sock"
|
||||
echo " monitor: $OUT_DIR/qemu-monitor.sock"
|
||||
|
||||
exec qemu-system-x86_64 \
|
||||
-name void-live-test \
|
||||
-machine q35,accel=kvm:tcg \
|
||||
-cpu max \
|
||||
-m "$RAM_MB" \
|
||||
-smp "$SMP" \
|
||||
-drive "if=pflash,format=raw,readonly=on,file=$OVMF_CODE" \
|
||||
-drive "if=pflash,format=raw,file=$VARS" \
|
||||
-cdrom "$ISO" \
|
||||
-boot order=d,menu=off \
|
||||
-netdev user,id=n0 \
|
||||
-device virtio-net-pci,netdev=n0 \
|
||||
-serial "unix:$OUT_DIR/live-serial.sock,server,nowait" \
|
||||
-monitor "unix:$OUT_DIR/qemu-monitor.sock,server,nowait" \
|
||||
-device virtio-vga \
|
||||
-display gtk,gl=off
|
||||
Reference in New Issue
Block a user