fix: move Chromium download to Docker build phase

- Download Chromium from Google snapshots during Docker build (network works there)
- Chroot hook now only verifies and installs runtime dependencies
- Remove generated files from repo (OVMF_VARS.fd, qemu.pid, screenshots)
- Update isotest scripts to use .nogit/ directory structure
- Chromium kiosk verified working with Sway compositor
This commit is contained in:
2026-01-08 16:11:30 +00:00
parent d2a473c2bd
commit 6a5cb3b70c
16 changed files with 180 additions and 83 deletions

Binary file not shown.

View File

@@ -2,15 +2,22 @@
set -e
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
ISO_PATH="$SCRIPT_DIR/../isobuild/output/ecoos.iso"
DISK_PATH="$SCRIPT_DIR/test-disk.qcow2"
MONITOR_SOCK="$SCRIPT_DIR/qemu-monitor.sock"
SERIAL_LOG="$SCRIPT_DIR/serial.log"
PROJECT_ROOT="$SCRIPT_DIR/.."
VM_DIR="$PROJECT_ROOT/.nogit/vm"
ISO_PATH="$PROJECT_ROOT/.nogit/iso/ecoos.iso"
DISK_PATH="$VM_DIR/test-disk.qcow2"
MONITOR_SOCK="$VM_DIR/qemu-monitor.sock"
SERIAL_SOCK="$VM_DIR/serial.sock"
SERIAL_LOG="$VM_DIR/serial.log"
PID_FILE="$VM_DIR/qemu.pid"
# Create VM directory if not exists
mkdir -p "$VM_DIR"
# Check if ISO exists
if [ ! -f "$ISO_PATH" ]; then
echo "ERROR: ISO not found at $ISO_PATH"
echo "Run 'npm run build' first to create the ISO"
echo "Run 'pnpm run build' first to create the ISO"
exit 1
fi
@@ -21,11 +28,11 @@ if [ ! -f "$DISK_PATH" ]; then
fi
# Check if already running
if [ -f "$SCRIPT_DIR/qemu.pid" ]; then
PID=$(cat "$SCRIPT_DIR/qemu.pid")
if [ -f "$PID_FILE" ]; then
PID=$(cat "$PID_FILE")
if kill -0 "$PID" 2>/dev/null; then
echo "QEMU already running (PID: $PID)"
echo "Run 'npm run test:stop' to stop it first"
echo "Run 'pnpm run test:stop' to stop it first"
exit 1
fi
fi
@@ -53,20 +60,21 @@ qemu-system-x86_64 \
-vga qxl \
-display none \
-vnc :0 \
-serial unix:"$SCRIPT_DIR/serial.sock",server,nowait \
-serial unix:"$SERIAL_SOCK",server,nowait \
-monitor unix:"$MONITOR_SOCK",server,nowait \
-nic user,model=virtio-net-pci,hostfwd=tcp::3006-:3006,hostfwd=tcp::2222-:22 \
-daemonize \
-pidfile "$SCRIPT_DIR/qemu.pid"
-pidfile "$PID_FILE"
echo ""
echo "=== EcoOS Test VM Started ==="
echo "PID: $(cat $SCRIPT_DIR/qemu.pid)"
echo "PID: $(cat $PID_FILE)"
echo "VNC: localhost:5900"
echo "Serial Log: $SERIAL_LOG"
echo "Management UI: http://localhost:3006"
echo ""
echo "Commands:"
echo " npm run test:screenshot - Take screenshot"
echo " npm run test:stop - Stop VM"
echo " tail -f $SERIAL_LOG - Watch serial console"
echo " pnpm run test:screenshot - Take screenshot"
echo " pnpm run test:stop - Stop VM"
echo " tail -f $SERIAL_LOG - Watch serial console"
echo " socat - UNIX-CONNECT:$SERIAL_SOCK - Interactive serial"

View File

@@ -1,14 +1,16 @@
#!/bin/bash
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
MONITOR_SOCK="$SCRIPT_DIR/qemu-monitor.sock"
SCREENSHOT_DIR="$SCRIPT_DIR/screenshots"
PROJECT_ROOT="$SCRIPT_DIR/.."
VM_DIR="$PROJECT_ROOT/.nogit/vm"
SCREENSHOT_DIR="$PROJECT_ROOT/.nogit/screenshots"
MONITOR_SOCK="$VM_DIR/qemu-monitor.sock"
TIMESTAMP=$(date +%Y%m%d-%H%M%S)
# Check if QEMU is running
if [ ! -S "$MONITOR_SOCK" ]; then
echo "ERROR: QEMU not running (no monitor socket)"
echo "Run 'npm run test' first to start the VM"
echo "Run 'pnpm run test' first to start the VM"
exit 1
fi

View File

@@ -1,16 +1,20 @@
#!/bin/bash
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
PROJECT_ROOT="$SCRIPT_DIR/.."
VM_DIR="$PROJECT_ROOT/.nogit/vm"
PID_FILE="$VM_DIR/qemu.pid"
if [ -f "$SCRIPT_DIR/qemu.pid" ]; then
PID=$(cat "$SCRIPT_DIR/qemu.pid")
if [ -f "$PID_FILE" ]; then
PID=$(cat "$PID_FILE")
if kill -0 "$PID" 2>/dev/null; then
echo "Stopping QEMU (PID: $PID)..."
kill "$PID"
sleep 1
fi
rm -f "$SCRIPT_DIR/qemu.pid"
rm -f "$SCRIPT_DIR/qemu-monitor.sock"
rm -f "$PID_FILE"
rm -f "$VM_DIR/qemu-monitor.sock"
rm -f "$VM_DIR/serial.sock"
echo "QEMU stopped"
else
echo "QEMU not running (no PID file)"