phoebus_os/installer/tests/vm/appliance-guest.sh
Phoebus 25f7381b4a
Some checks are pending
ci / test (push) Waiting to run
feat(desktop): add Mango + DankMaterialShell profile with rollback, assistant and release foundations
- Mango + DankMaterialShell desktop option (desktop.profile = "mango") through
  the GURU overlay with scoped ~amd64 keywords, a sealed session entry point and
  a dwl fallback session (ADR 0009).
- Coherent rollback/recovery: coordinated @ + @var snapshots, fstab and BLS
  root-subvolume rewriting, matching-kernel selection, snapshot recovery entry,
  retention/space gates and sys undo (ADR 0007).
- Installed assistant (sys ask) with an OS-level systemd sandbox boundary and
  fail-closed typed plans; resolved package effects bound to approval.
- Nix build isolation enforced (sandbox, no fallback) plus lifecycle/cleanup.
- Desktop helpers (menu/lock/idle), transaction log, release gates with atomic
  publish and signing helpers, and a Debian-Live appliance VM harness.
2026-09-21 03:46:52 -07:00

54 lines
1.5 KiB
Bash

#!/bin/bash
# Guest-side, non-interactive install for the Debian-Live Phoebus appliance.
#
# Fetched and run by appliance-driver.py inside the live guest. Configuration
# and secrets are fetched from the host over QEMU user networking so they never
# appear in the serial transcript. The installer log is scanned for the LUKS
# passphrase so a leak fails the run.
set -uo pipefail
SERVE="${SERVE_URL:-http://10.0.2.2:8000}"
WORK=/tmp/phoebus-guest
mkdir -p "$WORK"
cd "$WORK" || exit 1
for f in test.conf luks.pw user.pw; do
if ! curl -fsSL "$SERVE/$f" -o "$f"; then
echo "===FETCH-FAIL=== ($f)"
exit 1
fi
done
chmod 600 luks.pw user.pw
PHOEBUS=/run/live/medium/phoebus/bin/phoebus
if [ ! -x "$PHOEBUS" ]; then
echo "===FETCH-FAIL=== (no phoebus launcher)"
exit 1
fi
# Installing Phoebus requires a connected model unless the explicit break-glass
# is passed. The baseline run uses the deterministic path.
"$PHOEBUS" --version || true
sudo -n "$PHOEBUS" --config "$WORK/test.conf" --install --yes --no-ai \
--luks-passphrase-file "$WORK/luks.pw" \
--user-password-file "$WORK/user.pw"
RC=$?
LEAK=0
for log in /run/phoebus-installer/install.log /tmp/phoebus-payload/install.log; do
if [ -f "$log" ] && grep -F -q "$(cat "$WORK/luks.pw")" "$log"; then
LEAK=1
fi
done
if [ "$LEAK" = 1 ]; then
echo "===SECRET_LEAK==="
RC=99
else
echo "===NO_SECRET_LEAK==="
fi
echo "===INSTALL-RC=$RC==="
sync
sudo -n poweroff -f || poweroff -f
echo "===POWEROFF==="