feat: initial commit — void-installer multi-profile (stable-cinnamon + mainline-niri)
This commit is contained in:
94
tests/run-niri-install.sh
Executable file
94
tests/run-niri-install.sh
Executable file
@@ -0,0 +1,94 @@
|
||||
#!/bin/bash
|
||||
# Build the mainline-niri ISO and install it headlessly into a separate
|
||||
# disk image, isolated from the stable-cinnamon test harness.
|
||||
#
|
||||
# Outputs (under out/niri/):
|
||||
# void-install-niri.iso test ISO with PROFILE=mainline-niri baked in
|
||||
# niri-disk.img 32G raw disk receiving the install
|
||||
# OVMF_VARS.fd per-VM EFI nvram
|
||||
# install.serial.log full installer log
|
||||
#
|
||||
# After a successful install, run:
|
||||
# tests/boot-niri-interactive.sh
|
||||
# to launch the installed niri VM in a GUI window.
|
||||
|
||||
set -Eeuo pipefail
|
||||
|
||||
PROJECT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
OUT="$PROJECT_DIR/out/niri"
|
||||
mkdir -p "$OUT"
|
||||
|
||||
QEMU="${QEMU:-qemu-system-x86_64}"
|
||||
OVMF_CODE="${OVMF_CODE:-/usr/share/OVMF/OVMF_CODE.fd}"
|
||||
OVMF_VARS_TPL="${OVMF_VARS_TPL:-/usr/share/OVMF/OVMF_VARS.fd}"
|
||||
RAM_MB="${RAM_MB:-4096}"
|
||||
SMP="${SMP:-4}"
|
||||
TIMEOUT_INSTALL="${TIMEOUT_INSTALL:-3600}"
|
||||
|
||||
blue() { printf '\033[34m==> %s\033[0m\n' "$*"; }
|
||||
|
||||
# 1) ensure xbps proxy is up (shared with main harness)
|
||||
"$PROJECT_DIR/tools/start-xbps-proxy.sh"
|
||||
trap '"$PROJECT_DIR/tools/stop-xbps-proxy.sh" 2>/dev/null || true; \
|
||||
pkill -f qemu-system.*void-niri-install 2>/dev/null || true' EXIT
|
||||
|
||||
# 2) build TEST overlay with PROFILE=mainline-niri
|
||||
TEST_OVERLAY="$OUT/test-overlay"
|
||||
TEST_PROFILE=mainline-niri \
|
||||
"$PROJECT_DIR/tests/lib/make-test-overlay.sh" "$TEST_OVERLAY"
|
||||
|
||||
# 3) build ISO
|
||||
ISO="$OUT/void-install-niri.iso"
|
||||
if [[ ! -f "$ISO" || -n "${REBUILD_ISO:-}" ]]; then
|
||||
blue "building niri ISO -> $ISO"
|
||||
EXTRA_INCLUDE_DIR="$TEST_OVERLAY" \
|
||||
OUTPUT_ISO="$ISO" \
|
||||
INSTALL_REPO_URL="http://10.0.2.2:3142/current" \
|
||||
BOOT_CMDLINE="console=tty0 console=ttyS0,115200" \
|
||||
"$PROJECT_DIR/iso/build-iso.sh"
|
||||
fi
|
||||
|
||||
# 4) fresh disk
|
||||
DISK="$OUT/niri-disk.img"
|
||||
blue "creating fresh disk -> $DISK"
|
||||
"$PROJECT_DIR/tests/make-test-disk.sh" "$DISK"
|
||||
|
||||
# 5) per-VM EFI nvram
|
||||
VARS="$OUT/OVMF_VARS.fd"
|
||||
cp "$OVMF_VARS_TPL" "$VARS"
|
||||
|
||||
# 6) run installer headless
|
||||
SERIAL_LOG="$OUT/install.serial.log"
|
||||
: > "$SERIAL_LOG"
|
||||
blue "boot ISO + run installer (timeout ${TIMEOUT_INSTALL}s)"
|
||||
set +e
|
||||
timeout "$TIMEOUT_INSTALL" "$QEMU" \
|
||||
-name void-niri-install \
|
||||
-machine q35,accel=kvm:tcg \
|
||||
-cpu max -m "$RAM_MB" -smp "$SMP" \
|
||||
-display none -monitor none \
|
||||
-serial "file:$SERIAL_LOG" \
|
||||
-drive "if=pflash,format=raw,readonly=on,file=$OVMF_CODE" \
|
||||
-drive "if=pflash,format=raw,file=$VARS" \
|
||||
-drive "if=virtio,file=$DISK,format=raw,cache=none" \
|
||||
-cdrom "$ISO" \
|
||||
-boot order=d,menu=off \
|
||||
-netdev user,id=n0 -device virtio-net-pci,netdev=n0 \
|
||||
-no-reboot
|
||||
rc=$?
|
||||
set -e
|
||||
|
||||
if [[ $rc -ne 0 ]]; then
|
||||
echo "installer QEMU exit $rc — see $SERIAL_LOG"
|
||||
tail -40 "$SERIAL_LOG"
|
||||
exit "$rc"
|
||||
fi
|
||||
|
||||
if grep -q "INSTALLATION COMPLETE\|installation complete\|powering off" "$SERIAL_LOG"; then
|
||||
blue "niri install completed; disk -> $DISK"
|
||||
blue "run: tests/boot-niri-interactive.sh to boot it in a GUI window"
|
||||
else
|
||||
echo "WARNING: no completion marker in $SERIAL_LOG"
|
||||
tail -30 "$SERIAL_LOG"
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user