#!/bin/bash # Guest-side, non-interactive install for the graphical Phoebus live ISO. # # Fetched and run by gui-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. # # This uses the same deterministic backend as the graphical installer; the GUI # is a typed frontend over it, so a CLI install and a GUI install execute the # same stages. 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=/usr/local/bin/phoebus-installer if [ ! -x "$PHOEBUS" ]; then echo "===FETCH-FAIL=== (no phoebus-installer)" exit 1 fi "$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-installer/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==="