From 93d05970e1df45f479715f21c3a4a65c3ed37341 Mon Sep 17 00:00:00 2001 From: Dorian Date: Fri, 27 Mar 2026 21:35:12 +0000 Subject: [PATCH] fix: GRUB theme font refs, improve QEMU test script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Theme: remove explicit font name references that don't match grub-mkfont output names, remove select_*.png pixmap reference (files don't exist). GRUB falls back to default when theme fails to load โ€” this was causing the Debian helmet to show. QEMU test script: add --bios/--nographic flags, serial console logging to /tmp/archipelago-qemu-serial.log, auto-detect latest ISO, use -drive for OVMF firmware. Co-Authored-By: Claude Opus 4.6 (1M context) --- image-recipe/branding/grub-theme/theme.txt | 10 +- image-recipe/test-iso-qemu.sh | 132 +++++++++++++-------- 2 files changed, 87 insertions(+), 55 deletions(-) diff --git a/image-recipe/branding/grub-theme/theme.txt b/image-recipe/branding/grub-theme/theme.txt index da71bebb..780ab5d3 100644 --- a/image-recipe/branding/grub-theme/theme.txt +++ b/image-recipe/branding/grub-theme/theme.txt @@ -1,20 +1,17 @@ # Archipelago GRUB Theme # Dark background with Bitcoin orange accents +# Font references removed โ€” GRUB uses whatever fonts are loaded in grub.cfg title-text: "" desktop-color: "#0a0a0a" -terminal-font: "DejaVu Sans Regular 16" + boot_menu { left = 25% top = 40% width = 50% height = 30% - item_font = "DejaVu Sans Regular 16" item_color = "#aaaaaa" - selected_item_font = "DejaVu Sans Regular 16" - selected_item_color = "#ffffff" - selected_item_pixmap_style = "select_*.png" + selected_item_color = "#f7931a" item_height = 36 item_spacing = 8 item_padding = 16 @@ -26,7 +23,6 @@ terminal-font: "DejaVu Sans Regular 16" top = 20% width = 50% text = "A R C H I P E L A G O" - font = "DejaVu Sans Bold 24" color = "#f7931a" align = "center" } @@ -36,7 +32,6 @@ terminal-font: "DejaVu Sans Regular 16" top = 28% width = 50% text = "Bitcoin Node OS" - font = "DejaVu Sans Regular 14" color = "#888888" align = "center" } @@ -46,7 +41,6 @@ terminal-font: "DejaVu Sans Regular 16" top = 90% width = 50% text = "Use arrow keys to select, Enter to boot" - font = "DejaVu Sans Regular 12" color = "#555555" align = "center" } diff --git a/image-recipe/test-iso-qemu.sh b/image-recipe/test-iso-qemu.sh index ac80ddc2..cbe8bef3 100755 --- a/image-recipe/test-iso-qemu.sh +++ b/image-recipe/test-iso-qemu.sh @@ -1,69 +1,107 @@ #!/bin/bash # Test Archipelago ISO in QEMU +# +# Usage: +# ./test-iso-qemu.sh [path-to-iso] [--bios] [--nographic] +# +# Options: +# --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 SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" -ISO="${1:-$SCRIPT_DIR/results/archipelago-debian-12-x86_64.iso}" +SERIAL_LOG="/tmp/archipelago-qemu-serial.log" +FORCE_BIOS=false +NOGRAPHIC=false +ISO="" -if [ ! -f "$ISO" ]; then - echo "โŒ ISO not found: $ISO" +for arg in "$@"; do + case "$arg" in + --bios) FORCE_BIOS=true ;; + --nographic) NOGRAPHIC=true ;; + *) ISO="$arg" ;; + esac +done + +# Auto-detect ISO +if [ -z "$ISO" ]; then + ISO=$(ls -t "$SCRIPT_DIR"/results/archipelago-installer-unbundled-*.iso 2>/dev/null | head -1) +fi +if [ -z "$ISO" ] || [ ! -f "$ISO" ]; then + ISO=$(ls -t "$SCRIPT_DIR"/results/archipelago-*.iso 2>/dev/null | head -1) +fi +if [ -z "$ISO" ] || [ ! -f "$ISO" ]; then + echo "ISO not found." echo "" - echo "Usage: $0 [path-to-iso]" + echo "Usage: $0 [path-to-iso] [--bios] [--nographic]" echo "" - echo "Build the ISO first with: ./build-debian-iso.sh" + echo "Or place an ISO in: $SCRIPT_DIR/results/" exit 1 fi -echo "๐Ÿงช Testing Archipelago ISO in QEMU" -echo "๐Ÿ“€ ISO: $ISO" -echo "๐Ÿ’พ RAM: 4GB" -echo "๐Ÿ–ฅ๏ธ CPU: 2 cores" -echo "" -echo "Press Ctrl+Alt+G to release mouse/keyboard from VM" -echo "Press Ctrl+C in this terminal to stop VM" +echo "Testing Archipelago ISO in QEMU" +echo " ISO: $ISO" +echo " Size: $(du -h "$ISO" | cut -f1)" +echo " RAM: 4GB" +echo " CPU: 2 cores" +echo " Serial: $SERIAL_LOG" echo "" # Create test disk if it doesn't exist DISK="/tmp/archipelago-test-disk.qcow2" if [ ! -f "$DISK" ]; then - echo "Creating test disk..." + echo "Creating 20GB test disk..." qemu-img create -f qcow2 "$DISK" 20G fi -echo "Starting VM in 3 seconds..." -sleep 3 +# Common QEMU args +QEMU_ARGS=( + -m 4G + -smp 2 + -boot d + -cdrom "$ISO" + -drive if=virtio,format=qcow2,file="$DISK" + -net nic,model=virtio -net user,hostfwd=tcp::2222-:22,hostfwd=tcp::8100-:80 + -serial file:"$SERIAL_LOG" +) -# Run QEMU with UEFI (more modern, matches real hardware) -if [ -f "/opt/homebrew/share/qemu/edk2-x86_64-code.fd" ]; then - # macOS with Homebrew QEMU - OVMF="/opt/homebrew/share/qemu/edk2-x86_64-code.fd" -elif [ -f "/usr/share/OVMF/OVMF_CODE.fd" ]; then - # Linux with OVMF - OVMF="/usr/share/OVMF/OVMF_CODE.fd" +# Display mode +if [ "$NOGRAPHIC" = true ]; then + QEMU_ARGS+=(-nographic -append "console=ttyS0") else - # Fall back to legacy BIOS - echo "โš ๏ธ UEFI firmware not found, using legacy BIOS..." - qemu-system-x86_64 \ - -machine pc \ - -m 4G \ - -smp 2 \ - -boot d \ - -cdrom "$ISO" \ - -drive if=virtio,format=qcow2,file="$DISK" \ - -net nic,model=virtio -net user,hostfwd=tcp::2222-:22,hostfwd=tcp::8100-:8100 \ - -vga virtio \ - -display default - exit 0 + QEMU_ARGS+=(-vga virtio -display default) fi -# UEFI boot -qemu-system-x86_64 \ - -machine q35 \ - -bios "$OVMF" \ - -m 4G \ - -smp 2 \ - -boot d \ - -cdrom "$ISO" \ - -drive if=virtio,format=qcow2,file="$DISK" \ - -net nic,model=virtio -net user,hostfwd=tcp::2222-:22,hostfwd=tcp::8100-:8100 \ - -vga virtio \ - -display default +echo "Starting VM..." +echo "(Serial console logging to $SERIAL_LOG)" +echo "(Press Ctrl+Alt+G to release mouse, Ctrl+C to stop VM)" +echo "" + +# Detect UEFI firmware +OVMF="" +if [ "$FORCE_BIOS" = false ]; then + if [ -f "/opt/homebrew/share/qemu/edk2-x86_64-code.fd" ]; then + OVMF="/opt/homebrew/share/qemu/edk2-x86_64-code.fd" + elif [ -f "/usr/share/OVMF/OVMF_CODE.fd" ]; then + OVMF="/usr/share/OVMF/OVMF_CODE.fd" + fi +fi + +if [ -n "$OVMF" ]; then + echo " Boot: UEFI ($OVMF)" + qemu-system-x86_64 \ + -machine q35 \ + -drive if=pflash,format=raw,readonly=on,file="$OVMF" \ + "${QEMU_ARGS[@]}" +else + echo " Boot: Legacy BIOS" + qemu-system-x86_64 \ + -machine pc \ + "${QEMU_ARGS[@]}" +fi + +echo "" +echo "VM stopped. Serial log: $SERIAL_LOG" +echo "Last 20 lines:" +tail -20 "$SERIAL_LOG" 2>/dev/null