Skip to content

LordOS — a free, fast and secure GNU/Linux distribution based on Debian, with its own desktop environment: display server and Wayland compositor in C, a React UI engine on QuickJS, and private native apps.

1.4 KB
Raw Blame
#!/bin/sh
# lordos-splash: hands the boot splash (Plymouth) over to LordOS without a black or text flash.
# See docs/SESSIONS.md, "Boot splash".
#
#   lordos-splash deactivate   (lordos.service, the last ExecStartPre) Plymouth stops drawing and
#                              drops DRM master but leaves its last frame on the screen, so
#                              lord-sessiond can take the card.
#   lordos-splash quit         (lordos-splash-quit.service) waits for the first LordOS frame on the
#                              monitor (/run/lordos/first-frame, created by lord-sessiond), then ends
#                              Plymouth keeping that frame (--retain-splash). After 30 s without it,
#                              Plymouth is ended anyway.
# Without Plymouth (not installed, or not running) both do nothing.
set -u
PLY=/usr/bin/plymouth
[ -x "$PLY" ] || exit 0
"$PLY" --ping 2>/dev/null || exit 0
case "${1:-}" in
    deactivate)
        exec "$PLY" deactivate
        ;;
    quit)
        i=0
        while [ $i -lt 300 ] && [ ! -e /run/lordos/first-frame ]; do
            sleep 0.1
            i=$((i + 1))
        done
        [ -e /run/lordos/first-frame ] || echo "lordos-splash: no LordOS frame after 30 s; ending the splash" >&2
        exec "$PLY" quit --retain-splash
        ;;
    *)
        echo "usage: lordos-splash deactivate|quit" >&2
        exit 2
        ;;
esac