sector-f-linux

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

0009-seflos-a-fedora-bootc-image-on-btrfs.md (7235B)


      1 # 0009. Sector F Linux: a Fedora bootc image on Btrfs
      2 
      3 Date: 2026-11-20
      4 
      5 ## Status
      6 
      7 Accepted. The user chose Fedora and Btrfs after the Ubuntu bootc image's upgrades kept failing.
      8 Supersedes [ADR-0006](0006-updates-are-zfs-streams-of-boot-environments.md) (bootc ruled out),
      9 [ADR-0007](0007-ubuntu-without-snaps-on-a-zfs-root.md) (Ubuntu on a ZFS root, updated with apt),
     10 [ADR-0008](0008-install-by-receiving-the-system-as-a-zfs-stream.md) (install by receiving a ZFS
     11 stream) and what [ADR-0001](0001-bootc-image-with-zfs-for-data.md) chose for the base (Ubuntu) and
     12 for the data (ZFS). The OS is renamed from Patina OS to Sector F Linux; the Patina desktop keeps its name.
     13 
     14 ## Context
     15 
     16 ADR-0007 gave up on bootc because Ubuntu's bootc support is young and community-held, and settled on
     17 plain Ubuntu on a ZFS root. The wish for a system that is built once, shipped whole and rolled back
     18 stayed, and the Ubuntu bootc image kept costing more than the base offered. On 2026-11-20, trying to
     19 update the Ubuntu bootc VM:
     20 
     21 - `bootc upgrade` and a switch from podman's own storage both failed with `Invalid splitstream
     22   content type` once a large layer had changed (the bug ADR-0006 recorded as open). A search found
     23   composefs-rs issue 452, which blames "the wrong podman image format", and bootc issue 1703
     24   (composefs and Docker v2s2 images), both open. I did not find a fix.
     25 - Installing with the older ostree backend instead failed outright: `Creating ostree deployment:
     26   No such file or directory`. The Ubuntu base is made for the composefs backend only.
     27 
     28 ADR-0006 ruled out Fedora because its kernels outrun OpenZFS, and ZFS cannot be a bootc root (the
     29 composefs backend wants fs-verity, which ZFS lacks). Both objections go away without ZFS: Btrfs is in
     30 the mainline kernel, so a new Fedora kernel needs nothing to catch up, and it supports fs-verity.
     31 
     32 "Patina OS" is also the name of an existing distribution (Debian 13 with KDE Plasma, GPL-3.0, by the
     33 `patina-os` GitHub organisation), so the name had to change.
     34 
     35 ## Decision
     36 
     37 - **The base is `quay.io/fedora/fedora-bootc:45`**, pinned by digest, which brings its own bootc and
     38   kernel. None of the Ubuntu workarounds (bootc built from source, a newer kernel, dpkg's state)
     39   remain.
     40 - **The system is installed onto Btrfs**: `bootc install to-disk --filesystem btrfs`. `/home` is on
     41   the same filesystem for now; its own subvolume, snapshots (snapper or btrbk) and zstd compression
     42   for `~/Src` come later. ZFS is dropped, and so is its pool for `/home`.
     43 - **The desktop is patina-desktop's own bundle**: `desktop/build.sh` runs that repository's
     44   `packaging/deb/build.py --stage` in a Fedora 45 container (rustup's Rust, pinned) and copies the
     45   tree into the image. The libraries and programs it needs come from dnf.
     46 - **The base carries what nifl runs**: Bluetooth, power profiles, bolt, fwupd, thermald, CUPS,
     47   fprintd, Tailscale, OpenVPN, Avahi, ModemManager, QEMU and fastfetch, with the Yaru icons, and
     48   `nvme.noacpi=1` as a kernel argument. Its drivers are all in the kernel.
     49 - **Updates are `rpm-ostree upgrade`, not `bootc upgrade`.** A user can layer packages with
     50   `rpm-ostree install`; bootc then refuses to upgrade (`Deployment contains local rpm-ostree
     51   modifications`), and rpm-ostree upgrades the image underneath and keeps the layer. Tested in the
     52   VM: `nvtop` layered, `htop` added by the new image, both present after the reboot, and the old
     53   deployment kept for rollback.
     54 - **Images are pushed with OCI layers.** Docker's image store pushes an OCI manifest whose own
     55   layers carry Docker's media type, which bootc rejects (`Unhandled layer type`), and skopeo
     56   will not convert that mixed manifest from a registry. `vm/build.sh` pushes the image again from
     57   Docker's daemon with `skopeo copy --format oci`.
     58 - **`boot.automount` is masked.** systemd-gpt-auto-generator puts an automount for the EFI
     59   partition on `/boot`, with a two minute idle timeout, in front of ostree's bind mount. Once it
     60   idles out, `ostree admin finalize-staged` fails at shutdown (`Remounting /boot read-write:
     61   Invalid argument`) and the staged update is dropped silently: the machine reboots into the old
     62   image. Upstream: ostree#3664 (the same mask, not merged), bootc#2402 (fixed in 1.18),
     63   cgwalters-forge/tracker#86. Remove the mask when the base carries the fix.
     64 - **The name is Sector F Linux**, and the branding is Sector F Labs: `os-release` says
     65   `NAME="Sector F Linux"`, `ID=sectorf`, `ID_LIKE=fedora`, and keeps Fedora's `VERSION_ID`, since
     66   tools such as dnf's repositories depend on it. The login screen's logo and fastfetch's are the
     67   Sector F Labs flask. (SeFLOS, from "Sector F Labs Operating System", was the name for a few hours
     68   on 2026-11-20; some file names, such as `seflos-logo.svg` and `/usr/share/seflos/`, still say so.)
     69 - **The login screen is Sector F Labs' and Everforest Dark.** GDM's logo is the flask with the words
     70   Sector F Labs, made by `linux/branding/make-logo.py` from patina-desktop's own flask and font, in
     71   white, as GDM draws its own UI, and set with a dconf entry (`system/etc/dconf/db/gdm.d/`). Its
     72   colours are patina's Everforest Dark skin: `linux/branding/gdm-theme.py` rewrites the greys and
     73   the accent in GNOME Shell's dark stylesheet and compiles a replacement theme resource, in its own
     74   build stage so the compiler stays out of the image; the build stops if the gnome-shell it was
     75   made from is not the one installed. Only the login screen sees it, as the session is Patina's.
     76   fastfetch has the Sector F flask as its logo (`system/etc/fastfetch/`).
     77 
     78 ## Consequences
     79 
     80 - ZFS's features are gone: per-dataset properties, inline dedup, native encryption (use LUKS) and
     81   `zfs send` streams of boot environments. Btrfs has subvolumes, send/receive, compression and
     82   reflinks. Hibernation is possible again with a swap file on Btrfs, but is not set up.
     83 - The system is read-only (`/usr`), and what a user adds goes in layers, Flatpak, containers or
     84   their home. Whether to ship Nix or Distrobox as well is open.
     85 - The NVIDIA driver is not in the image. It comes from RPM Fusion or NVIDIA's repository, built
     86   against the image's kernel at image build time, so the kernel is held back until it builds. Secure
     87   Boot needs our own signing key; nifl has it off.
     88 - Two bugs in bootc 1.17.1 and ostree 2026.4 cost most of a day, and more should be expected: the
     89   base is the best-tested one, but this stack is young. Each workaround is commented in the files
     90   with its upstream issue.
     91 - Fedora's branding still shows (the GDM logo, fastfetch's logo, the hostname `fedora`) until it is
     92   replaced; Fedora's trademark guidelines should be read before images go to anyone else.
     93 - Verified in the VM: the install onto Btrfs, a boot to GDM, a staged update applied at reboot with
     94   a layered package kept (inside the idle window, without the mask), and the kernel argument.
     95   Not verified: the mask on a fresh install after the idle timeout, a Patina session login on this
     96   base beyond one login, real hardware (nifl), the services that need hardware (Bluetooth, thermald)
     97   and snapshots of `/home`.
     98 - The repository, image tag, volumes and docs still say `patina-os`; renaming them is a separate
     99   pass.