feat(deploy): BetterFrame plymouth boot splash

Replace Pi rainbow + kernel boot text with a black BG + centered BF logo
during boot. Installer renders logo.png from the existing SVG asset via
rsvg-convert, drops a script-based plymouth theme, and appends the
quiet/splash flags to cmdline.txt + disable_splash=1 in config.txt.

cmdline.txt edits are idempotent: each flag only added if missing.
This commit is contained in:
Mitchell R 2026-05-13 03:21:37 +02:00
parent b42e972fcf
commit 85a0bcae87
3 changed files with 65 additions and 1 deletions

View file

@ -0,0 +1,8 @@
[Plymouth Theme]
Name=BetterFrame
Description=BetterFrame boot splash
ModuleName=script
[script]
ImageDir=/usr/share/plymouth/themes/betterframe
ScriptFile=/usr/share/plymouth/themes/betterframe/betterframe.script

View file

@ -0,0 +1,18 @@
// BetterFrame plymouth splash: solid black background, centered logo.
// Logo is generated from server/src/web-static/betterframe-logo.svg at
// install time by setup-pi-kiosk.sh (rsvg-convert → logo.png).
Window.SetBackgroundTopColor(0.0, 0.0, 0.0);
Window.SetBackgroundBottomColor(0.0, 0.0, 0.0);
logo.image = Image("logo.png");
logo.sprite = Sprite(logo.image);
logo.sprite.SetX(Window.GetWidth() / 2 - logo.image.GetWidth() / 2);
logo.sprite.SetY(Window.GetHeight() / 2 - logo.image.GetHeight() / 2);
// Hide all message and progress reporting — keep the splash clean.
fun message_callback (text) { }
fun update_status_callback (status) { }
fun display_password_callback (prompt, bullets) { }
fun display_question_callback (prompt, entry) { }
fun display_normal_callback () { }

View file

@ -111,7 +111,8 @@ if [ "${INSTALL_KIOSK}" = "1" ]; then
libwebkitgtk-6.0-dev pkg-config build-essential \ libwebkitgtk-6.0-dev pkg-config build-essential \
gstreamer1.0-plugins-base gstreamer1.0-plugins-good \ gstreamer1.0-plugins-base gstreamer1.0-plugins-good \
gstreamer1.0-plugins-bad gstreamer1.0-libav \ gstreamer1.0-plugins-bad gstreamer1.0-libav \
v4l-utils wlr-randr v4l-utils wlr-randr \
plymouth plymouth-themes librsvg2-bin
systemctl enable --now seatd systemctl enable --now seatd
fi fi
@ -192,6 +193,43 @@ EOF
systemctl enable betterframe-kiosk.service systemctl enable betterframe-kiosk.service
# Restart picks up new binary on re-run. # Restart picks up new binary on re-run.
systemctl restart betterframe-kiosk.service || true systemctl restart betterframe-kiosk.service || true
# --------------------------------------------------------------------------
# 9. Plymouth boot splash — hide kernel text + Pi rainbow, show BF logo
# --------------------------------------------------------------------------
echo "==> Installing BetterFrame plymouth theme"
THEME_DIR="/usr/share/plymouth/themes/betterframe"
install -d -m 755 "${THEME_DIR}"
install -m 644 "${REPO_ROOT}/deploy/plymouth/betterframe/betterframe.plymouth" "${THEME_DIR}/"
install -m 644 "${REPO_ROOT}/deploy/plymouth/betterframe/betterframe.script" "${THEME_DIR}/"
rsvg-convert -w 480 "${REPO_ROOT}/server/src/web-static/betterframe-logo.svg" \
-o "${THEME_DIR}/logo.png"
plymouth-set-default-theme -R betterframe
# Find the boot config / cmdline file. Bookworm uses /boot/firmware/, older
# Pi images use /boot/.
if [ -f /boot/firmware/cmdline.txt ]; then
BOOT_DIR=/boot/firmware
else
BOOT_DIR=/boot
fi
CMDLINE="${BOOT_DIR}/cmdline.txt"
CONFIG="${BOOT_DIR}/config.txt"
if [ -f "${CMDLINE}" ]; then
# cmdline.txt is a single line. Append missing flags only.
for flag in quiet splash plymouth.ignore-serial-consoles "loglevel=0" "vt.global_cursor_default=0" logo.nologo; do
if ! grep -qw -- "${flag}" "${CMDLINE}"; then
sed -i "s|\$| ${flag}|" "${CMDLINE}"
fi
done
fi
if [ -f "${CONFIG}" ]; then
# Pi firmware rainbow splash off.
if ! grep -q "^disable_splash=1" "${CONFIG}"; then
printf '\n# BetterFrame: disable firmware rainbow splash\ndisable_splash=1\n' >> "${CONFIG}"
fi
fi
fi fi
echo "==> Done." echo "==> Done."