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.

Boot splash: LordOS Plymouth theme and flash-free hand-off to lord-sessiond

Federico Pereiraeecb1a4648f8
diff --git a/docs/INSTALL-DEBIAN.md b/docs/INSTALL-DEBIAN.md
index 92f46d1..c4e195e 100644
--- a/docs/INSTALL-DEBIAN.md
+++ b/docs/INSTALL-DEBIAN.md
@@ -95,11 +95,34 @@ curl -fsSL https://lordos.org/install.sh | sh -s -- [options]
| `--user NAME` | the user to set up (default: the user who ran `sudo`; as plain root with no `sudo`, nobody) |
| `--keep-display-manager` | leave the current display manager enabled; LordOS is not enabled at boot |
| `--no-extras` | don't install the extra sound and font packages |
+| `--boot-splash` | set up the LordOS boot splash without asking (see "Boot splash (optional)") |
+| `--no-boot-splash` | don't offer the boot splash |
| `--no-systemd-check` | continue without a running systemd (containers, chroots): services, display manager, getty and linger are skipped. Detected automatically in Docker/Podman |
| `--uninstall` | remove LordOS and restore the previous login setup |
| `--purge` | with `--uninstall`: purge the package and its files in `/etc` |
| `-h`, `--help` | help |
+## Boot splash (optional)
+
+At the end the installer asks whether to show the LordOS boot splash (the crown and a progress bar,
+`ISO.md`, "Boot splash and boot menu"). The default answer is no, and `--yes` skips it unless
+`--boot-splash` is given. If you accept:
+
+- `plymouth` and `plymouth-label` are installed and the theme is set to `lordos` with
+ `plymouth-set-default-theme -R` (it rebuilds the initramfs). If you had picked a boot splash theme
+ that isn't one of Debian's own, it asks before replacing it.
+- **GRUB, only if nobody customised it for this:** when the system boots with GRUB, and its settings
+ (`/etc/default/grub` and `/etc/default/grub.d/*.cfg`) don't already have `splash`/`nosplash` or a
+ `GRUB_THEME`, and the terminal isn't `console`/`serial`, it writes its own drop-in
+ `/etc/default/grub.d/lordos.cfg` (`splash` added to `GRUB_CMDLINE_LINUX_DEFAULT`,
+ `GRUB_GFXPAYLOAD_LINUX=keep` and, on amd64, the LordOS boot menu as `GRUB_THEME`) and runs
+ `update-grub`. `/etc/default/grub` itself is never edited. Without GRUB (systemd-boot, a
+ Raspberry Pi), only the theme is set and the final message says to add `quiet splash` to the kernel
+ command line.
+
+`--uninstall` removes the drop-in (and runs `update-grub`) and puts the previous Plymouth theme
+back; Plymouth itself stays installed.
+
## Uninstalling
```sh
diff --git a/docs/ISO.md b/docs/ISO.md
index 1e3f099..f88524c 100644
--- a/docs/ISO.md
+++ b/docs/ISO.md
@@ -41,7 +41,52 @@ motherboard. It works with **UEFI** and with **BIOS/Legacy**. **Secure Boot** ha
| LordOS (Español) / LordOS (Português) | `lordos.lang=es` / `lordos.lang=pt`: the interface in Spanish or Portuguese the first time |
| LordOS (copy to RAM) | `toram`: copies the system to memory (~1 GB free is needed) and the USB stick can be removed |
-The GRUB menu itself is in English (GRUB's default).
+The GRUB menu itself is in English (GRUB's default). Every entry except safe mode boots with the
+boot splash (`splash`); safe mode boots in text (`nosplash`).
+
+## Boot splash and boot menu
+
+From power-on to the login screen LordOS shows its own look: the boot menu, then the crown with a
+progress bar, then the login screen (or the desktop, with autologin) without a black frame or console
+text in between.
+
+| Boot menu (GRUB theme) | Boot splash (Plymouth) |
+|---|---|
+| ![Boot menu](boot/iso-grub.png) | ![Boot splash](boot/iso-splash.png) |
+
+- **Boot menu:** the GRUB theme `tools/iso/grub/lordos/` (`theme.txt`, images and Inter as GRUB
+ fonts): the navy background, a small crown, the entries in the brand colours with the selected one
+ on a rounded violet band, and the countdown as the splash's bar. The ISO copies it to
+ `/boot/grub/themes/lordos/`; the package installs it in `/usr/share/grub/themes/lordos/` (amd64
+ only) and the disk installer sets `GRUB_THEME` to it. The entries (English, Español, Português,
+ safe mode, copy to RAM) are the same as before.
+- **Boot splash:** the Plymouth theme `lordos` (`tools/boot/plymouth/lordos/`, the `script`
+ module), installed by the package in `/usr/share/plymouth/themes/lordos/`. The ISO installs
+ `plymouth` and `plymouth-label` and selects it (`plymouth-set-default-theme lordos`) before building
+ the initramfs, so it shows from the initramfs on. The bar follows Plymouth's boot progress, eased so
+ it never jumps or goes back; there are no text messages, and **Esc** shows the text console as
+ usual. If a disk is encrypted (LUKS), a styled password field with a lock replaces the bar.
+- **Installed system:** the installer writes `GRUB_CMDLINE_LINUX_DEFAULT="quiet splash
+ vt.global_cursor_default=0 loglevel=3"`, `GRUB_GFXPAYLOAD_LINUX=keep`, `GRUB_TERMINAL_OUTPUT=gfxterm`
+ and `GRUB_THEME` (each only when Plymouth and the themes are in the copied system), then rebuilds
+ the initramfs and the GRUB menu. `nosplash` on the kernel command line (`e` in the menu) boots in
+ text for one boot.
+- **Hand-off:** see `SESSIONS.md`, "Boot splash": Plymouth gives up the card just before
+ lord-sessiond takes it, its last frame stays until LordOS's first frame replaces it, and only then
+ is Plymouth ended with `--retain-splash`.
+- **On Debian (install.sh):** optional and asked for; see `INSTALL-DEBIAN.md`.
+
+The images come from `python3 tools/boot/gen-boot-assets.py` (rsvg-convert; `--preview` also
+writes the static previews in `docs/boot/`). The GRUB fonts are made on a Debian with `grub-common`:
+
+```sh
+R=0x20-0x7E,0xA0-0x17F,0x2010-0x2027
+grub-mkfont -s 16 -r $R -o tools/iso/grub/lordos/inter-regular-16.pf2 assets/fonts/Inter-Regular.ttf
+grub-mkfont -s 14 -r $R -o tools/iso/grub/lordos/inter-regular-14.pf2 assets/fonts/Inter-Regular.ttf
+grub-mkfont -s 16 -r $R -o tools/iso/grub/lordos/inter-semibold-16.pf2 assets/fonts/Inter-SemiBold.ttf
+```
+
+Inter is under the SIL Open Font License 1.1 (`assets/fonts/Inter-LICENSE.txt`).
In the live session:
- **User:** `lordos`, no password, with passwordless `sudo`.
diff --git a/docs/RASPBERRY.md b/docs/RASPBERRY.md
index 89dcc3d..ab22ef8 100644
--- a/docs/RASPBERRY.md
+++ b/docs/RASPBERRY.md
@@ -314,6 +314,42 @@ Options in `cmdline.txt` (a single line), as on the ISO:
| `lordos.gpu=0` | safe mode: everything on the CPU |
| `lordos.lang=es` / `pt` | first-boot language (English by default, like the ISO) |
| `video=HDMI-A-1:1920x1080@60` | pins the mode, for example on a 4K monitor (on the CPU, 4K is heavy: see below) |
+| remove `splash` (or add `nosplash`) | boots in text, without the boot splash |
+
+### Boot splash
+
+From power-on to the login screen the board shows the LordOS crown with a progress bar (the same
+Plymouth theme as the ISO, `ISO.md`, "Boot splash and boot menu"), with no rainbow square, no kernel
+logo and no console text.
+
+![Boot splash (static preview, 1x)](boot/splash-preview.png)
+
+- **`config.txt`:** `disable_splash=1`: the firmware's rainbow square is not drawn.
+- **`cmdline.txt`:** `console=serial0,115200 console=tty1 … quiet splash
+ plymouth.ignore-serial-consoles logo.nologo vt.global_cursor_default=0 loglevel=3`, keeping
+ `root=`, `lsm=`, `cgroup_enable=memory` and `lordos.lang=`. The local console moved from `tty3`
+ to **`tty1`**: Plymouth takes its terminal (keyboard, password prompt, Esc) from the local
+ `console=` and LordOS runs on tty1, so both stay on the same VT (Raspberry Pi OS does the same). The kernel's messages
+ stay hidden (`quiet`, Plymouth); **Esc** shows them during the boot, as usual.
+- **initramfs:** `plymouth` and `plymouth-label` are installed and `lordos` is the selected theme
+ (`plymouth-set-default-theme lordos`), so Plymouth's initramfs hook copies the theme, its plugins
+ and a font (for the encrypted-disk password prompt). `/etc/initramfs-tools/modules` lists `vc4`
+ and `conf.d/lordos-splash.conf` keeps `MODULES=most` (the hook then adds the DRM drivers), so the
+ HDMI output is up in the initramfs and the splash shows within the first seconds instead of after
+ the root file system is mounted. The LordOS kernels have `DRM`, `DRM_VC4` and `DRM_V3D` as modules,
+ and their packages build an initramfs through `/etc/kernel/postinst.d` (initramfs-tools); the
+ raspi-firmware hook and `build-img.sh` copy it as `initramfs_2712` / `initramfs8`
+ (`auto_initramfs=1`). `build-img.sh` fails if an initramfs has no `lordos.script`.
+- **Hand-off:** the same as the ISO (`SESSIONS.md`, "Boot splash"); on the Pi
+ `lordos-splash deactivate` runs after `wait-kms`, so Plymouth keeps drawing until vc4 is ready.
+ Plymouth draws on vc4 (`card1`), the card with the HDMI connectors; `v3d` (`card0`) has none.
+- **First boot:** `lordos-rpi-firstboot` (growing the partition, the user, the switch files) runs
+ under the splash; its messages go to the journal and to the console, which Plymouth keeps hidden
+ (Esc shows them).
+
+Checked on the image (read-only, loop-mounted on the Pi): `config.txt`, `cmdline.txt`, the default
+theme and `lsinitramfs` of both initramfs files. Still to check on a board: the timing of the first
+frame of the splash after power-on, the hand-off with no flash on vc4, and 4K.
### After flashing
diff --git a/docs/SESSIONS.md b/docs/SESSIONS.md
index 44bc925..436223a 100644
--- a/docs/SESSIONS.md
+++ b/docs/SESSIONS.md
@@ -112,6 +112,38 @@ put in graphics mode once (`KD_GRAPHICS`) and goes back to text when the service
The card, the input and the monitor socket are never left open in the children (web
connections, workers): `sd_mon_child()` closes them before dropping root.
+### Boot splash
+
+The boot splash (Plymouth, theme `lordos`; see `ISO.md` and `RASPBERRY.md`, "Boot splash") hands
+the screen to LordOS without a black frame or a flash of the text console:
+
+1. **`lordos.service` → `lordos-splash deactivate`**, the last `ExecStartPre` (on the Raspberry Pi
+ after `wait-kms`): Plymouth stops drawing and drops DRM master, but its last frame stays on the
+ screen. The unit has `TTYReset=no`: systemd's terminal reset switches tty1 back to text mode
+ before every `Exec*` line, and with nobody holding DRM master the console would be drawn on top
+ of the splash.
+2. **lord-sessiond** opens the card, becomes DRM master (`SET_MASTER` works because Plymouth
+ dropped it) and lends it to the login screen, or the autologin session, with
+ **`RP_DISPLAY_KEEP`** (a flags byte after the fd count in `RP_DISPLAY`). The flag is only sent while
+ `/run/lordos/first-frame` doesn't exist, that is, before the first frame of this boot: later the
+ screen may hold another user's session, which must never stay visible.
+3. **The session** (`kms_attach(..., keep)`) skips the black first modeset: `modeset_pending`
+ makes the first `kms_flip` (CPU path) or `kms_set_fb`/`kms_flip_fb` (GPU path, direct scanout)
+ do the `SETCRTC` with a real frame. Until then the splash is what the screen shows. Then it sends
+ **`RP_SHOWN`** to lord-sessiond.
+4. **lord-sessiond** creates `/run/lordos/first-frame` (also at once when there is no monitor).
+5. **`lordos-splash-quit.service`** (wanted by `lordos.service`) waits for that file and runs
+ `plymouth quit --retain-splash`: Plymouth closes its card without touching the screen, which
+ already shows LordOS. Without the file after 30 s it ends Plymouth anyway.
+6. Plymouth's own `plymouth-quit.service` (a plain `plymouth quit`) is ordered after it by
+ `plymouth-quit.service.d/lordos.conf`, so it can't end the splash early. There is no
+ `Conflicts=` with it (the display-manager way): starting `plymouth-quit.service` by hand would
+ then stop LordOS.
+
+lord-sessiond runs nothing new for this: Plymouth is only called from the units, with fixed
+arguments (`/usr/lib/lordos/lordos-splash`). Without Plymouth installed or running, both steps do
+nothing and the boot is the same as before (the first frame is then black, as always).
+
### The login screen (greeter)
It's a `lord-server --headless --greeter` running as `lordos-greeter`, unprivileged and without
@@ -306,6 +338,8 @@ session. Everything that changes something goes through closed `admin.c` actions
| `themes/greeter/` | the login screen |
| `apps/settings/Users.jsx` | Settings → Users |
| `/run/lordos/status.json` | sessions, who's on the monitor and who's connected over the network |
+| `/run/lordos/first-frame` | the first session frame of this boot is on the monitor (boot splash hand-off) |
+| `tools/boot/lordos-splash`, `tools/boot/systemd/` | the boot splash hand-off: `deactivate`, `quit` and the units |
| `/etc/lordos/session.conf` | `AUTOLOGIN=` |
## Screenshots
diff --git a/docs/boot/iso-handoff-journal.png b/docs/boot/iso-handoff-journal.png
new file mode 100644
index 0000000..d5d00ff
Binary files /dev/null and b/docs/boot/iso-handoff-journal.png differ
diff --git a/docs/boot/iso-splash.png b/docs/boot/iso-splash.png
new file mode 100644
index 0000000..db9625b
Binary files /dev/null and b/docs/boot/iso-splash.png differ
diff --git a/docs/boot/splash-preview-password.png b/docs/boot/splash-preview-password.png
new file mode 100644
index 0000000..52c27c3
Binary files /dev/null and b/docs/boot/splash-preview-password.png differ
diff --git a/docs/boot/splash-preview.png b/docs/boot/splash-preview.png
new file mode 100644
index 0000000..fdc6538
Binary files /dev/null and b/docs/boot/splash-preview.png differ
diff --git a/docs/brand/README.md b/docs/brand/README.md
index 679eeb3..bf00cf9 100644
--- a/docs/brand/README.md
+++ b/docs/brand/README.md
@@ -136,6 +136,31 @@ open `S`) and the weight contrast best.
- Don't use the detailed icon below 32 px or the detailed crown below 24 px; use the small variants.
- Don't redraw or trace the logo from screenshots. Edit `tools/gen-brand.py` and regenerate.
+## Boot splash and boot menu
+
+What the screen shows from power-on to the login screen (`docs/ISO.md`, "Boot splash and boot menu";
+`docs/RASPBERRY.md`, "Boot splash"). Calm and minimal: no text messages, nothing that moves except
+the bar.
+
+| Splash, mid-boot (static preview, 1x) | Splash, encrypted disk |
+|---|---|
+| ![Boot splash](../boot/splash-preview.png) | ![Password prompt](../boot/splash-preview-password.png) |
+
+| Part | Spec (1x, for 1080p; @2x files for 4K) |
+|---|---|
+| Background | vertical gradient `#12122A` (top) → `#0B0B1C` (bottom) |
+| Crown | `crown.svg` at 112 px, centred, 40 px above the middle |
+| Glow | a 420 px radial gradient of `#6E4BFF` behind the crown, 30 % → 12 % → 0 alpha. It is light *behind* the logo on the background, not an effect on the logo (see "Don'ts") |
+| Progress bar | 200 × 6 px, 56 px under the crown; track white at 12 %; fill `#B46CFF` → `#6E4BFF` with round caps; eased, never goes back |
+| Wordmark | the lockup's outlined Plus Jakarta Sans text, 12 px high, white at 55 %, 28 px under the bar |
+| Password field | 280 × 40 px, 12 px radius, white at 7 % with a 22 % hairline; white dots and a small lock above |
+| Boot menu (GRUB) | the same background with a soft glow, the crown at 96 px, entries in Inter 16 (`#B9B6D9`, selected white on a rounded violet band `#6E4BFF` at 34 % with a `#B46CFF` hairline), the bar as the countdown |
+
+The files are generated, never edited by hand: `python3 tools/boot/gen-boot-assets.py` renders
+`tools/boot/plymouth/lordos/*.png` (1x and @2x) and `tools/iso/grub/lordos/*.png` from
+`assets/brand/crown.svg` and `logo-horizontal-dark.svg` with rsvg-convert; `--preview` writes the
+previews above. The script lays the theme out at run time (`lordos.script`).
+
## Lumo, the mascot (`mascot/`)
Lumo, the guardian of LordOS: a small celestial fox with white fur and violet highlights, who wears
diff --git a/server/src/install/install.c b/server/src/install/install.c
index 638802d..e87996f 100644
--- a/server/src/install/install.c
+++ b/server/src/install/install.c
@@ -673,9 +673,16 @@ void install_act_run(const AdminReq *r, const char *arg, size_t len) {
/* machine identity and boot */
unlink(TARGET "/etc/machine-id");
{ const char *const a[] = { "/usr/bin/systemd-machine-id-setup", NULL }; in_target(a); }
+ /* the boot menu theme and the boot splash (docs/ISO.md, "Boot splash and boot menu"): the theme
+ * and Plymouth come in the copied system; without them, the plain menu and text boot as before */
+ int splash = access(TARGET "/usr/bin/plymouth", X_OK) == 0 && access(TARGET "/usr/share/plymouth/themes/lordos/lordos.plymouth", R_OK) == 0;
+ int theme = access(TARGET "/usr/share/grub/themes/lordos/theme.txt", R_OK) == 0;
writef(TARGET "/etc/default/grub", 0644,
"# generated by the LordOS installer\nGRUB_DEFAULT=0\nGRUB_TIMEOUT=2\nGRUB_DISTRIBUTOR=LordOS\n"
- "GRUB_CMDLINE_LINUX_DEFAULT=\"quiet loglevel=3\"\nGRUB_CMDLINE_LINUX=\"\"\nGRUB_DISABLE_OS_PROBER=true\n");
+ "GRUB_CMDLINE_LINUX_DEFAULT=\"quiet %sloglevel=3\"\nGRUB_CMDLINE_LINUX=\"\"\nGRUB_DISABLE_OS_PROBER=true\n"
+ "GRUB_GFXMODE=auto\nGRUB_GFXPAYLOAD_LINUX=keep\n%s",
+ splash ? "splash vt.global_cursor_default=0 " : "",
+ theme ? "GRUB_TERMINAL_OUTPUT=gfxterm\nGRUB_THEME=/usr/share/grub/themes/lordos/theme.txt\n" : "");
progress("configure", ++step, steps);
{ const char *const a[] = { "/usr/sbin/update-initramfs", "-u", "-k", "all", NULL }; if (in_target(a)) FAIL("install.initramfsFailed"); }
progress("configure", ++step, steps);
diff --git a/server/src/kms.c b/server/src/kms.c
index db23e7a..221eecf 100644
--- a/server/src/kms.c
+++ b/server/src/kms.c
@@ -295,7 +295,7 @@ int kms_scanout_ok(const Kms *k, uint32_t fourcc, uint64_t modifier) {
return 0;
}
-static int kms_setup(Kms *k) {
+static int kms_setup(Kms *k, int keep) {
if (pick_output(k)) return -1;
read_scanout_formats(k);
k->saved.crtc_id = k->crtc_id;
@@ -304,13 +304,19 @@ static int kms_setup(Kms *k) {
/* the first frame in black (not what the previous session left) */
memset(k->buf[0].map, 0, k->buf[0].size);
memset(k->buf[1].map, 0, k->buf[1].size);
- struct drm_mode_crtc set = {
- .crtc_id = k->crtc_id, .fb_id = k->buf[0].fb_id,
- .set_connectors_ptr = (uintptr_t)&k->conn_id, .count_connectors = 1,
- .mode = k->mode, .mode_valid = 1,
- };
- if (xioctl(k->fd, DRM_IOCTL_MODE_SETCRTC, &set)) { perror("SETCRTC"); return -1; }
k->front = 0;
+ if (keep) {
+ /* the boot splash stays on the screen until our first frame (the modeset is done there) */
+ k->modeset_pending = 1;
+ } else {
+ struct drm_mode_crtc set = {
+ .crtc_id = k->crtc_id, .fb_id = k->buf[0].fb_id,
+ .set_connectors_ptr = (uintptr_t)&k->conn_id, .count_connectors = 1,
+ .mode = k->mode, .mode_valid = 1,
+ };
+ if (xioctl(k->fd, DRM_IOCTL_MODE_SETCRTC, &set)) { perror("SETCRTC"); return -1; }
+ k->presented = 1;
+ }
busy_crtcs |= 1u << k->crtc_index;
fprintf(stderr, "kms: %ux%u@%u on connector %u, crtc %u\n",
k->width, k->height, k->mode.vrefresh, k->conn_id, k->crtc_id);
@@ -352,15 +358,15 @@ int kms_open(Kms *k, const char *path) {
if (k->fd < 0) { perror(path); return -1; }
if (xioctl(k->fd, DRM_IOCTL_SET_MASTER, NULL))
fprintf(stderr, "kms: warning, we are not DRM master (%s)\n", strerror(errno));
- if (kms_setup(k)) { kms_close(k); return -1; }
+ if (kms_setup(k, 0)) { kms_close(k); return -1; }
return 0;
}
-int kms_attach(Kms *k, int fd) {
+int kms_attach(Kms *k, int fd, int keep) {
memset(k, 0, sizeof *k);
k->fd = fd;
k->borrowed = 1;
- if (kms_setup(k)) { kms_close(k); return -1; }
+ if (kms_setup(k, keep)) { kms_close(k); return -1; }
return 0;
}
@@ -399,6 +405,11 @@ KmsBuffer *kms_back(Kms *k) { return &k->buf[k->front ^ 1]; }
int kms_flip(Kms *k) {
int back = k->front ^ 1;
+ if (k->modeset_pending) { /* the first frame after the boot splash: modeset */
+ if (kms_set_fb(k, k->buf[back].fb_id)) { perror("SETCRTC"); return -1; }
+ k->front = back;
+ return 0;
+ }
struct drm_mode_crtc_page_flip pf = {
.crtc_id = k->crtc_id, .fb_id = k->buf[back].fb_id,
.flags = DRM_MODE_PAGE_FLIP_EVENT,
@@ -491,7 +502,10 @@ int kms_set_fb(Kms *k, uint32_t fb) {
.set_connectors_ptr = (uintptr_t)&k->conn_id, .count_connectors = 1,
.mode = k->mode, .mode_valid = 1,
};
- return xioctl(k->fd, DRM_IOCTL_MODE_SETCRTC, &set);
+ if (xioctl(k->fd, DRM_IOCTL_MODE_SETCRTC, &set)) return -1;
+ k->modeset_pending = 0;
+ k->presented = 1;
+ return 0;
}
int kms_flip_fb(Kms *k, uint32_t fb, void *data) {
@@ -499,7 +513,7 @@ int kms_flip_fb(Kms *k, uint32_t fb, void *data) {
.crtc_id = k->crtc_id, .fb_id = fb, .flags = DRM_MODE_PAGE_FLIP_EVENT, .user_data = (uintptr_t)data,
};
k->custom = 1;
- if (xioctl(k->fd, DRM_IOCTL_MODE_PAGE_FLIP, &pf) == 0) { k->flip_pending = 1; return 0; }
+ if (!k->modeset_pending && xioctl(k->fd, DRM_IOCTL_MODE_PAGE_FLIP, &pf) == 0) { k->flip_pending = 1; return 0; }
/* no page flip: synchronous modeset and notify right away */
if (kms_set_fb(k, fb)) return -1;
struct timespec t;
@@ -587,6 +601,7 @@ int kms_modeset(Kms *k, uint32_t conn_id, const struct drm_mode_modeinfo *mode)
.set_connectors_ptr = (uintptr_t)&k->conn_id, .count_connectors = 1, .mode = k->mode, .mode_valid = 1 };
ok = xioctl(k->fd, DRM_IOCTL_MODE_SETCRTC, &set) == 0;
if (!ok) perror("kms: SETCRTC (new mode)");
+ else { k->modeset_pending = 0; k->presented = 1; }
}
if (!ok) { /* back to the previous mode */
destroy_buffer(k, &k->buf[0]);
diff --git a/server/src/kms.h b/server/src/kms.h
index 7acb77a..46d44f5 100644
--- a/server/src/kms.h
+++ b/server/src/kms.h
@@ -35,6 +35,9 @@ typedef struct {
uint64_t cursor_size;
int cursor_ok, cursor_visible;
int borrowed; /* the fd came from lord-sessiond (it handles master and the previous mode) */
+ /* boot splash hand-off (kms_attach with keep): no modeset until the first real frame, so the
+ * splash stays up instead of a black frame. presented: a frame of ours is on the screen. */
+ int modeset_pending, presented;
int shared; /* a second display (kms_head_open): the fd belongs to the main head */
/* the CRTC's primary plane: formats and modifiers it accepts (IN_FORMATS property). On the
* Raspberry Pi (vc4) RGB is only shown linear: buffers with v3d's UIF tiling do not go
@@ -45,8 +48,9 @@ typedef struct {
} Kms;
int kms_open(Kms *k, const char *path);
-/* With a card fd passed by lord-sessiond (already master): same setup as kms_open. */
-int kms_attach(Kms *k, int fd);
+/* With a card fd passed by lord-sessiond (already master): same setup as kms_open. keep: what
+ * the screen shows (the boot splash) stays until the first kms_flip/kms_set_fb/kms_flip_fb. */
+int kms_attach(Kms *k, int fd, int keep);
void kms_close(Kms *k);
/* Free buffer to draw on (the one not on screen). */
KmsBuffer *kms_back(Kms *k);
diff --git a/server/src/main.c b/server/src/main.c
index d20b894..f9144d3 100644
--- a/server/src/main.c
+++ b/server/src/main.c
@@ -32,6 +32,7 @@
#include "wl/wl.h"
#include "gpu/gpu.h"
#include "remote/mirror.h"
+#include "remote/proto.h"
#include "tp/tp.h"
#include "tp/tp_route.h"
#include "wl/wl_input.h"
@@ -703,14 +704,18 @@ static void remote_input_add(const int *fds, int n) {
* dock): the fds are kept and display_attach is tried again on the next DRM uevent, so plugging in the
* monitor later shows the session without restarting anything. RP_UNDISPLAY drops them. */
#define PARK_MAX 40
-static int parked_fd[PARK_MAX], parked_n;
+static int parked_fd[PARK_MAX], parked_n, parked_flags;
static unsigned parked_seq;
static void parked_drop(void) {
for (int i = 0; i < parked_n; i++) close(parked_fd[i]);
parked_n = 0;
}
-static void display_attach(const int *fds, int n) {
+/* Boot splash hand-off: lord-sessiond lent the card with RP_DISPLAY_KEEP; RP_SHOWN goes back once
+ * the first frame is on the screen (docs/SESSIONS.md, "Boot splash"). */
+static int splash_wait;
+
+static void display_attach(const int *fds, int n, int flags) {
Server *s = remote_server;
parked_drop(); /* a new RP_DISPLAY replaces what was waiting */
if (!s->headless || n < 1) { for (int i = 0; i < n; i++) close(fds[i]); return; }
@@ -719,13 +724,15 @@ static void display_attach(const int *fds, int n) {
memset(o0, 0, sizeof *o0);
o0->gpu = -1;
int card = dup(fds[0]); /* kms_attach closes its fd when it fails */
- if (kms_attach(&o0->kms, fds[0])) {
+ int keep = (flags & RP_DISPLAY_KEEP) != 0;
+ if (kms_attach(&o0->kms, fds[0], keep)) {
o0->kms.fd = -1;
if (card >= 0 && n <= PARK_MAX) {
fprintf(stderr, "monitor: nothing connected to the card; waiting for a monitor (hotplug)\n");
parked_fd[0] = card;
for (int i = 1; i < n; i++) parked_fd[i] = fds[i];
parked_n = n;
+ parked_flags = flags;
parked_seq = display_hotplug_seq();
} else {
fprintf(stderr, "monitor: could not use the card\n");
@@ -736,6 +743,7 @@ static void display_attach(const int *fds, int n) {
return;
}
if (card >= 0) close(card);
+ splash_wait = keep;
if (input_open_fds(&s->input, fds + 1, n - 1)) fprintf(stderr, "monitor: no keyboard or mouse\n");
wl_input_devices_changed(); /* is there a touch screen? (wl_seat touch) */
s->headless = 0;
@@ -768,6 +776,7 @@ static void display_attach(const int *fds, int n) {
static void display_detach(void) {
Server *s = remote_server;
parked_drop();
+ splash_wait = 0;
if (s->headless) return;
gpu_tex_free(s->cursor_tex);
s->cursor_tex = NULL;
@@ -1619,7 +1628,11 @@ int main(int argc, char **argv) {
int f[PARK_MAX], fn = parked_n;
memcpy(f, parked_fd, sizeof(int) * (size_t)fn);
parked_n = 0;
- display_attach(f, fn);
+ display_attach(f, fn, parked_flags);
+ }
+ if (splash_wait && !s.headless && main_out(&s)->kms.presented) {
+ splash_wait = 0;
+ mirror_shown(); /* lord-sessiond: the boot splash can go */
}
hw_events();
media_events(js_media_event);
diff --git a/server/src/remote/mirror.c b/server/src/remote/mirror.c
index 4559167..a427264 100644
--- a/server/src/remote/mirror.c
+++ b/server/src/remote/mirror.c
@@ -232,7 +232,7 @@ static void handle(Client *c, int type, const unsigned char *d, uint32_t n) {
break;
case RP_DISPLAY:
if (c->seat && c->nfds > 0 && cb.display) {
- cb.display(c->fds, c->nfds); /* the fds now belong to the session */
+ cb.display(c->fds, c->nfds, n >= 2 ? d[1] : 0); /* the fds now belong to the session */
c->nfds = 0;
}
break;
@@ -389,6 +389,14 @@ void mirror_session(const char *json) {
send_json(RP_SESSION, json, 0);
}
void mirror_greeter(const char *json) { send_json(RP_GREETER, json, 1); }
+void mirror_shown(void) {
+ if (lfd < 0) return;
+ for (int i = 0; i < MAX_CLIENTS; i++) {
+ if (cl[i].fd < 0 || !cl[i].seat) continue;
+ msg(&cl[i], RP_SHOWN, NULL, 0, NULL, 0);
+ pump(&cl[i]);
+ }
+}
int mirror_pollfds(struct pollfd *p, int max) {
int n = 0;
diff --git a/server/src/remote/mirror.h b/server/src/remote/mirror.h
index c9ee304..54c76be 100644
--- a/server/src/remote/mirror.h
+++ b/server/src/remote/mirror.h
@@ -18,8 +18,8 @@ typedef struct {
void (*resize)(int w, int h); /* request for another screen size (RP_RESIZE) */
void (*greeter)(const char *json); /* notice from lord-sessiond to the login screen */
/* lord-sessiond lends the monitor: fds[0] the card (already master), the rest keyboards and mice
- * (they now belong to the session). undisplay: gives it back. */
- void (*display)(const int *fds, int n);
+ * (they now belong to the session); flags: RP_DISPLAY_KEEP (proto.h). undisplay: gives it back. */
+ void (*display)(const int *fds, int n, int flags);
void (*undisplay)(void);
/* browser trackpad: scroll in pixels (phase 1 begins, 2 continues, 3 ends) and pinch
* (ctrl+wheel or the gesturechange of WebKit browsers; scale relative to the start, rotation in degrees) */
@@ -40,6 +40,8 @@ int mirror_has_seat(void); /* is lord-sessiond (monit
* ({"a":"lock"}: lock; {"a":"switch"}: switch user) and RP_GREETER to the monitor. */
void mirror_session(const char *json);
void mirror_greeter(const char *json);
+/* To lord-sessiond: the first frame after an RP_DISPLAY_KEEP is on the screen (RP_SHOWN). */
+void mirror_shown(void);
/* A new screen frame (without the cursor). Compares it tile by tile with the previous one and sends
* only what changed to each connection that is ready. */
diff --git a/server/src/remote/monitor.c b/server/src/remote/monitor.c
index f11ffa9..21ee8e1 100644
--- a/server/src/remote/monitor.c
+++ b/server/src/remote/monitor.c
@@ -118,7 +118,7 @@ void sd_mon_close(void) {
int sd_mon_fd(void) { return conn; }
-int sd_mon_show(int fd, const char *who) {
+int sd_mon_show(int fd, const char *who, int keep) {
take_back();
conn = fd;
drm = open(CARD, O_RDWR | O_CLOEXEC);
@@ -136,9 +136,11 @@ int sd_mon_show(int fd, const char *who) {
memcpy(fds + 1, ins, sizeof(int) * (size_t)nin);
char hello[64];
snprintf(hello, sizeof hello, "monitor %s", who);
- unsigned char count = (unsigned char)(nin + 1);
+ /* keep: the boot splash is still on the screen; the session leaves it there until its first
+ * frame instead of showing black, and answers RP_SHOWN */
+ unsigned char disp[2] = { (unsigned char)(nin + 1), keep ? RP_DISPLAY_KEEP : 0 };
if (send_msg(RP_SEAT, NULL, 0, NULL, 0) || send_msg(RP_HELLO, hello, strlen(hello), NULL, 0) ||
- send_msg(RP_DISPLAY, &count, 1, fds, nin + 1)) {
+ send_msg(RP_DISPLAY, disp, sizeof disp, fds, nin + 1)) {
sd_log("the session did not get the monitor");
return -1;
}
@@ -147,8 +149,8 @@ int sd_mon_show(int fd, const char *who) {
void sd_mon_greeter(const char *json) { send_msg(RP_GREETER_IN, json, strlen(json), NULL, 0); }
-/* Requests from the session being shown (RP_SESSION, RP_GREETER: JSON up to 4 KB). Everything else is
- * discarded without looking at it. -1 if the session closed. */
+/* Requests from the session being shown (RP_SESSION, RP_GREETER: JSON up to 4 KB; RP_SHOWN with no
+ * data). Everything else is discarded without looking at it. -1 if the session closed. */
int sd_mon_read(void (*fn)(int type, const char *json)) {
for (;;) {
if (rcap - rlen < 8192) {
@@ -183,7 +185,8 @@ int sd_mon_read(void (*fn)(int type, const char *json)) {
}
if (rlen - off < 4 + (size_t)len) break;
int type = rb[off + 4];
- if ((type == RP_SESSION || type == RP_GREETER) && len - 1 < 4096) {
+ if (type == RP_SHOWN) fn(type, "");
+ else if ((type == RP_SESSION || type == RP_GREETER) && len - 1 < 4096) {
char j[4096];
memcpy(j, rb + off + 5, len - 1);
j[len - 1] = 0;
diff --git a/server/src/remote/proto.h b/server/src/remote/proto.h
index bd2c007..d6ddc09 100644
--- a/server/src/remote/proto.h
+++ b/server/src/remote/proto.h
@@ -17,6 +17,8 @@ enum {
RP_CURSOR = 4, /* i16 x, y, u8 mode (0 arrow, 1 image, 2 hidden) */
RP_SHAPE = 5, /* u16 w, h, hx, hy + w*h u32 pixels: an app's cursor image */
RP_CLIP = 6, /* UTF-8 text: the session clipboard changed */
+ RP_SHOWN = 7, /* no data, to lord-sessiond only: the first frame after an RP_DISPLAY with
+ * RP_DISPLAY_KEEP is on the screen (the boot splash can go; docs/SESSIONS.md) */
RP_SESSION = 9, /* JSON: request from the session to the monitor ({"a":"lock"} or {"a":"switch"}) */
RP_GREETER = 20, /* JSON: request from the login screen to lord-sessiond (greeter mode only) */
};
@@ -34,7 +36,8 @@ enum {
RP_SEAT = 18, /* this connection is lord-sessiond, which drives the monitor: it doesn't get the screen,
* only the requests (RP_SESSION, RP_GREETER); root only */
RP_DISPLAY = 19, /* + fds (SCM_RIGHTS): the video card (already master) and the input
- * devices. The session starts showing on the monitor (with GPU if any). Root only */
+ * devices. The session starts showing on the monitor (with GPU if any). Root only.
+ * Data: u8 number of fds, optional u8 flags (RP_DISPLAY_KEEP) */
RP_UNDISPLAY = 22, /* the session leaves the monitor (goes back to drawing in memory). Root only */
RP_GREETER_IN = 21, /* JSON: reply or notice from lord-sessiond to the login screen */
RP_INPUT_ADD = 23, /* + fds: keyboards, mice or touchpads plugged in later (only to the monitor's
@@ -45,4 +48,8 @@ enum {
RP_PINCH = 31, /* u8 phase, i32 scale ×65536 (relative to the start), i32 rotation in degrees ×256 */
};
+/* RP_DISPLAY flags */
+#define RP_DISPLAY_KEEP 1 /* the screen still shows the boot splash: keep it (no black first frame)
+ * until the session's first frame, then answer RP_SHOWN */
+
#endif
diff --git a/server/src/remote/sessiond.c b/server/src/remote/sessiond.c
index 4ea81ff..d939ec6 100644
--- a/server/src/remote/sessiond.c
+++ b/server/src/remote/sessiond.c
@@ -540,6 +540,23 @@ static void set_shown(char k, const char *user) {
rd_unlock();
}
+/* Boot splash hand-off (docs/SESSIONS.md, "Boot splash"). Until the first session frame of this boot
+ * is on the monitor, the screen shows the boot splash (or the console): the session keeps it there
+ * instead of a black first frame (RP_DISPLAY_KEEP) and says when its frame is up (RP_SHOWN). Then
+ * SD_FIRST_FRAME is created and lordos-splash-quit.service ends Plymouth. Only before that first
+ * frame: later the screen may hold another user's session, which must never stay visible. */
+static int splash_up(void) {
+ struct stat st;
+ return stat(SD_FIRST_FRAME, &st) != 0;
+}
+
+static void first_frame(void) {
+ if (!splash_up()) return;
+ int f = open(SD_FIRST_FRAME, O_WRONLY | O_CREAT | O_CLOEXEC | O_NOFOLLOW, 0644);
+ if (f >= 0) close(f);
+ sd_log("first frame on the monitor: the boot splash can go");
+}
+
/* What the workers send: which session to show and messages for the login screen. */
static void from_worker(void) {
char buf[4200];
@@ -549,13 +566,13 @@ static void from_worker(void) {
char user[40];
if (!strcmp(buf, "show g") && fd >= 0) {
set_shown('g', NULL);
- if (sd_mon_show(fd, "-")) { sd_mon_lost(); set_shown('-', NULL); }
+ if (sd_mon_show(fd, "-", splash_up())) { sd_mon_lost(); set_shown('-', NULL); }
return;
}
if (sscanf(buf, "show u %32s", user) == 1 && fd >= 0 && sd_valid_username(user)) {
sd_log("monitor: %s's session", user);
set_shown('u', user);
- if (sd_mon_show(fd, user)) { sd_mon_lost(); set_shown('-', NULL); show_greeter("login", NULL); }
+ if (sd_mon_show(fd, user, splash_up())) { sd_mon_lost(); set_shown('-', NULL); show_greeter("login", NULL); }
else save_last_user(user);
return;
}
@@ -566,6 +583,7 @@ static void from_worker(void) {
/* Requests from the session being shown: lock or switch user; from the login screen:
* log in, restart or shut down. */
static void from_shown(int type, const char *j) {
+ if (type == RP_SHOWN) { first_frame(); return; }
if (type == RP_SESSION && shown == 'u') {
if (strstr(j, "\"lock\"")) { sd_log("%s locked the screen", shown_user); show_greeter("lock", shown_user); }
else if (strstr(j, "\"switch\"")) { sd_log("%s is switching user", shown_user); show_greeter("switch", shown_user); }
@@ -745,6 +763,7 @@ int main(int argc, char **argv) {
sd_netd_start();
has_monitor = !no_monitor && sd_mon_open() == 0;
if (has_monitor) boot_monitor();
+ else first_frame(); /* nothing will be shown: the boot splash can go now */
if (rd_conf.enabled) start_remote();
write_status();
diff --git a/server/src/remote/sessiond.h b/server/src/remote/sessiond.h
index b95680d..564b603 100644
--- a/server/src/remote/sessiond.h
+++ b/server/src/remote/sessiond.h
@@ -16,6 +16,9 @@
#define RD_CONF_DIR "/etc/lordos/remote"
#define SD_RUN_DIR "/run/lordos"
#define SD_STATUS SD_RUN_DIR "/status.json"
+/* created when the first session frame is on the monitor; lordos-splash-quit.service waits for it to
+ * end the boot splash (plymouth quit --retain-splash). See docs/SESSIONS.md, "Boot splash". */
+#define SD_FIRST_FRAME SD_RUN_DIR "/first-frame"
#define SD_GREETER_RUN SD_RUN_DIR "/greeter" /* XDG_RUNTIME_DIR of the login screen */
#define SD_SESSION_CONF "/etc/lordos/session.conf" /* AUTOLOGIN=user (empty: login screen) */
#define SD_USERS_DIR "/var/lib/lordos/users" /* avatars: <user>.json and <user>.png */
@@ -101,7 +104,8 @@ unsigned char *rd_encode_rgba(const uint32_t *px, int w, int h, int *len); /*
/* ---- monitor.c: lending the monitor to a session ---- */
int sd_mon_open(void); /* 0 if there is a video card (and puts the console in graphics mode) */
void sd_mon_close(void);
-int sd_mon_show(int session_fd, const char *who); /* gives it the card and input; keeps the fd */
+int sd_mon_show(int session_fd, const char *who, int keep); /* gives it the card and input; keeps the fd.
+ * keep: the boot splash is still up (RP_DISPLAY_KEEP) */
int sd_mon_fd(void); /* socket of the session being shown, or -1 */
int sd_mon_read(void (*fn)(int type, const char *json)); /* -1 if the session closed */
void sd_mon_greeter(const char *json); /* RP_GREETER_IN to the login screen */
diff --git a/tools/boot/gen-boot-assets.py b/tools/boot/gen-boot-assets.py
new file mode 100644
index 0000000..6a0a955
--- /dev/null
+++ b/tools/boot/gen-boot-assets.py
@@ -0,0 +1,232 @@
+#!/usr/bin/env python3
+"""gen-boot-assets.py: renders the boot splash (Plymouth) and boot menu (GRUB) images.
+
+Everything comes from our own vectors: the crown is assets/brand/crown.svg and the wordmark is the
+text of assets/brand/logo-horizontal-dark.svg (already converted to paths, Plus Jakarta Sans). The
+bar, the glow and the menu pieces are drawn here as small SVGs. Needs rsvg-convert.
+
+ python3 tools/boot/gen-boot-assets.py
+
+Writes tools/boot/plymouth/lordos/*.png (1x and @2x) and tools/iso/grub/lordos/*.png. The GRUB
+fonts (*.pf2) are made with grub-mkfont, see docs/ISO.md, "Boot splash and boot menu".
+See docs/brand/README.md, "Boot splash".
+"""
+import os
+import re
+import subprocess
+import sys
+import tempfile
+
+ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+PLY = os.path.join(ROOT, "tools/boot/plymouth/lordos")
+GRUB = os.path.join(ROOT, "tools/iso/grub/lordos")
+CROWN = os.path.join(ROOT, "assets/brand/crown.svg")
+LOGO = os.path.join(ROOT, "assets/brand/logo-horizontal-dark.svg")
+
+# brand colours (docs/LORDOS-BRAND.md)
+BG_TOP, BG_BOTTOM = "#12122A", "#0B0B1C"
+VIOLET, LILAC = "#6E4BFF", "#B46CFF"
+
+
+def render(svg, out, w=None, h=None):
+ with tempfile.NamedTemporaryFile("w", suffix=".svg", delete=False) as f:
+ f.write(svg)
+ src = f.name
+ try:
+ cmd = ["rsvg-convert", "-o", out]
+ if w:
+ cmd += ["-w", str(w)]
+ if h:
+ cmd += ["-h", str(h)]
+ subprocess.run(cmd + [src], check=True)
+ finally:
+ os.unlink(src)
+
+
+def render_file(src, out, w):
+ subprocess.run(["rsvg-convert", "-w", str(w), "-o", out, src], check=True)
+
+
+def svg(w, h, body, defs=""):
+ return (f'<svg xmlns="http://www.w3.org/2000/svg" width="{w}" height="{h}" viewBox="0 0 {w} {h}">'
+ f"<defs>{defs}</defs>{body}</svg>")
+
+
+def wordmark_svg():
+ """The wordmark alone: the paths of logo-horizontal-dark.svg that come after the crown group."""
+ s = open(LOGO).read()
+ # the crown is the first <g transform=...>…</g> block (with its nested clip group); the
+ # wordmark is the remaining top-level paths
+ head, rest = s.split("<g transform=", 1)
+ depth, i = 0, 0
+ while True:
+ o = rest.find("<g", i)
+ c = rest.find("</g>", i)
+ if o != -1 and o < c:
+ depth += 1
+ i = o + 2
+ else:
+ if depth == 0:
+ tail = rest[c + 4:]
+ break
+ depth -= 1
+ i = c + 4
+ paths = "".join(re.findall(r"<path [^>]*/>", tail))
+ if not paths:
+ sys.exit("gen-boot-assets: wordmark paths not found in " + LOGO)
+ # the text spans x 247..800, y 72..186 in the 812x240 lockup
+ return ('<svg xmlns="http://www.w3.org/2000/svg" viewBox="244 66 562 126" width="562" height="126">'
+ + paths + "</svg>")
+
+
+def bar(w, h, fill, alpha=1.0):
+ r = h / 2
+ return svg(w, h, f'<rect width="{w}" height="{h}" rx="{r}" fill="{fill}" fill-opacity="{alpha}"/>')
+
+
+def plymouth(scale):
+ sfx = "" if scale == 1 else "@2x"
+ p = lambda n: os.path.join(PLY, f"{n}{sfx}.png")
+ s = scale
+ render_file(CROWN, p("crown"), 112 * s)
+ # soft violet glow behind the crown
+ g = 420 * s
+ render(svg(g, g, f'<circle cx="{g/2}" cy="{g/2}" r="{g/2}" fill="url(#r)"/>',
+ f'<radialGradient id="r"><stop offset="0" stop-color="{VIOLET}" stop-opacity=".30"/>'
+ f'<stop offset=".45" stop-color="{VIOLET}" stop-opacity=".12"/>'
+ f'<stop offset="1" stop-color="{VIOLET}" stop-opacity="0"/></radialGradient>'), p("glow"))
+ # the progress bar: track, the two round caps of the fill and its body (scaled by the script)
+ bw, bh = 200 * s, 6 * s
+ render(bar(bw, bh, "#FFFFFF", 0.12), p("track"))
+ render(svg(bh, bh, f'<circle cx="{bh/2}" cy="{bh/2}" r="{bh/2}" fill="{LILAC}"/>'), p("cap-start"))
+ render(svg(bh, bh, f'<circle cx="{bh/2}" cy="{bh/2}" r="{bh/2}" fill="{VIOLET}"/>'), p("cap-end"))
+ render(svg(64, bh, '<rect width="64" height="%d" fill="url(#l)"/>' % bh,
+ f'<linearGradient id="l"><stop offset="0" stop-color="{LILAC}"/>'
+ f'<stop offset="1" stop-color="{VIOLET}"/></linearGradient>'), p("fill"))
+ # the wordmark under the bar (white; the script sets its opacity)
+ render(wordmark_svg(), p("wordmark"), h=12 * s)
+ # the password field (encrypted disks) and its dots
+ ew, eh = 280 * s, 40 * s
+ render(svg(ew, eh, f'<rect x="{s/2}" y="{s/2}" width="{ew-s}" height="{eh-s}" rx="{12*s}" '
+ f'fill="#FFFFFF" fill-opacity=".07" stroke="#FFFFFF" stroke-opacity=".22" stroke-width="{s}"/>'),
+ p("entry"))
+ d = 8 * s
+ render(svg(d, d, f'<circle cx="{d/2}" cy="{d/2}" r="{d/2}" fill="#FFFFFF"/>'), p("bullet"))
+ # a small lock above the field
+ render(svg(18, 22, '<path d="M5 9V6.5a4 4 0 0 1 8 0V9" fill="none" stroke="#FFFFFF" stroke-opacity=".8" stroke-width="2"/>'
+ '<rect x="2" y="9" width="14" height="11" rx="3" fill="#FFFFFF" fill-opacity=".8"/>'),
+ p("lock"), w=18 * s)
+
+
+def grub():
+ W, H = 1920, 1080
+ render(svg(W, H,
+ f'<rect width="{W}" height="{H}" fill="url(#v)"/>'
+ f'<ellipse cx="{W/2}" cy="{H*0.30}" rx="{H*0.42}" ry="{H*0.36}" fill="url(#r)"/>',
+ f'<linearGradient id="v" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="{BG_TOP}"/>'
+ f'<stop offset="1" stop-color="{BG_BOTTOM}"/></linearGradient>'
+ f'<radialGradient id="r"><stop offset="0" stop-color="{VIOLET}" stop-opacity=".20"/>'
+ f'<stop offset=".5" stop-color="{VIOLET}" stop-opacity=".07"/>'
+ f'<stop offset="1" stop-color="{VIOLET}" stop-opacity="0"/></radialGradient>'),
+ os.path.join(GRUB, "background.png"))
+ render_file(CROWN, os.path.join(GRUB, "crown.png"), 96)
+ # 9-slice pieces of the selected entry (rounded, translucent violet), 12 px corners
+ # GRUB draws the corners and edges *around* the item box, so they stay small (8 px)
+ c = 8
+ full = svg(3 * c, 3 * c, f'<rect width="{3*c}" height="{3*c}" rx="{c}" fill="{VIOLET}" fill-opacity=".34"/>'
+ f'<rect x=".5" y=".5" width="{3*c-1}" height="{3*c-1}" rx="{c-.5}" fill="none" '
+ f'stroke="{LILAC}" stroke-opacity=".45"/>')
+ tmp = os.path.join(GRUB, ".select-full.png")
+ render(full, tmp)
+ crop9(tmp, "select", c)
+ os.unlink(tmp)
+ # the box GRUB clears while loading the kernel: navy instead of black
+ render(svg(8, 8, f'<rect width="8" height="8" fill="{BG_BOTTOM}"/>'), os.path.join(GRUB, "terminal_box_c.png"))
+
+
+def crop(src, out, x, y, w, h):
+ """Crops with rsvg-convert itself (an SVG that embeds the PNG): no other image tools needed."""
+ import base64
+ data = base64.b64encode(open(src, "rb").read()).decode()
+ iw, ih = png_size(src)
+ render(f'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" '
+ f'width="{w}" height="{h}" viewBox="{x} {y} {w} {h}"><image width="{iw}" height="{ih}" '
+ f'xlink:href="data:image/png;base64,{data}"/></svg>', out)
+
+
+def png_size(p):
+ import struct
+ with open(p, "rb") as f:
+ f.read(16)
+ return struct.unpack(">II", f.read(8))
+
+
+def crop9(src, name, c):
+ parts = {"nw": (0, 0), "n": (c, 0), "ne": (2 * c, 0), "w": (0, c), "c": (c, c), "e": (2 * c, c),
+ "sw": (0, 2 * c), "s": (c, 2 * c), "se": (2 * c, 2 * c)}
+ for k, (x, y) in parts.items():
+ crop(src, os.path.join(GRUB, f"{name}_{k}.png"), x, y, c, c)
+
+
+def uri(path):
+ import base64
+ return "data:image/png;base64," + base64.b64encode(open(path, "rb").read()).decode()
+
+
+def preview(out, progress=0.6, password=False, W=1920, H=1080):
+ """A static picture of the splash, laid out exactly like lordos.script does at 1x."""
+ img = lambda n: os.path.join(PLY, n + ".png")
+ def place(name, x, y, opacity=1.0, w=None):
+ iw, ih = png_size(img(name))
+ w = iw if w is None else w
+ return (f'<image x="{x}" y="{y}" width="{w}" height="{ih}" opacity="{opacity}" '
+ f'preserveAspectRatio="none" xlink:href="{uri(img(name))}"/>')
+ cw, ch = png_size(img("crown"))
+ gw, gh = png_size(img("glow"))
+ tw, th = png_size(img("track"))
+ ww, wh = png_size(img("wordmark"))
+ cx, cy = W / 2, H / 2
+ crown_y = cy - ch / 2 - 40
+ bar_y = crown_y + ch + 56
+ body = [f'<rect width="{W}" height="{H}" fill="url(#v)"/>',
+ place("glow", cx - gw / 2, crown_y + ch / 2 - gh / 2),
+ place("crown", cx - cw / 2, crown_y)]
+ if password:
+ ew, eh = png_size(img("entry"))
+ lw, lh = png_size(img("lock"))
+ ey = bar_y - 8
+ body += [place("lock", cx - lw / 2, ey - lh - 12, 1.0), place("entry", cx - ew / 2, ey)]
+ bw, _ = png_size(img("bullet"))
+ for i in range(8):
+ body.append(place("bullet", cx - ew / 2 + 18 + i * (bw + 8), ey + eh / 2 - bw / 2))
+ else:
+ fw = max(th, round(tw * progress))
+ x0 = cx - tw / 2
+ body += [place("track", x0, bar_y),
+ place("fill", x0 + th / 2, bar_y, w=max(0, fw - th)),
+ place("cap-start", x0, bar_y),
+ place("cap-end", x0 + fw - th, bar_y)]
+ body.append(place("wordmark", cx - ww / 2, bar_y + th + 28, 0.55))
+ render(f'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" '
+ f'width="{W}" height="{H}"><defs><linearGradient id="v" x1="0" y1="0" x2="0" y2="1">'
+ f'<stop offset="0" stop-color="{BG_TOP}"/><stop offset="1" stop-color="{BG_BOTTOM}"/></linearGradient></defs>'
+ + "".join(body) + "</svg>", out)
+
+
+def main():
+ os.makedirs(PLY, exist_ok=True)
+ os.makedirs(GRUB, exist_ok=True)
+ for s in (1, 2):
+ plymouth(s)
+ grub()
+ print("boot assets written to", os.path.relpath(PLY, ROOT), "and", os.path.relpath(GRUB, ROOT))
+ if "--preview" in sys.argv:
+ d = os.path.join(ROOT, "docs/boot")
+ os.makedirs(d, exist_ok=True)
+ preview(os.path.join(d, "splash-preview.png"))
+ preview(os.path.join(d, "splash-preview-password.png"), password=True)
+ print("previews written to docs/boot/")
+
+
+if __name__ == "__main__":
+ main()
diff --git a/tools/boot/lordos-splash b/tools/boot/lordos-splash
new file mode 100755
index 0000000..0d60053
--- /dev/null
+++ b/tools/boot/lordos-splash
@@ -0,0 +1,34 @@
+#!/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
diff --git a/tools/boot/plymouth/lordos/bullet.png b/tools/boot/plymouth/lordos/bullet.png
new file mode 100644
index 0000000..9887339
Binary files /dev/null and b/tools/boot/plymouth/lordos/bullet.png differ
diff --git a/tools/boot/plymouth/lordos/[email protected] b/tools/boot/plymouth/lordos/[email protected]
new file mode 100644
index 0000000..8bdeee6
Binary files /dev/null and b/tools/boot/plymouth/lordos/[email protected] differ
diff --git a/tools/boot/plymouth/lordos/cap-end.png b/tools/boot/plymouth/lordos/cap-end.png
new file mode 100644
index 0000000..d5cbe1b
Binary files /dev/null and b/tools/boot/plymouth/lordos/cap-end.png differ
diff --git a/tools/boot/plymouth/lordos/[email protected] b/tools/boot/plymouth/lordos/[email protected]
new file mode 100644
index 0000000..5d1f774
Binary files /dev/null and b/tools/boot/plymouth/lordos/[email protected] differ
diff --git a/tools/boot/plymouth/lordos/cap-start.png b/tools/boot/plymouth/lordos/cap-start.png
new file mode 100644
index 0000000..8cb5954
Binary files /dev/null and b/tools/boot/plymouth/lordos/cap-start.png differ
diff --git a/tools/boot/plymouth/lordos/[email protected] b/tools/boot/plymouth/lordos/[email protected]
new file mode 100644
index 0000000..3320e76
Binary files /dev/null and b/tools/boot/plymouth/lordos/[email protected] differ
diff --git a/tools/boot/plymouth/lordos/crown.png b/tools/boot/plymouth/lordos/crown.png
new file mode 100644
index 0000000..f977e1d
Binary files /dev/null and b/tools/boot/plymouth/lordos/crown.png differ
diff --git a/tools/boot/plymouth/lordos/[email protected] b/tools/boot/plymouth/lordos/[email protected]
new file mode 100644
index 0000000..4e36fc6
Binary files /dev/null and b/tools/boot/plymouth/lordos/[email protected] differ
diff --git a/tools/boot/plymouth/lordos/entry.png b/tools/boot/plymouth/lordos/entry.png
new file mode 100644
index 0000000..2af6c01
Binary files /dev/null and b/tools/boot/plymouth/lordos/entry.png differ
diff --git a/tools/boot/plymouth/lordos/[email protected] b/tools/boot/plymouth/lordos/[email protected]
new file mode 100644
index 0000000..890a8eb
Binary files /dev/null and b/tools/boot/plymouth/lordos/[email protected] differ
diff --git a/tools/boot/plymouth/lordos/fill.png b/tools/boot/plymouth/lordos/fill.png
new file mode 100644
index 0000000..ceac4cc
Binary files /dev/null and b/tools/boot/plymouth/lordos/fill.png differ
diff --git a/tools/boot/plymouth/lordos/[email protected] b/tools/boot/plymouth/lordos/[email protected]
new file mode 100644
index 0000000..8b02ee1
Binary files /dev/null and b/tools/boot/plymouth/lordos/[email protected] differ
diff --git a/tools/boot/plymouth/lordos/glow.png b/tools/boot/plymouth/lordos/glow.png
new file mode 100644
index 0000000..e33fe51
Binary files /dev/null and b/tools/boot/plymouth/lordos/glow.png differ
diff --git a/tools/boot/plymouth/lordos/[email protected] b/tools/boot/plymouth/lordos/[email protected]
new file mode 100644
index 0000000..c8c3b2c
Binary files /dev/null and b/tools/boot/plymouth/lordos/[email protected] differ
diff --git a/tools/boot/plymouth/lordos/lock.png b/tools/boot/plymouth/lordos/lock.png
new file mode 100644
index 0000000..7b50c21
Binary files /dev/null and b/tools/boot/plymouth/lordos/lock.png differ
diff --git a/tools/boot/plymouth/lordos/[email protected] b/tools/boot/plymouth/lordos/[email protected]
new file mode 100644
index 0000000..26719f7
Binary files /dev/null and b/tools/boot/plymouth/lordos/[email protected] differ
diff --git a/tools/boot/plymouth/lordos/lordos.plymouth b/tools/boot/plymouth/lordos/lordos.plymouth
new file mode 100644
index 0000000..3478588
--- /dev/null
+++ b/tools/boot/plymouth/lordos/lordos.plymouth
@@ -0,0 +1,8 @@
+[Plymouth Theme]
+Name=LordOS
+Description=The LordOS crown on navy with a calm progress bar
+ModuleName=script
+
+[script]
+ImageDir=/usr/share/plymouth/themes/lordos
+ScriptFile=/usr/share/plymouth/themes/lordos/lordos.script
diff --git a/tools/boot/plymouth/lordos/lordos.script b/tools/boot/plymouth/lordos/lordos.script
new file mode 100644
index 0000000..37bf2fa
--- /dev/null
+++ b/tools/boot/plymouth/lordos/lordos.script
@@ -0,0 +1,205 @@
+# lordos.script: the LordOS boot splash (Plymouth "script" module).
+#
+# The crown on a navy gradient with a soft violet glow, and a rounded progress bar that follows
+# Plymouth's boot progress, smoothed so it never jumps or goes back. No text messages: Esc shows
+# the text console as usual. The password field appears only when a disk asks for one (LUKS).
+# The images come from tools/boot/gen-boot-assets.py (1x, and @2x on 4K screens).
+# See docs/brand/README.md, "Boot splash".
+
+# ---- layout ----
+scale = 1;
+if (Window.GetHeight() >= 1800) scale = 2;
+fun img(name) {
+ if (global.scale == 2) return Image(name + "@2x.png");
+ return Image(name + ".png");
+}
+
+# navy, a little lighter at the top (#12122A → #0B0B1C)
+Window.SetBackgroundTopColor(0.071, 0.071, 0.165);
+Window.SetBackgroundBottomColor(0.043, 0.043, 0.110);
+
+cx = Window.GetX() + Window.GetWidth() / 2;
+cy = Window.GetY() + Window.GetHeight() / 2;
+
+crown_image = img("crown");
+glow_image = img("glow");
+crown_y = Math.Int(cy - crown_image.GetHeight() / 2 - 40 * scale);
+
+glow = Sprite(glow_image);
+glow.SetPosition(Math.Int(cx - glow_image.GetWidth() / 2),
+ Math.Int(crown_y + crown_image.GetHeight() / 2 - glow_image.GetHeight() / 2), 1);
+crown = Sprite(crown_image);
+crown.SetPosition(Math.Int(cx - crown_image.GetWidth() / 2), crown_y, 3);
+
+# ---- the progress bar: track, a scaled gradient body and two round caps ----
+track_image = img("track");
+bar_w = track_image.GetWidth();
+bar_h = track_image.GetHeight();
+bar_x = Math.Int(cx - bar_w / 2);
+bar_y = Math.Int(crown_y + crown_image.GetHeight() + 56 * scale);
+
+track = Sprite(track_image);
+track.SetPosition(bar_x, bar_y, 4);
+fill_image = img("fill");
+fill = Sprite();
+fill.SetPosition(bar_x + bar_h / 2, bar_y, 5);
+cap_start = Sprite(img("cap-start"));
+cap_start.SetPosition(bar_x, bar_y, 6);
+cap_end = Sprite(img("cap-end"));
+cap_end.SetPosition(bar_x, bar_y, 6);
+
+wordmark_image = img("wordmark");
+wordmark = Sprite(wordmark_image);
+wordmark.SetPosition(Math.Int(cx - wordmark_image.GetWidth() / 2), bar_y + bar_h + 28 * scale, 4);
+wordmark.SetOpacity(0.55);
+
+target = 0; # what Plymouth reports (0..1)
+shown = 0; # what the bar draws, eased towards target
+drawn_w = -1;
+bar_visible = 1;
+# shutdown and reboot have no progress: only the crown
+mode = Plymouth.GetMode();
+if (mode == "shutdown" || mode == "reboot") bar_visible = 0;
+
+fun draw_bar() {
+ if (!global.bar_visible) {
+ track.SetOpacity(0); fill.SetOpacity(0); cap_start.SetOpacity(0); cap_end.SetOpacity(0);
+ wordmark.SetOpacity(0);
+ return;
+ }
+ track.SetOpacity(1);
+ wordmark.SetOpacity(0.55);
+ w = Math.Int(global.bar_w * global.shown);
+ if (w == global.drawn_w) return;
+ global.drawn_w = w;
+ if (w < global.bar_h) {
+ # not enough for both caps yet: a dot that grows into the bar
+ cap_start.SetOpacity(w > 0);
+ cap_end.SetOpacity(0);
+ fill.SetOpacity(0);
+ return;
+ }
+ cap_start.SetOpacity(1);
+ cap_end.SetOpacity(1);
+ cap_end.SetX(global.bar_x + w - global.bar_h);
+ body = w - global.bar_h;
+ if (body > 0) {
+ fill.SetImage(global.fill_image.Scale(body, global.bar_h));
+ fill.SetOpacity(1);
+ } else {
+ fill.SetOpacity(0);
+ }
+}
+
+fun boot_progress(duration, progress) {
+ # Plymouth's progress is based on the previous boot's length; on a first boot (the live ISO, a
+ # fresh card) it barely moves, so a time curve keeps the bar going: half at 8 s, two thirds at
+ # 16 s, never past 95 % until Plymouth says so
+ p = 0.95 * duration / (duration + 8);
+ if (progress > p) p = progress;
+ if (p > global.target) global.target = p;
+}
+
+fun refresh() {
+ # ease out: a fraction of the remaining distance each frame (about 50 per second), never back
+ if (global.shown < global.target) {
+ global.shown = global.shown + (global.target - global.shown) * 0.06 + 0.0004;
+ if (global.shown > global.target) global.shown = global.target;
+ }
+ draw_bar();
+}
+
+fun quit() {
+ global.shown = 1;
+ global.drawn_w = -1;
+ draw_bar();
+}
+
+# ---- password (encrypted disks) and questions ----
+entry_image = img("entry");
+entry = Sprite(entry_image);
+entry_x = Math.Int(cx - entry_image.GetWidth() / 2);
+entry_y = bar_y - 8 * scale;
+entry.SetPosition(entry_x, entry_y, 10);
+entry.SetOpacity(0);
+lock_image = img("lock");
+lock = Sprite(lock_image);
+lock.SetPosition(Math.Int(cx - lock_image.GetWidth() / 2), entry_y - lock_image.GetHeight() - 12 * scale, 10);
+lock.SetOpacity(0);
+prompt = Sprite();
+prompt.SetOpacity(0);
+answer = Sprite();
+answer.SetOpacity(0);
+
+bullet_image = img("bullet");
+bullet_step = bullet_image.GetWidth() + 8 * scale;
+max_bullets = Math.Int((entry_image.GetWidth() - 36 * scale) / bullet_step);
+for (i = 0; i < max_bullets; i = i + 1) {
+ bullets[i] = Sprite(bullet_image);
+ bullets[i].SetPosition(entry_x + 18 * scale + i * bullet_step,
+ Math.Int(entry_y + entry_image.GetHeight() / 2 - bullet_image.GetHeight() / 2), 11);
+ bullets[i].SetOpacity(0);
+}
+
+# font names as literals (no number formatting in the script)
+font_small = "Sans 11";
+font_large = "Sans 12";
+if (scale == 2) { font_small = "Sans 22"; font_large = "Sans 24"; }
+
+fun set_prompt(text) {
+ if (text == "") { prompt.SetOpacity(0); return; }
+ t = Image.Text(text, 0.93, 0.92, 1.0, 0.8, global.font_small);
+ prompt.SetImage(t);
+ prompt.SetPosition(Math.Int(global.cx - t.GetWidth() / 2),
+ global.entry_y + global.entry_image.GetHeight() + 14 * global.scale, 10);
+ prompt.SetOpacity(1);
+}
+
+fun show_field(on) {
+ entry.SetOpacity(on);
+ lock.SetOpacity(on);
+ if (!on) {
+ prompt.SetOpacity(0);
+ answer.SetOpacity(0);
+ for (i = 0; i < global.max_bullets; i = i + 1) bullets[i].SetOpacity(0);
+ }
+ global.bar_visible = !on;
+ if (mode == "shutdown" || mode == "reboot") global.bar_visible = 0;
+ global.drawn_w = -1;
+ draw_bar();
+}
+
+fun display_password(text, count) {
+ show_field(1);
+ answer.SetOpacity(0);
+ set_prompt(text);
+ for (i = 0; i < global.max_bullets; i = i + 1) bullets[i].SetOpacity(i < count);
+}
+
+fun display_question(text, typed) {
+ show_field(1);
+ for (i = 0; i < global.max_bullets; i = i + 1) bullets[i].SetOpacity(0);
+ set_prompt(text);
+ t = Image.Text(typed, 1, 1, 1, 1, global.font_large);
+ answer.SetImage(t);
+ answer.SetPosition(global.entry_x + 18 * global.scale,
+ Math.Int(global.entry_y + global.entry_image.GetHeight() / 2 - t.GetHeight() / 2), 11);
+ answer.SetOpacity(1);
+}
+
+fun display_normal() {
+ show_field(0);
+}
+
+# messages are not shown (Esc shows the text console with all of them)
+fun ignore_message(text) {
+}
+
+Plymouth.SetBootProgressFunction(boot_progress);
+Plymouth.SetRefreshFunction(refresh);
+Plymouth.SetQuitFunction(quit);
+Plymouth.SetDisplayPasswordFunction(display_password);
+Plymouth.SetDisplayQuestionFunction(display_question);
+Plymouth.SetDisplayNormalFunction(display_normal);
+Plymouth.SetMessageFunction(ignore_message);
+draw_bar();
diff --git a/tools/boot/plymouth/lordos/track.png b/tools/boot/plymouth/lordos/track.png
new file mode 100644
index 0000000..89b5cbe
Binary files /dev/null and b/tools/boot/plymouth/lordos/track.png differ
diff --git a/tools/boot/plymouth/lordos/[email protected] b/tools/boot/plymouth/lordos/[email protected]
new file mode 100644
index 0000000..496ced3
Binary files /dev/null and b/tools/boot/plymouth/lordos/[email protected] differ
diff --git a/tools/boot/plymouth/lordos/wordmark.png b/tools/boot/plymouth/lordos/wordmark.png
new file mode 100644
index 0000000..b962303
Binary files /dev/null and b/tools/boot/plymouth/lordos/wordmark.png differ
diff --git a/tools/boot/plymouth/lordos/[email protected] b/tools/boot/plymouth/lordos/[email protected]
new file mode 100644
index 0000000..e85e73d
Binary files /dev/null and b/tools/boot/plymouth/lordos/[email protected] differ
diff --git a/tools/boot/systemd/lordos-splash-quit.service b/tools/boot/systemd/lordos-splash-quit.service
new file mode 100644
index 0000000..335452d
--- /dev/null
+++ b/tools/boot/systemd/lordos-splash-quit.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=LordOS: end the boot splash once the login screen is up
+Documentation=file:///usr/share/doc/lordos/README.md
+# started by lordos.service (Wants=); plymouth-quit.service is ordered after this one
+# (plymouth-quit.service.d/lordos.conf), so Plymouth is never ended before LordOS has painted
+After=lordos.service plymouth-start.service
+ConditionPathExists=/usr/bin/plymouth
+
+[Service]
+Type=oneshot
+ExecStart=/usr/lib/lordos/lordos-splash quit
+TimeoutStartSec=60
diff --git a/tools/boot/systemd/plymouth-quit.service.d/lordos.conf b/tools/boot/systemd/plymouth-quit.service.d/lordos.conf
new file mode 100644
index 0000000..8007e0d
--- /dev/null
+++ b/tools/boot/systemd/plymouth-quit.service.d/lordos.conf
@@ -0,0 +1,5 @@
+# LordOS: Plymouth's own "plymouth quit" (without --retain-splash) runs only after LordOS ended the
+# splash keeping its first frame (lordos-splash-quit.service), so there is no text flash in between.
+# Without lordos.service in the boot (another desktop), this ordering does nothing.
+[Unit]
+After=lordos-splash-quit.service
diff --git a/tools/install/install.sh b/tools/install/install.sh
index 9277ae6..31e29aa 100755
--- a/tools/install/install.sh
+++ b/tools/install/install.sh
@@ -75,6 +75,9 @@ Options:
--keep-display-manager do not disable the current display manager (LordOS is not
enabled at boot then; see the final message)
--no-extras do not install the extra sound/font packages the ISO has
+ --boot-splash also set up the LordOS boot splash (Plymouth) without asking;
+ without it, it is only offered (and skipped with --yes)
+ --no-boot-splash do not offer the boot splash
--no-systemd-check continue without a running systemd (containers, chroots):
the systemd steps are skipped
--uninstall remove LordOS and restore the previous login setup
@@ -484,6 +487,105 @@ setup_systemd() {
fi
}
+# ---------------------------------------------------------------- boot splash (optional)
+
+GRUB_DROPIN=/etc/default/grub.d/lordos.cfg
+# themes a stock Debian may have selected; anything else is someone's choice and is asked about
+STOCK_PLYMOUTH_THEMES="ceratopsian emerald futureprototype homeworld joy lines moonlight softwaves spacefun bgrt spinner text details tribar script fade-in glow solar spinfinity"
+
+# the effective GRUB settings (/etc/default/grub plus its grub.d drop-ins), as "cmdline|theme|terminal"
+grub_settings() {
+ (
+ GRUB_CMDLINE_LINUX_DEFAULT=""; GRUB_THEME=""; GRUB_TERMINAL=""; GRUB_TERMINAL_OUTPUT=""
+ # shellcheck disable=SC1091,SC1090
+ [ -r /etc/default/grub ] && . /etc/default/grub
+ for f in /etc/default/grub.d/*.cfg; do
+ # shellcheck disable=SC1090
+ [ -r "$f" ] && [ "$f" != "$GRUB_DROPIN" ] && . "$f"
+ done
+ printf '%s|%s|%s\n' "$GRUB_CMDLINE_LINUX_DEFAULT" "$GRUB_THEME" "${GRUB_TERMINAL_OUTPUT:-$GRUB_TERMINAL}"
+ ) 2>/dev/null
+}
+
+# The LordOS boot splash: Plymouth with the lordos theme (it ships in the package) and, when this
+# system boots with an unmodified GRUB, "splash" on the kernel command line and the LordOS boot menu,
+# through a drop-in of our own that --uninstall removes. A custom bootloader setup is never edited:
+# then only the theme is set and the final message says what to add. See docs/INSTALL-DEBIAN.md.
+setup_splash() {
+ [ "$BOOT_SPLASH" = no ] && return 0
+ [ -f /usr/share/plymouth/themes/lordos/lordos.plymouth ] || return 0
+ if [ "$BOOT_SPLASH" != yes ]; then
+ ask "Also show the LordOS boot splash (logo and progress bar) at boot? It installs Plymouth" 1 || {
+ ok "boot splash: not set up (run again with --boot-splash to add it)"; return 0; }
+ fi
+ step "Setting up the boot splash"
+ apt_install plymouth plymouth-label || { warn "could not install Plymouth; the boot splash was skipped"; return 0; }
+ prev=$(plymouth-set-default-theme 2>/dev/null || true)
+ set_theme=1
+ if [ "$prev" = lordos ]; then
+ set_theme=0
+ elif [ -n "$prev" ] && ! printf '%s\n' $STOCK_PLYMOUTH_THEMES | grep -qx "$prev"; then
+ ask "Your boot splash theme is \"$prev\". Replace it with LordOS's?" 1 || set_theme=0
+ fi
+ if [ "$set_theme" = 1 ]; then
+ state_set PREV_PLYMOUTH_THEME "${prev:-none}"
+ if as_root plymouth-set-default-theme -R lordos >/dev/null 2>&1; then
+ changed "boot splash theme set to lordos (was ${prev:-the default}; initramfs rebuilt)"
+ else
+ warn "plymouth-set-default-theme failed; the boot splash theme was not changed"
+ fi
+ fi
+ # the bootloader: only a GRUB that nobody customised for these settings
+ if ! command -v update-grub >/dev/null 2>&1 || [ ! -f /boot/grub/grub.cfg ]; then
+ SPLASH_NOTE="this system does not boot with GRUB here: add \"quiet splash\" to the kernel command line to see the splash"
+ return 0
+ fi
+ IFS='|' read -r g_cmd g_theme g_term <<EOF
+$(grub_settings)
+EOF
+ add_splash=1; add_theme=1
+ case " $g_cmd " in *" splash "*) add_splash=0 ;; esac
+ case " $g_cmd " in *" nosplash "*) add_splash=0; SPLASH_NOTE="your kernel command line has \"nosplash\" and was left as it is" ;; esac
+ [ -n "$g_theme" ] && add_theme=0
+ case "$g_term" in *console*|*serial*) add_theme=0 ;; esac
+ [ -f /usr/share/grub/themes/lordos/theme.txt ] || add_theme=0
+ if [ "$add_splash" = 0 ] && [ "$add_theme" = 0 ]; then
+ ok "bootloader: left as it is (it already has a splash setting or a theme of its own)"
+ return 0
+ fi
+ as_root mkdir -p /etc/default/grub.d
+ {
+ echo "# LordOS boot splash and boot menu, written by the LordOS installer (install.sh)."
+ echo "# Remove this file and run update-grub to undo (install.sh --uninstall does it)."
+ if [ "$add_splash" = 1 ]; then echo 'GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT splash"'; fi
+ echo 'GRUB_GFXPAYLOAD_LINUX=keep'
+ if [ "$add_theme" = 1 ]; then echo 'GRUB_THEME=/usr/share/grub/themes/lordos/theme.txt'; fi
+ } | as_root tee "$GRUB_DROPIN" >/dev/null
+ state_set GRUB_DROPIN 1
+ if as_root update-grub >/dev/null 2>&1; then
+ changed "GRUB: $GRUB_DROPIN ($( [ "$add_splash" = 1 ] && printf 'splash' )$( [ "$add_splash" = 1 ] && [ "$add_theme" = 1 ] && printf ' and ' )$( [ "$add_theme" = 1 ] && printf 'the LordOS boot menu' )) and update-grub"
+ else
+ warn "update-grub failed; $GRUB_DROPIN was removed again"
+ as_root rm -f "$GRUB_DROPIN"
+ state_set GRUB_DROPIN 0
+ fi
+}
+
+undo_splash() {
+ if [ "$(state_get GRUB_DROPIN)" = 1 ] && [ -f "$GRUB_DROPIN" ]; then
+ as_root rm -f "$GRUB_DROPIN"
+ as_root update-grub >/dev/null 2>&1 || warn "update-grub failed; run it by hand"
+ changed "GRUB: $GRUB_DROPIN removed and update-grub run"
+ fi
+ prev=$(state_get PREV_PLYMOUTH_THEME)
+ if [ -n "$prev" ] && command -v plymouth-set-default-theme >/dev/null 2>&1 &&
+ [ "$(plymouth-set-default-theme 2>/dev/null)" = lordos ]; then
+ if [ "$prev" = none ]; then as_root plymouth-set-default-theme -R --reset >/dev/null 2>&1 || true
+ else as_root plymouth-set-default-theme -R "$prev" >/dev/null 2>&1 || true; fi
+ changed "boot splash theme restored ($prev); Plymouth itself is kept (sudo apt remove plymouth removes it)"
+ fi
+}
+
remote_note() {
if [ -f /etc/lordos/remote/config ] && grep -q '^enabled=1' /etc/lordos/remote/config 2>/dev/null; then
warn "remote desktop was already turned on in /etc/lordos/remote/config before this run; it was left as it was (Settings > Sharing)"
@@ -537,6 +639,7 @@ do_install() {
say " 6. Offer to disable your current display manager, $DM_UNIT (you can switch back)"
fi
fi
+ [ "$BOOT_SPLASH" != no ] && say " Then it offers the LordOS boot splash (Plymouth; never changes a customised bootloader)"
say " It does NOT touch your network configuration, and remote desktop stays off."
say ""
ask "Continue?" 0 || die "cancelled; nothing was changed"
@@ -552,6 +655,7 @@ do_install() {
setup_locales
setup_session_conf
setup_systemd
+ setup_splash
remote_note
network_note
state_set INSTALLER_VERSION "$INSTALLER_VERSION"
@@ -561,6 +665,7 @@ do_install() {
say "What changed:$CHANGES"
say ""
if [ -n "$SIG_NOTE" ]; then say "Signature: $SIG_NOTE."; say ""; fi
+ if [ -n "$SPLASH_NOTE" ]; then say "Boot splash: $SPLASH_NOTE."; say ""; fi
if ! has_systemd; then
say "No systemd here, so nothing was set to start. On a real system run the installer again."
elif [ "$KEEP_DM" = 1 ] && [ -n "$DM_UNIT" ]; then
@@ -614,6 +719,8 @@ do_uninstall() {
fi
[ -n "$(state_get GROUPS_ADDED)" ] && say " - remove $(state_get GROUPS_USER) from the groups the installer added: $(state_get GROUPS_ADDED)"
[ "$(state_get GREETER_CREATED)" = 1 ] && say " - delete the $GREETER_USER system user"
+ [ "$(state_get GRUB_DROPIN)" = 1 ] && say " - remove the LordOS GRUB settings ($GRUB_DROPIN) and run update-grub"
+ [ -n "$(state_get PREV_PLYMOUTH_THEME)" ] && say " - put back the previous boot splash theme"
say " Your home folder and LordOS settings in it (~/.config/lordos) are kept."
say ""
ask "Continue?" 0 || die "cancelled; nothing was changed"
@@ -644,6 +751,7 @@ do_uninstall() {
changed "linger disabled for $lu"
fi
fi
+ undo_splash
case "$installed" in
ii*|iF*|iU*|rc*)
step "Removing the package"
@@ -694,6 +802,7 @@ main() {
ASSUME_YES=0; [ "${LORDOS_YES:-0}" = 1 ] && ASSUME_YES=1
WANT_VERSION=""; LOCAL_DEB=""; TARGET_USER=""; MODE=install; PURGE=""
KEEP_DM=0; NO_EXTRAS=0; SKIP_SYSTEMD_CHECK=0; NO_SYSTEMD=0; DM_SWITCHED=0
+ BOOT_SPLASH=ask; SPLASH_NOTE=""
while [ $# -gt 0 ]; do
case "$1" in
-y|--yes) ASSUME_YES=1 ;;
@@ -705,6 +814,8 @@ main() {
--user=*) TARGET_USER=${1#*=} ;;
--keep-display-manager) KEEP_DM=1 ;;
--no-extras) NO_EXTRAS=1 ;;
+ --boot-splash) BOOT_SPLASH=yes ;;
+ --no-boot-splash) BOOT_SPLASH=no ;;
--no-systemd-check) SKIP_SYSTEMD_CHECK=1 ;;
--uninstall) MODE=uninstall ;;
--purge) PURGE=1 ;;
diff --git a/tools/iso/build.sh b/tools/iso/build.sh
index 4a93b18..c8a4058 100755
--- a/tools/iso/build.sh
+++ b/tools/iso/build.sh
@@ -47,6 +47,9 @@ PKGS_GPU="libgl1-mesa-dri libegl1 libgles2 libgbm1 mesa-vulkan-drivers mesa-util
PKGS_APPS="foot featherpad qt6-wayland chromium firefox-esr"
# the disk installer (server/src/install): partition, format, copy and grub for UEFI and BIOS
PKGS_INSTALLER="gdisk dosfstools e2fsprogs squashfs-tools util-linux grub-common grub2-common grub-efi-amd64-bin grub-pc-bin"
+# the boot splash (the LordOS Plymouth theme comes in the lordos package; plymouth-label draws the
+# password prompt's text for encrypted disks)
+PKGS_SPLASH="plymouth plymouth-label"
echo "== LordOS $VERSION: live ISO in $WORK"
umount_all() {
@@ -87,7 +90,7 @@ in_ch() { chroot "$CH" env DEBIAN_FRONTEND=noninteractive LANG=C.UTF-8 PATH=/usr
echo "== paquetes"
in_ch apt-get update -q > "$WORK/apt.log" 2>&1
# shellcheck disable=SC2086
-in_ch apt-get install -y -q --no-install-recommends $PKGS_BASE $PKGS_LORDOS $PKGS_FIRMWARE $PKGS_GPU $PKGS_APPS $PKGS_INSTALLER \
+in_ch apt-get install -y -q --no-install-recommends $PKGS_BASE $PKGS_LORDOS $PKGS_FIRMWARE $PKGS_GPU $PKGS_APPS $PKGS_INSTALLER $PKGS_SPLASH \
>> "$WORK/apt.log" 2>&1 || { tail -30 "$WORK/apt.log"; exit 1; }
cp "$DEB" "$CH/tmp/lordos.deb"
in_ch apt-get install -y -q --no-install-recommends /tmp/lordos.deb >> "$WORK/apt.log" 2>&1 || { tail -30 "$WORK/apt.log"; exit 1; }
@@ -142,6 +145,8 @@ in_ch systemctl enable lordos.service > /dev/null
in_ch systemctl enable lord-netperm.service > /dev/null
in_ch systemctl enable lord-fand.service > /dev/null # fans by temperature (docs/FANS.md)
in_ch systemctl mask [email protected] > /dev/null
+# the boot splash: the LordOS theme (the initramfs below is built with it); docs/ISO.md, "Boot splash"
+in_ch plymouth-set-default-theme lordos
# quiet and faster boot
in_ch systemctl mask systemd-networkd-wait-online.service > /dev/null 2>&1 || true
printf 'root:lordos\n' | in_ch chpasswd # emergency console: root / lordos (documented)
@@ -164,31 +169,42 @@ mksquashfs "$CH" "$IMG/live/filesystem.squashfs" -comp xz -Xbcj x86 -b 1M -noapp
# 5. grub (BIOS + UEFI in the same hybrid ISO). GRUB menus are English; the entries with a
# language name pass lordos.lang to lordos-live-prep (English is the default).
+# The LordOS boot menu theme (dark, small crown, the splash's bar as the countdown); "safe mode" boots
+# without the splash (text), the other entries with it.
+install -d "$IMG/boot/grub/themes/lordos"
+install -m 644 tools/iso/grub/lordos/theme.txt tools/iso/grub/lordos/*.png tools/iso/grub/lordos/*.pf2 "$IMG/boot/grub/themes/lordos/"
cat > "$IMG/boot/grub/grub.cfg" <<EOF
set default=0
set timeout=5
insmod all_video
insmod gfxterm
+insmod png
loadfont unicode
+set gfxmode=auto
+set gfxpayload=keep
terminal_output gfxterm
+loadfont /boot/grub/themes/lordos/inter-regular-14.pf2
+loadfont /boot/grub/themes/lordos/inter-regular-16.pf2
+loadfont /boot/grub/themes/lordos/inter-semibold-16.pf2
+set theme=/boot/grub/themes/lordos/theme.txt
menuentry "LordOS $VERSION (live)" {
- linux /live/vmlinuz boot=live components quiet loglevel=3 splash lordos.lang=en
+ linux /live/vmlinuz boot=live components quiet loglevel=3 splash vt.global_cursor_default=0 lordos.lang=en
initrd /live/initrd.img
}
menuentry "LordOS $VERSION (safe mode: no GPU)" {
- linux /live/vmlinuz boot=live components quiet loglevel=3 lordos.gpu=0 lordos.lang=en
+ linux /live/vmlinuz boot=live components quiet loglevel=3 nosplash lordos.gpu=0 lordos.lang=en
initrd /live/initrd.img
}
menuentry "LordOS $VERSION (Español)" {
- linux /live/vmlinuz boot=live components quiet loglevel=3 splash lordos.lang=es
+ linux /live/vmlinuz boot=live components quiet loglevel=3 splash vt.global_cursor_default=0 lordos.lang=es
initrd /live/initrd.img
}
menuentry "LordOS $VERSION (Português)" {
- linux /live/vmlinuz boot=live components quiet loglevel=3 splash lordos.lang=pt
+ linux /live/vmlinuz boot=live components quiet loglevel=3 splash vt.global_cursor_default=0 lordos.lang=pt
initrd /live/initrd.img
}
menuentry "LordOS $VERSION (copy to RAM: the USB drive can be removed)" {
- linux /live/vmlinuz boot=live components quiet loglevel=3 splash toram lordos.lang=en
+ linux /live/vmlinuz boot=live components quiet loglevel=3 splash vt.global_cursor_default=0 toram lordos.lang=en
initrd /live/initrd.img
}
EOF
diff --git a/tools/iso/grub/lordos/background.png b/tools/iso/grub/lordos/background.png
new file mode 100644
index 0000000..0d26020
Binary files /dev/null and b/tools/iso/grub/lordos/background.png differ
diff --git a/tools/iso/grub/lordos/crown.png b/tools/iso/grub/lordos/crown.png
new file mode 100644
index 0000000..256cbb1
Binary files /dev/null and b/tools/iso/grub/lordos/crown.png differ
diff --git a/tools/iso/grub/lordos/inter-regular-14.pf2 b/tools/iso/grub/lordos/inter-regular-14.pf2
new file mode 100644
index 0000000..40564a8
Binary files /dev/null and b/tools/iso/grub/lordos/inter-regular-14.pf2 differ
diff --git a/tools/iso/grub/lordos/inter-regular-16.pf2 b/tools/iso/grub/lordos/inter-regular-16.pf2
new file mode 100644
index 0000000..5b95c84
Binary files /dev/null and b/tools/iso/grub/lordos/inter-regular-16.pf2 differ
diff --git a/tools/iso/grub/lordos/inter-semibold-16.pf2 b/tools/iso/grub/lordos/inter-semibold-16.pf2
new file mode 100644
index 0000000..9f1d710
Binary files /dev/null and b/tools/iso/grub/lordos/inter-semibold-16.pf2 differ
diff --git a/tools/iso/grub/lordos/select_c.png b/tools/iso/grub/lordos/select_c.png
new file mode 100644
index 0000000..0394d8b
Binary files /dev/null and b/tools/iso/grub/lordos/select_c.png differ
diff --git a/tools/iso/grub/lordos/select_e.png b/tools/iso/grub/lordos/select_e.png
new file mode 100644
index 0000000..f51d2f9
Binary files /dev/null and b/tools/iso/grub/lordos/select_e.png differ
diff --git a/tools/iso/grub/lordos/select_n.png b/tools/iso/grub/lordos/select_n.png
new file mode 100644
index 0000000..2c931bf
Binary files /dev/null and b/tools/iso/grub/lordos/select_n.png differ
diff --git a/tools/iso/grub/lordos/select_ne.png b/tools/iso/grub/lordos/select_ne.png
new file mode 100644
index 0000000..a174907
Binary files /dev/null and b/tools/iso/grub/lordos/select_ne.png differ
diff --git a/tools/iso/grub/lordos/select_nw.png b/tools/iso/grub/lordos/select_nw.png
new file mode 100644
index 0000000..680d947
Binary files /dev/null and b/tools/iso/grub/lordos/select_nw.png differ
diff --git a/tools/iso/grub/lordos/select_s.png b/tools/iso/grub/lordos/select_s.png
new file mode 100644
index 0000000..a097575
Binary files /dev/null and b/tools/iso/grub/lordos/select_s.png differ
diff --git a/tools/iso/grub/lordos/select_se.png b/tools/iso/grub/lordos/select_se.png
new file mode 100644
index 0000000..f5a1b87
Binary files /dev/null and b/tools/iso/grub/lordos/select_se.png differ
diff --git a/tools/iso/grub/lordos/select_sw.png b/tools/iso/grub/lordos/select_sw.png
new file mode 100644
index 0000000..7cea35f
Binary files /dev/null and b/tools/iso/grub/lordos/select_sw.png differ
diff --git a/tools/iso/grub/lordos/select_w.png b/tools/iso/grub/lordos/select_w.png
new file mode 100644
index 0000000..683500f
Binary files /dev/null and b/tools/iso/grub/lordos/select_w.png differ
diff --git a/tools/iso/grub/lordos/terminal_box_c.png b/tools/iso/grub/lordos/terminal_box_c.png
new file mode 100644
index 0000000..491bf35
Binary files /dev/null and b/tools/iso/grub/lordos/terminal_box_c.png differ
diff --git a/tools/iso/grub/lordos/theme.txt b/tools/iso/grub/lordos/theme.txt
new file mode 100644
index 0000000..9ef15d5
--- /dev/null
+++ b/tools/iso/grub/lordos/theme.txt
@@ -0,0 +1,65 @@
+# LordOS boot menu theme (GRUB 2). The ISO (tools/iso/build.sh) and the disk installer
+# (GRUB_THEME=/usr/share/grub/themes/lordos/theme.txt) use it. Images: tools/boot/gen-boot-assets.py;
+# fonts: docs/ISO.md, "Boot splash and boot menu". See also docs/brand/README.md.
+title-text: ""
+desktop-image: "background.png"
+desktop-image-scale-method: "stretch"
+desktop-color: "#0B0B1C"
+terminal-font: "Inter Regular 16"
+terminal-left: "10%"
+terminal-top: "10%"
+terminal-width: "80%"
+terminal-height: "80%"
+terminal-box: "terminal_box_*.png"
+
+# the crown, small, above the menu
++ image {
+ left = 50%-48
+ top = 50%-250
+ width = 96
+ height = 96
+ file = "crown.png"
+}
+
++ boot_menu {
+ left = 50%-280
+ top = 50%-110
+ width = 560
+ height = 290
+ item_font = "Inter Regular 16"
+ item_color = "#B9B6D9"
+ selected_item_font = "Inter SemiBold 16"
+ selected_item_color = "#FFFFFF"
+ item_height = 34
+ item_padding = 16
+ item_spacing = 18
+ item_icon_space = 0
+ icon_width = 0
+ icon_height = 0
+ selected_item_pixmap_style = "select_*.png"
+ scrollbar = false
+}
+
+# the countdown: a thin bar in the splash colours (GRUB draws it square)
++ progress_bar {
+ id = "__timeout__"
+ left = 50%-100
+ top = 50%+210
+ width = 200
+ height = 6
+ show_text = false
+ bg_color = "#24243A"
+ fg_color = "#8B5CFF"
+ border_color = "#24243A"
+}
+
++ label {
+ left = 0
+ top = 100%-56
+ width = 100%
+ height = 20
+ align = "center"
+ font = "Inter Regular 14"
+ color = "#6F6C93"
+ text = "Enter: boot E: edit C: command line"
+}
diff --git a/tools/iso/mkdeb.sh b/tools/iso/mkdeb.sh
index 59ec663..7fe2acb 100755
--- a/tools/iso/mkdeb.sh
+++ b/tools/iso/mkdeb.sh
@@ -2,7 +2,7 @@
# mkdeb.sh — builds lordos_<version>_amd64.deb from the already compiled tree.
# Usage: tools/iso/mkdeb.sh <output.deb> (from the repository root; needs dpkg-deb)
#
-# Contenido:
+# Contents:
# /usr/lib/lordos/bin/lord-sessiond sessions, login screen and remote desktop (root)
# /usr/lib/lordos/bin/lord-netperm per-app network permissions with cgroup BPF (root, own service)
# /usr/lib/lordos/bin/lord-netd system networking (root; launched and watched by lord-sessiond)
@@ -13,6 +13,10 @@
# /usr/lib/lordos/assets/ fonts, texts (locales), icons, shell integration
# /usr/lib/lordos/lordos-live-prep live preparation (grub language, folders)
# /usr/lib/systemd/system/lordos.service lord-sessiond on tty1
+# /usr/lib/lordos/lordos-splash boot splash hand-off (Plymouth → LordOS, docs/SESSIONS.md)
+# /usr/share/plymouth/themes/lordos/ the boot splash theme (selected by the ISO, the Raspberry Pi
+# image or install.sh; the package never selects it)
+# /usr/share/grub/themes/lordos/ the boot menu theme (amd64; the ISO and the disk installer)
# /usr/share/doc/lordos/ README, copyright, changelog
set -eu
OUT=${1:?uso: mkdeb.sh salida.deb}
@@ -68,6 +72,19 @@ install -m 644 assets/app-host.bundle.js "$L/assets/app-host.bundle.js"
install -m 755 tools/iso/rootfs/usr/lib/lordos/lordos-live-prep "$L/lordos-live-prep"
install -D -m 644 tools/iso/rootfs/etc/wireplumber/wireplumber.conf.d/lordos-bluez.conf "$PKG/etc/wireplumber/wireplumber.conf.d/lordos-bluez.conf"
install -m 644 tools/iso/rootfs/etc/systemd/system/lordos.service "$PKG/usr/lib/systemd/system/lordos.service"
+# boot splash (docs/brand/README.md, "Boot splash"): the Plymouth theme and the hand-off to LordOS
+install -m 755 tools/boot/lordos-splash "$L/lordos-splash"
+install -m 644 tools/boot/systemd/lordos-splash-quit.service "$PKG/usr/lib/systemd/system/lordos-splash-quit.service"
+install -D -m 644 tools/boot/systemd/plymouth-quit.service.d/lordos.conf "$PKG/usr/lib/systemd/system/plymouth-quit.service.d/lordos.conf"
+install -d "$PKG/usr/share/plymouth/themes/lordos"
+install -m 644 tools/boot/plymouth/lordos/lordos.plymouth tools/boot/plymouth/lordos/lordos.script \
+ tools/boot/plymouth/lordos/*.png "$PKG/usr/share/plymouth/themes/lordos/"
+# boot menu theme (GRUB: x86-64 only; the Raspberry Pi boots without GRUB)
+if [ "${DEB_ARCH:-$(dpkg --print-architecture)}" = amd64 ]; then
+ install -d "$PKG/usr/share/grub/themes/lordos"
+ install -m 644 tools/iso/grub/lordos/theme.txt tools/iso/grub/lordos/*.png tools/iso/grub/lordos/*.pf2 \
+ "$PKG/usr/share/grub/themes/lordos/"
+fi
# LordOS GTK3 themes (the settings portal picks them by light/dark)
install -d "$PKG/usr/share/themes"
cp -r assets/gtk/LordOS assets/gtk/LordOS-dark "$PKG/usr/share/themes/"
@@ -169,6 +186,12 @@ if [ "$1" = configure ] && command -v systemctl >/dev/null 2>&1; then
systemctl enable lord-fand.service >/dev/null 2>&1 || true
if [ -d /run/systemd/system ]; then systemctl restart lord-fand.service >/dev/null 2>&1 || true; fi
fi
+# the boot splash lives in the initramfs: when it is the selected theme, rebuild it with the new images
+# (initramfs-tools' trigger; the theme is selected by the ISO, the Pi image or install.sh, never here)
+if [ "$1" = configure ] && [ -x /usr/sbin/plymouth-set-default-theme ] &&
+ [ "$(/usr/sbin/plymouth-set-default-theme 2>/dev/null)" = lordos ] && command -v update-initramfs >/dev/null 2>&1; then
+ dpkg-trigger --no-await update-initramfs 2>/dev/null || true
+fi
C
chmod 755 "$PKG/DEBIAN/postinst"
# removing the package gives the fans back first (ExecStopPost restores the kernel's control)
@@ -179,6 +202,12 @@ if [ "$1" = remove ] && command -v systemctl >/dev/null 2>&1; then
if [ -d /run/systemd/system ]; then systemctl stop lord-fand.service >/dev/null 2>&1 || true; fi
systemctl disable lord-fand.service >/dev/null 2>&1 || true
fi
+# the boot splash theme goes away with the package: Plymouth back to its default theme first
+if [ "$1" = remove ] && [ -x /usr/sbin/plymouth-set-default-theme ] &&
+ [ "$(/usr/sbin/plymouth-set-default-theme 2>/dev/null)" = lordos ]; then
+ /usr/sbin/plymouth-set-default-theme --reset >/dev/null 2>&1 || true
+ command -v update-initramfs >/dev/null 2>&1 && { dpkg-trigger --no-await update-initramfs 2>/dev/null || true; }
+fi
C
chmod 755 "$PKG/DEBIAN/prerm"
# files under /etc are conffiles (lintian: file-in-etc-not-marked-as-conffile)
diff --git a/tools/iso/rootfs/etc/systemd/system/lordos.service b/tools/iso/rootfs/etc/systemd/system/lordos.service
index 06ec90f..1820366 100644
--- a/tools/iso/rootfs/etc/systemd/system/lordos.service
+++ b/tools/iso/rootfs/etc/systemd/system/lordos.service
@@ -1,8 +1,11 @@
[Unit]
Description=LordOS (lord-sessiond: login screen, sessions and remote desktop)
Documentation=file:///usr/share/doc/lordos/README.md
-After=systemd-user-sessions.service systemd-logind.service systemd-udev-settle.service
+After=systemd-user-sessions.service systemd-logind.service systemd-udev-settle.service plymouth-start.service
Wants=systemd-udev-settle.service
+# boot splash: ended (keeping our first frame) once LordOS is on the screen; see docs/SESSIONS.md,
+# "Boot splash". No Conflicts= with plymouth-quit.service: that one is ordered after it instead.
+Wants=lordos-splash-quit.service
@@ -10,11 +13,16 @@ [email protected]
Type=simple
# live only: grub language (lordos.lang) and the lordos user's folders
ExecStartPre=-/usr/lib/lordos/lordos-live-prep
+# the last step before lord-sessiond: Plymouth drops DRM master and leaves its last frame up
+ExecStartPre=-/usr/lib/lordos/lordos-splash deactivate
ExecStart=/usr/lib/lordos/bin/lord-sessiond
# SIGHUP: rereads /etc/lordos/remote/config (Settings → Sharing)
ExecReload=/bin/kill -HUP $MAINPID
TTYPath=/dev/tty1
-TTYReset=yes
+# no TTYReset: it switches tty1 back to text mode before every Exec* line, and between Plymouth
+# dropping DRM master and lord-sessiond taking it the console would flash on top of the splash
+# (lord-sessiond sets graphics mode itself and restores text mode when it stops)
+TTYReset=no
TTYVHangup=yes
StandardInput=null
StandardOutput=journal
diff --git a/tools/rpi/build-img.sh b/tools/rpi/build-img.sh
index 7cc52ff..66b9a8d 100755
--- a/tools/rpi/build-img.sh
+++ b/tools/rpi/build-img.sh
@@ -84,6 +84,9 @@ PKGS_GPU="libgl1-mesa-dri libegl1 libgles2 libgbm1 mesa-vulkan-drivers mesa-util
PKGS_APPS="foot featherpad qt6-wayland"
# the SSH server ships off; the `ssh` switch file on the boot partition (rpi/firstboot) or RPI_SSH=1 turns it on
PKGS_SSH="openssh-server"
+# the boot splash (the LordOS Plymouth theme comes in the lordos package; plymouth-label draws the
+# password prompt's text for encrypted disks). See docs/RASPBERRY.md, "Boot splash".
+PKGS_SPLASH="plymouth plymouth-label"
# to build lord-server (only in the build chroot, not in the image)
PKGS_BUILD="build-essential pkg-config libxkbcommon-dev libwayland-dev wayland-protocols libgbm-dev libegl-dev libgles-dev
libssl-dev libcrypt-dev dpkg-dev file"
@@ -226,7 +229,7 @@ mount_ch "$CH"
echo "== paquetes"
in_root "$CH" apt-get update -q > "$WORK/apt.log" 2>&1 || { tail -30 "$WORK/apt.log"; exit 1; }
# shellcheck disable=SC2086
-in_root "$CH" apt-get install -y -q --no-install-recommends $PKGS_BASE $PKGS_LORDOS $PKGS_RPI $ARCHIVE_K $PKGS_GPU $PKGS_APPS $PKGS_SSH \
+in_root "$CH" apt-get install -y -q --no-install-recommends $PKGS_BASE $PKGS_LORDOS $PKGS_RPI $ARCHIVE_K $PKGS_GPU $PKGS_APPS $PKGS_SSH $PKGS_SPLASH \
>> "$WORK/apt.log" 2>&1 || { tail -30 "$WORK/apt.log"; exit 1; }
# the LordOS kernels (same hooks as Raspberry Pi's: initramfs, raspi-firmware copies kernel_2712.img,
# device trees and overlays), and an apt pin so the archive kernel of that flavour never replaces them
@@ -308,7 +311,22 @@ for kv in $KV2712 $KV8; do
if grep -q '^CONFIG_SECURITY_LANDLOCK=y' "$CH/boot/config-$kv" 2>/dev/null; then echo " kernel $kv: Landlock built in"
else echo " WARNING: kernel $kv has NO Landlock (seccomp-only isolation on that board)" >&2; fi
done
-in_root "$CH" update-initramfs -u -k all > /dev/null 2>&1 || true
+# boot splash: the LordOS theme, and vc4 (HDMI) with DRM in the initramfs so Plymouth draws from the
+# first seconds instead of waiting for the root file system. Plymouth's own hook adds the rest of
+# kernel/drivers/gpu/drm (MODULES=most), its plugins, the theme and a font for the password prompt.
+in_root "$CH" plymouth-set-default-theme lordos
+install -d "$CH/etc/initramfs-tools/conf.d"
+grep -qx vc4 "$CH/etc/initramfs-tools/modules" 2>/dev/null || {
+ echo "# LordOS: the display driver early, for the boot splash (docs/RASPBERRY.md, \"Boot splash\")"
+ echo vc4
+} >> "$CH/etc/initramfs-tools/modules"
+printf '# LordOS: the boot splash needs the DRM drivers in the initramfs (docs/RASPBERRY.md)\nMODULES=most\n' \
+ > "$CH/etc/initramfs-tools/conf.d/lordos-splash.conf"
+in_root "$CH" update-initramfs -u -k all > "$WORK/initramfs.log" 2>&1 || { tail -20 "$WORK/initramfs.log"; exit 1; }
+for kv in $KV2712 $KV8; do
+ in_root "$CH" lsinitramfs "/boot/initrd.img-$kv" 2>/dev/null | grep -q 'plymouth/themes/lordos/lordos.script' ||
+ { echo "build-img.sh: the initramfs of $kv has no LordOS splash (see $WORK/initramfs.log)" >&2; exit 1; }
+done
place_kernel() { # version, kernel name on the FAT, initramfs name
[ -n "$1" ] || return 0
[ -f "$CH/boot/firmware/$2" ] || cp "$CH/boot/vmlinuz-$1" "$CH/boot/firmware/$2"
@@ -368,9 +386,12 @@ PARTUUID=$PARTUUID_ROOT / ext4 defaults,noatime 0 1
PARTUUID=$PARTUUID_BOOT /boot/firmware vfat defaults,umask=0077 0 2
EOF
# lordos.gpu=0 (safe mode, everything on the CPU) and lordos.lang=en|pt can be added here, as on the ISO.
+# The boot splash: quiet splash (Plymouth), no serial console for it, no kernel logo or blinking cursor;
+# the console is tty1, where Plymouth draws and where Esc shows the boot messages. Removing "splash"
+# boots in text as before (docs/RASPBERRY.md, "Boot splash").
# lsm=: the same list as the LordOS kernel's CONFIG_LSM (Landlock for app isolation, server/src/sec);
# those the kernel lacks are ignored, so the active list is "capability,landlock".
-printf 'console=serial0,115200 console=tty3 root=PARTUUID=%s rootfstype=ext4 fsck.repair=yes rootwait quiet loglevel=3 cgroup_enable=memory lsm=landlock,lockdown,yama,integrity,bpf lordos.lang=en\n' \
+printf 'console=serial0,115200 console=tty1 root=PARTUUID=%s rootfstype=ext4 fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles logo.nologo vt.global_cursor_default=0 loglevel=3 cgroup_enable=memory lsm=landlock,lockdown,yama,integrity,bpf lordos.lang=en\n' \
"$PARTUUID_ROOT" > "$WORK/mnt/boot/firmware/cmdline.txt"
sync
umount "$WORK/mnt/boot/firmware"
diff --git a/tools/rpi/rootfs/boot/firmware/config.txt b/tools/rpi/rootfs/boot/firmware/config.txt
index 0effd95..59ac4e4 100644
--- a/tools/rpi/rootfs/boot/firmware/config.txt
+++ b/tools/rpi/rootfs/boot/firmware/config.txt
@@ -3,6 +3,8 @@
[all]
arm_64bit=1
+# no rainbow square at power-on: the LordOS boot splash (Plymouth) is the first thing on the screen
+disable_splash=1
# initramfs with the same name as the kernel (kernel_2712.img → initramfs_2712, kernel8.img → initramfs8)
auto_initramfs=1
# Full KMS: vc4 drives HDMI (the display) and v3d the 3D GPU. lord-server uses KMS without libdrm.
diff --git a/tools/rpi/rootfs/etc/systemd/system/lordos.service.d/rpi.conf b/tools/rpi/rootfs/etc/systemd/system/lordos.service.d/rpi.conf
index 132715e..daa152d 100644
--- a/tools/rpi/rootfs/etc/systemd/system/lordos.service.d/rpi.conf
+++ b/tools/rpi/rootfs/etc/systemd/system/lordos.service.d/rpi.conf
@@ -6,4 +6,9 @@ After=lordos-rpi-firstboot.service
Wants=lordos-rpi-firstboot.service
[Service]
+# the list is reset so the boot splash hand-off (lordos-splash deactivate) stays the last step,
+# after vc4 is there
+ExecStartPre=
+ExecStartPre=-/usr/lib/lordos/lordos-live-prep
ExecStartPre=-/usr/lib/lordos/rpi/wait-kms
+ExecStartPre=-/usr/lib/lordos/lordos-splash deactivate