sector-f-linux

Sector F Linux
git clone https://git.sectorflabs.com/sector-f-linux.git
Log | Files | Refs | README | LICENSE

commit 90829d47ce88d503e960a8ca0b9c7b51919ab885
parent 7dc2e1401b0e6f7288e742d73316bbe1183b4e46
Author: Divan Visagie <me@divanv.com>
Date:   Sat, 21 Nov 2026 01:23:23 +0100

image: a boot and shutdown splash, an animated Sector F flask on Everforest, and no text while starting and stopping

Plymouth with a theme of our own (linux/branding/plymouth-theme.py, built in a plymouth-theme stage so Pillow and rsvg-convert stay out of the image): the logo's flask drawn frame by frame with the liquid rising and falling, bubbles and the pipe's two circles pulsing, 128 px tall in the middle of Everforest's background, and the words Sector F Labs at the bottom. The initramfs is rebuilt with the plymouth dracut module so the splash is up from the start, kargs.d/20-splash.toml adds quiet splash loglevel=3, and greetd's command goes through systemd-cat so cage's output reaches the journal and not the screen.

The test rig kept console=ttyS0 last, which makes Plymouth treat the serial port as a screen and fall back to its plain view at once: vm/disk.sh now puts console=tty0 last. make build QUICK=1 skips the desktop and greeter builds for changes to the image only.

Seen in the test VM on boot and on shutdown. Not checked on real hardware. Recorded in ADR-0012.

Diffstat:
MMakefile | 2+-
Mdocs/adr/0012-a-login-manager-of-our-own-greetd-and-a-patina-greeter.md | 19+++++++++++++++++++
Mlinux/.dockerignore | 1+
Mlinux/Containerfile | 23++++++++++++++++++++++-
Alinux/branding/plymouth-theme.py | 103+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mlinux/system/etc/greetd/config.toml | 4+++-
Alinux/system/usr/lib/bootc/kargs.d/20-splash.toml | 4++++
Mlinux/vm/build.sh | 11++++++++---
Mlinux/vm/disk.sh | 6++++--
9 files changed, 165 insertions(+), 8 deletions(-)

diff --git a/Makefile b/Makefile @@ -11,7 +11,7 @@ help: ## List the targets @grep -E '^[a-zA-Z_-]+:.*## ' $(MAKEFILE_LIST) | \ awk 'BEGIN{FS=":.*## "} {printf " %-12s %s\n", $$1, $$2}' -build: ## Build the desktop and the image, and push it to the local registry +build: ## Build the desktop, greeter and image, and push it to the registry (QUICK=1 skips the first two) linux/vm/build.sh publish: ## Build the real image (not the VM's dev one) and push it to registry.example.com (tailnet only) diff --git a/docs/adr/0012-a-login-manager-of-our-own-greetd-and-a-patina-greeter.md b/docs/adr/0012-a-login-manager-of-our-own-greetd-and-a-patina-greeter.md @@ -153,6 +153,25 @@ greeter shows the setup, and a new account made there is logged straight in. The the boot log are `bootupctl`'s, from the base. Not checked: Restart and Shut down, a screen reader, and the text console fallback by hand. +## The boot and shutdown splash (2026-11-21) + +No text on the screen while starting or stopping: Plymouth, with a theme of our own (`sectorf`) of an +animated flask (the logo's own drawing: the liquid rises and falls, bubbles, the pipe's two circles +pulse) in the middle of Everforest's background, and the words Sector F Labs at the bottom. +`linux/branding/plymouth-theme.py` draws the frames (a `plymouth-theme` stage of the Containerfile, so +Pillow and rsvg-convert stay out of the image); the initramfs is rebuilt with the plymouth dracut +module so the splash is up from the start; `kargs.d/20-splash.toml` adds `quiet splash loglevel=3`; +greetd's command runs through `systemd-cat`, so cage's output goes to the journal and not to the +screen. Plymouth shows only for the graphical boot: a text or rescue boot, or `plymouth.enable=0`, +shows the messages as before. + +Seen in the test VM, on boot and on shutdown. Found on the way: the test rig's serial console +(`console=ttyS0`) makes Plymouth treat the serial port as a screen and show its plain detail view at +once, so the rig keeps `console=tty0` last and the serial console is gone from the VM's arguments +(`rpm-ostree kargs --delete=console=ttyS0,115200`; new disks get the order from `vm/disk.sh`). +`make log` shows nothing on a machine booted without it. Not checked: real hardware (several +GPUs, the encrypted-disk password prompt, which uses Fedora's pictures). + ## Consequences - The login screen and the setup are one thing, in Patina's own look, and a factory reset diff --git a/linux/.dockerignore b/linux/.dockerignore @@ -5,3 +5,4 @@ !system/ !build/desktop/ !build/greeter/ +!branding/plymouth-theme.py diff --git a/linux/Containerfile b/linux/Containerfile @@ -14,6 +14,15 @@ # 2026-11-20; update it to take a new base. FROM quay.io/fedora/fedora-bootc@sha256:813fd13fb01363e76310c5e764ddcba8e275a0259255f49b5717a9925e74b177 AS base +# The boot and shutdown splash (Plymouth): Fedora's spinner theme, tinted in the greeter's +# Everforest colours, with the logo. Built here so Pillow and rsvg-convert stay out of the image. +FROM base AS plymouth-theme +RUN dnf -y --setopt=install_weak_deps=False install plymouth-theme-spinner python3-pillow librsvg2-tools && \ + dnf clean all +COPY branding/plymouth-theme.py /plymouth-theme.py +COPY system/usr/share/pixmaps/seflos-logo.svg /logo.svg +RUN python3 /plymouth-theme.py /usr/share/plymouth/themes/spinner /logo.svg /sectorf + FROM base AS system # What the desktop needs: greetd and cage to log in (the greeter itself is ours, below), @@ -38,7 +47,7 @@ FROM base AS system # Not here yet: the NVIDIA driver, which comes from RPM Fusion or NVIDIA's own # repository and is built against the image's kernel at build time. RUN dnf -y --setopt=install_weak_deps=False install \ - greetd cage accountsservice dconf polkit NetworkManager \ + plymouth plymouth-plugin-two-step greetd cage accountsservice dconf polkit NetworkManager \ pipewire pipewire-pulseaudio wireplumber \ mesa-dri-drivers mesa-vulkan-drivers mesa-libEGL mesa-libgbm vulkan-loader \ libinput libseat libxkbcommon xkeyboard-config pixman libdrm \ @@ -76,6 +85,18 @@ COPY build/greeter/ / # carries Fedora's os-release, whose DEFAULT_HOSTNAME ("fedora") wins otherwise. COPY system/ / +# The splash: the theme, set as the default, and an initramfs that carries Plymouth and the theme, so +# the splash is up from the first moment and not only after the root is mounted. The initramfs is +# rebuilt as the bootc docs do (generic, reproducible), keeping the base's own dracut config. The +# kernel arguments that hide the boot messages and ask for the splash are in +# system/usr/lib/bootc/kargs.d/20-splash.toml. Plymouth shows it for the graphical boot only: a +# rescue or text boot, or `plymouth.enable=0` on the command line, shows the messages as before. +COPY --from=plymouth-theme /sectorf /usr/share/plymouth/themes/sectorf +RUN printf '[Daemon]\nTheme=sectorf\nShowDelay=0\n' > /etc/plymouth/plymouthd.conf && \ + kver=$(ls /usr/lib/modules) && \ + DRACUT_NO_XATTR=1 dracut --no-hostonly --kver "$kver" --reproducible --zstd --add plymouth \ + -f "/usr/lib/modules/$kver/initramfs.img" + RUN systemctl enable greetd.service NetworkManager.service \ bluetooth.service power-profiles-daemon.service thermald.service \ cups.socket cups.service cups-browsed.service avahi-daemon.service \ diff --git a/linux/branding/plymouth-theme.py b/linux/branding/plymouth-theme.py @@ -0,0 +1,103 @@ +#!/usr/bin/env python3 +"""Makes the boot and shutdown splash: an animated Sector F flask (the logo's own drawing, with the +liquid rising and falling, bubbles, and the two circles at the end of its pipe pulsing) in the middle +of Everforest's background, and the words Sector F Labs at the bottom. Plymouth's two-step plugin +plays the frames in a loop. Run in the Containerfile's plymouth-theme stage, which has librsvg2-tools +and Pillow; the result is /usr/share/plymouth/themes/sectorf/, built on Fedora's spinner theme (for +its password-prompt pictures). + + plymouth-theme.py <spinner theme dir> <logo.svg> <output dir> +""" +import math +import re +import subprocess +import sys +from pathlib import Path + +from PIL import Image + +BACKGROUND = 0x2D353B # Everforest Dark's bg0, as the greeter's +LIQUID = "#A7C080" # its accent +GLASS = "#D3C6AA" # its text +FRAMES = 60 # one loop +HEIGHT = 128 # px: the flask, bigger than the greeter's 64 px avatars +WORD_WIDTH = 300 # px: Sector F Labs + +src, logo, out = (Path(a) for a in sys.argv[1:4]) +out.mkdir(parents=True, exist_ok=True) + +# The flask is drawn in the logo's own coordinates (see seflos-logo.svg: a 1024-ish grid, the pipe and +# its two circles above the stopper at y 352..392, the neck at x 388..632, the round bottom to y 905). +OUTER = ("M388,385 V515 L252,697 Q222,738 222,785 Q230,900 510,905 Q790,900 798,785 " + "Q798,738 768,697 L632,515 V385 Z") +# What the glass encloses, a wall's thickness (40) inside the outer outline. +INNER = ("M428,385 V528 L287,720 Q262,758 262,790 Q270,865 510,865 Q750,865 758,790 " + "Q758,758 733,720 L592,528 V385 Z") + + +def frame_svg(i: int) -> str: + t = i / FRAMES + phase = 2 * math.pi * t + # The liquid's surface sits between the neck's bottom and the belly, and sways. + level = 700 - 95 * math.sin(phase) + wave = [] + for x in range(200, 821, 20): + y = level + 9 * math.sin(phase * 2 + x / 55) + wave.append(f"{x},{y:.1f}") + liquid = "M200,1000 L200," + wave[0].split(",")[1] + " L" + " L".join(wave) + " L820,1000 Z" + # Bubbles rise through the liquid, each on its own loop, fading at the top. + bubbles = [] + for k, (x, speed, r) in enumerate([(420, 1, 17), (520, 2, 12), (600, 1, 20), (470, 3, 9)]): + u = (t * speed + k * 0.23) % 1.0 + y = 870 - u * (870 - level) + if y > level + 12: + bubbles.append(f'<circle cx="{x + 12 * math.sin(u * 9 + k)}" cy="{y:.1f}" r="{r}" ' + f'fill="none" stroke="#2D353B" stroke-opacity=".55" stroke-width="7"/>') + # The pipe's circles pulse, one after the other. + r1 = 40 + 3 * math.sin(phase) + r2 = 40 + 3 * math.sin(phase + math.pi) + return f'''<svg xmlns="http://www.w3.org/2000/svg" width="{HEIGHT * 700 // 835}" height="{HEIGHT}" viewBox="150 105 700 835"> + <defs><clipPath id="belly"><path d="{INNER}"/></clipPath></defs> + <g fill="none" stroke="{GLASS}" stroke-linejoin="round" stroke-linecap="round"> + <path d="M181,297 H664 M285,297 L398,172 H548" stroke-width="32"/> + <circle cx="591" cy="178" r="{r1:.1f}" stroke-width="37"/> + <circle cx="710" cy="293" r="{r2:.1f}" stroke-width="37"/> + </g> + <g clip-path="url(#belly)"><path d="{liquid}" fill="{LIQUID}"/>{"".join(bubbles)}</g> + <path fill="{GLASS}" fill-rule="evenodd" d="{OUTER} {INNER}"/> + <rect x="350" y="352" width="318" height="40" rx="20" fill="{GLASS}"/> +</svg>''' + + +def render(svg: str, path: Path, *args: str) -> None: + subprocess.run(["rsvg-convert", *args, "-o", str(path), "/dev/stdin"], input=svg.encode(), check=True) + + +for i in range(FRAMES): + svg = frame_svg(i) + # The same frames under both names: which one two-step plays depends on the theme's settings. + render(svg, out / f"throbber-{i + 1:04d}.png") + (out / f"animation-{i + 1:04d}.png").write_bytes((out / f"throbber-{i + 1:04d}.png").read_bytes()) + +# The words, alone, from the logo's own lettering (its path after the flask), dimmed. +text = re.search(r'(<path fill="#ffffff" transform=.*?/>)', logo.read_text(), re.S).group(1) +word = (f'<svg xmlns="http://www.w3.org/2000/svg" viewBox="985 330 3230 360">' + f'<g opacity=".6">{text.replace("#ffffff", GLASS)}</g></svg>') +render(word, out / "watermark.png", "-w", str(WORD_WIDTH)) + +# The password prompt's pictures (for an encrypted disk), from Fedora's theme. +for png in src.glob("*.png"): + # Not its watermark.png, which is Fedora's logo and would replace ours. + if not png.name.startswith(("animation-", "throbber-")) and png.name != "watermark.png": + Image.open(png).save(out / png.name) + +theme = (src / "spinner.plymouth").read_text() +theme = re.sub(r"^Name.*\n", "", theme, flags=re.M) +theme = theme.replace("[Plymouth Theme]\n", "[Plymouth Theme]\nName=Sector F Linux\n", 1) +theme = theme.replace("ImageDir=/usr/share/plymouth/themes//spinner", "ImageDir=/usr/share/plymouth/themes/sectorf") +theme = re.sub(r"^BackgroundStartColor=.*", f"BackgroundStartColor=0x{BACKGROUND:06X}", theme, flags=re.M) +theme = re.sub(r"^BackgroundEndColor=.*", f"BackgroundEndColor=0x{BACKGROUND:06X}", theme, flags=re.M) +# The flask in the middle of the screen, the words at the bottom. +theme = re.sub(r"^VerticalAlignment=.*", "VerticalAlignment=.5", theme, flags=re.M) +(out / "sectorf.plymouth").write_text(theme) +print(f"{out}: {len(list(out.iterdir()))} files") diff --git a/linux/system/etc/greetd/config.toml b/linux/system/etc/greetd/config.toml @@ -2,11 +2,13 @@ # cage, a kiosk compositor, as the unprivileged greetd user. It talks to greetd over $GREETD_SOCK, # and greetd starts the person's session, patina-session, once the password is right. # +# systemd-cat sends cage's and the greeter's output to the journal, not onto the screen behind the splash. +# # If the greeter is broken, greetd gives up after a few restarts: a text login is still on the # other consoles (Ctrl+Alt+F2). [terminal] vt = 1 [default_session] -command = "cage -s -- /usr/libexec/patina-greeter" +command = "systemd-cat -t patina-greeter cage -s -- /usr/libexec/patina-greeter" user = "greetd" diff --git a/linux/system/usr/lib/bootc/kargs.d/20-splash.toml b/linux/system/usr/lib/bootc/kargs.d/20-splash.toml @@ -0,0 +1,4 @@ +# Boot quietly behind the Plymouth splash (ADR-0014): no kernel or service messages on the screen, +# and no blinking cursor. The messages are still in the journal; remove "quiet" and "splash" from +# the kernel command line at the boot menu to see them. +kargs = ["quiet", "splash", "loglevel=3", "vt.global_cursor_default=0"] diff --git a/linux/vm/build.sh b/linux/vm/build.sh @@ -1,12 +1,17 @@ #!/usr/bin/env bash # Builds the Patina desktop (desktop/build.sh), then the image's dev stage from the Containerfile, # and pushes it to the registry (registry.example.com, tailnet only), where the VM's -# `rpm-ostree upgrade` finds it. The dev stage has a login: it goes to sectorf-linux-dev, never to +# `rpm-ostree upgrade` finds it. QUICK=1 skips the desktop and greeter builds, for changes to the +# image only (the Containerfile, linux/system, branding): `make build QUICK=1`. The dev stage has a login: it goes to sectorf-linux-dev, never to # the published sectorf-linux (linux/publish.sh). source "$(dirname "$0")/common.sh" -"$ROOT/desktop/build.sh" -"$ROOT/greeter-build.sh" +if [[ -z "${QUICK:-}" ]]; then + "$ROOT/desktop/build.sh" + "$ROOT/greeter-build.sh" +else + echo "==> QUICK: not rebuilding the desktop and the greeter (build/ as it is)" +fi build_id=$(date -u +%Y-%m-%dT%H:%M:%SZ) say "building $IMAGE ($build_id)" docker build -f "$ROOT/Containerfile" --target dev \ diff --git a/linux/vm/disk.sh b/linux/vm/disk.sh @@ -22,6 +22,8 @@ mkdir -p "$OUT/containers" docker run --rm --privileged --network host \ -v /dev:/dev -v "$OUT:/data" -v "$OUT/containers:/var/lib/containers" \ "$IMAGE" bash -euc ' + # The console order: tty0 last, since Plymouth shows its splash on the last console and treats + # a serial one as no screen. mkdir -p /var/tmp # /var in the image is empty until it boots podman pull -q "$1" >/dev/null bootc install to-disk \ @@ -31,8 +33,8 @@ docker run --rm --privileged --network host \ --root-ssh-authorized-keys /data/id_ed25519.pub \ --source-imgref "containers-storage:$1" \ --target-imgref "$2" \ - --karg console=tty0 \ - --karg console=ttyS0,115200 + --karg console=ttyS0,115200 \ + --karg console=tty0 ' install "$IMAGE" "$VM_IMAGE" [[ -f "$DATA" ]] || qemu-img create -q -f qcow2 "$DATA" "$DATA_SIZE"