From cb872e95aa4fe475edfb59ae08fa8170ea8a3977 Mon Sep 17 00:00:00 2001 From: Jeffrey Alan Scudder Date: Mon, 2 Mar 2026 14:25:43 -0800 Subject: [PATCH] =?UTF-8?q?fix(alpine):=20fix=20GUI=20not=20launching=20?= =?UTF-8?q?=E2=80=94=20robust=20tty=20check=20+=20cage=20error=20visibilit?= =?UTF-8?q?y?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The .profile tty guard `$(tty) = /dev/tty1` fails on Mac EFI hardware where busybox init reports /dev/console. Use a case match that accepts /dev/tty1, /dev/console, or unknown tty. Also show cage errors on the console instead of silently dying to a log file. Co-Authored-By: Claude Opus 4.6 --- fedac/scripts/make-alpine-kiosk.sh | 40 ++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/fedac/scripts/make-alpine-kiosk.sh b/fedac/scripts/make-alpine-kiosk.sh index 3744bd150e..8eb1ded625 100755 --- a/fedac/scripts/make-alpine-kiosk.sh +++ b/fedac/scripts/make-alpine-kiosk.sh @@ -308,10 +308,14 @@ EOF # 2g. Profile script — auto-start kiosk session on tty1 mkdir -p "$ROOTFS_DIR/home/kioskuser" cat > "$ROOTFS_DIR/home/kioskuser/.profile" << 'PROFILEEOF' -# Auto-start kiosk session on tty1 only -if [ "$(tty)" = "/dev/tty1" ]; then - exec /usr/local/bin/kiosk-session.sh -fi +# Auto-start kiosk session on tty1 (match /dev/tty1, /dev/console, or unknown tty) +# On some EFI hardware busybox init reports /dev/console instead of /dev/tty1 +_tty=$(tty 2>/dev/null) +case "$_tty" in + /dev/tty1|/dev/console|"not a tty"|"") + exec /usr/local/bin/kiosk-session.sh + ;; +esac PROFILEEOF chown -R 1000:1000 "$ROOTFS_DIR/home/kioskuser" 2>/dev/null || true @@ -422,8 +426,24 @@ done echo "[kiosk] launching cage + chromium" echo "[kiosk] LIBSEAT_BACKEND=$LIBSEAT_BACKEND SEATD_SOCK=${SEATD_SOCK:-unset}" echo "[kiosk] DRI devices: $(ls /dev/dri/ 2>&1)" + +# Check for DRM device — if missing, show diagnostic on console instead of silent fail +if [ ! -e /dev/dri/card0 ]; then + echo "[kiosk] FATAL: no DRM device (/dev/dri/card0) — cage cannot start" >&2 + # Restore console output so user can see the error + exec >/dev/console 2>&1 + echo "" + echo "=== KIOSK ERROR: No GPU/DRM device found ===" + echo "cage requires /dev/dri/card0 to run." + echo "Check: ls -la /dev/dri/ lspci | grep -i vga dmesg | grep -i drm" + echo "Log: $LOG" + echo "" + # Drop to shell instead of silent exit/respawn loop + exec /bin/sh +fi + # Cage launches a single Wayland app fullscreen with black background -exec cage -s -- chromium-browser \ +cage -s -- chromium-browser \ --no-first-run \ --disable-translate \ --disable-infobars \ @@ -450,6 +470,16 @@ exec cage -s -- chromium-browser \ --ignore-gpu-blocklist \ --enable-features=VaapiVideoDecoder,VaapiVideoEncoder \ "__KIOSK_PIECE_URL__" +CAGE_EXIT=$? + +# If cage exits (crash or missing Wayland support), show error on console +echo "[kiosk] cage exited with code $CAGE_EXIT" +exec >/dev/console 2>&1 +echo "" +echo "=== KIOSK: cage exited (code $CAGE_EXIT) ===" +echo "Log: $LOG" +echo "Restarting in 5s... (Ctrl+C for shell)" +sleep 5 SESSEOF # Replace placeholder URLs -- knotmirror 0.0.1