sector-f-linux

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

0010-a-live-installer-built-from-the-image.md (6961B)


      1 # 0010. A live installer, built from the image
      2 
      3 Date: 2026-11-20
      4 
      5 ## Status
      6 
      7 Proposed, amended by [ADR-0011](0011-the-first-boot-is-the-installer.md) and again by
      8 [ADR-0014](0014-the-live-disc-boots-straight-into-the-installer.md) (no desktop and no try mode: the disc boots straight into the installer), and amended by ADR-0011: the live installer only
      9 picks a target drive and puts the whole system on it, and the account is made by a setup assistant
     10 on the first boot, not by the installer. The user wants a live-CD installer: boot a stick, see the
     11 Patina desktop, install from it. This records what was found about building one and what is still unknown. Nothing here has
     12 been built; "checked" means looked at on 2026-11-20, "unchecked" means taken from a README.
     13 
     14 ## Context
     15 
     16 Everything so far installs the image with `linux/vm/disk.sh`, which loop-mounts a disk file and runs
     17 `bootc install to-disk` in it. That is a test rig: it needs Docker, a registry on the host and a
     18 `dev` image with a login. A user needs a stick that boots, offers to install, and leaves a machine
     19 that follows our published image ([ADR-0009](0009-seflos-a-fedora-bootc-image-on-btrfs.md)).
     20 
     21 ADR-0008 (superseded) had the same idea for a ZFS stream: a stick that boots the OS itself. What is
     22 new is that a way to build one from a bootc image exists.
     23 
     24 ### What exists
     25 
     26 - **A container-native ISO contract** ([ondrejbudai/bootc-isos](https://github.com/ondrejbudai/bootc-isos),
     27   v0.1.0, an experiment by an osbuild maintainer). The image provides its own kernel, initramfs, shim
     28   and GRUB; `image-builder` (osbuild's `image-builder-cli`) turns it into an ISO with the `bootc-generic-iso`
     29   type, embedding the image as `/LiveOS/squashfs.img`. The image configures GRUB and the initramfs to
     30   load that squashfs (`root=live:CDLABEL=...`, `rd.live.image`) through `/usr/lib/bootc-image-builder/iso.yaml`.
     31   `--bootc-installer-payload-ref` copies a second image into the live system's container storage: an
     32   offline installer. Its examples include Bazzite's live ISO with an offline installer, Kinoite,
     33   Bluefin LTS, a tiny Debian and Ubuntu, and `fedora-payload`, "a minimal text-based Fedora bootc
     34   online installer" (unchecked).
     35 - **titanoboa** ([ublue-os/titanoboa](https://github.com/ublue-os/titanoboa)), which Universal Blue
     36   uses for Bluefin: a GitHub Action and a `podman run` that build a live ISO from a bootc image that
     37   follows the same contract. Its stated aims are a live CD to try the image, and installing it to a
     38   chosen disk with little input (unchecked).
     39 - `image-builder-cli`'s latest release was v69 (2026-06-17). I could not confirm from its repository
     40   that `bootc-generic-iso` is in a release, nor the exact option names (the code search returned
     41   nothing): the contract's README says a fairly new `image-builder` is needed and suggests building
     42   its container.
     43 
     44 ### How far our image is from the contract (checked, in `fedora-bootc:45`)
     45 
     46 | The contract wants | Our base |
     47 |---|---|
     48 | kernel and `initramfs.img` together in `/usr/lib/modules/*/` | there |
     49 | shim and GRUB under `/usr/lib/efi/shim/*/EFI/fedora` | `shimx64.efi`, `mmx64.efi` there; **`gcdx64.efi` (GRUB) is not** |
     50 | GRUB modules in `/usr/lib/grub/i386-pc` | there |
     51 | `podman`, `mksquashfs`, `grub2-mkimage`, `python` in the image | there |
     52 | `xorriso` and `implantisomd5` in the image | **missing** |
     53 | `VERSION_ID` in `os-release` | `45`, there |
     54 | an initramfs that can boot a live squashfs | **missing**: `dracut-live` is not installed |
     55 | `/usr/lib/bootc-image-builder/iso.yaml` | **to write** |
     56 
     57 So the gaps are packages (`dracut-live`, `xorriso`, `isomd5sum`, probably `grub2-efi-x64`), a
     58 regenerated initramfs, and `iso.yaml`.
     59 
     60 ## Decision (proposed)
     61 
     62 - **A `live` target in the Containerfile**, built from `system`, so the installed image stays clean.
     63   It adds `dracut-live` and regenerates the initramfs with it, the ISO tools, GRUB's EFI binary,
     64   `iso.yaml`, a `liveuser` that logs into the Patina session by itself, and the installer.
     65 - **The ISO is built with `image-builder`'s `bootc-generic-iso`**, or with titanoboa if that is not
     66   yet usable, from the `live` image, with the `system` image as the payload, so installing needs
     67   no network. The result is a squashfs of the live system plus the payload: the size is unknown, and
     68   a guess is several GB.
     69 - **The installer starts as a script**, run from a terminal or a desktop launcher, that lists disks,
     70   asks to wipe one and runs `bootc install to-disk --filesystem btrfs` from the payload, with
     71   `--target-imgref` set to the published image so the machine updates from there. A Patina app
     72   (egui, in the family of Files and Settings) replaces it once the pipeline works.
     73 - **The first test loop is QEMU**: boot the ISO with OVMF, install onto a blank virtual disk, shut
     74   down, boot the disk, log in.
     75 
     76 ## Open questions
     77 
     78 - **The user account.** Settled in ADR-0011: a first-boot setup assistant makes it, and the
     79   installer only picks the drive.
     80 - **Where the published image lives**, and who builds it: `ghcr.io/Sector-F-Labs/...` from CI,
     81   with signatures. The installer's `--target-imgref`, the update policy and the registry's trust
     82   all hang on this.
     83 - **Secure Boot.** The ISO would boot through Fedora's signed shim and GRUB (unchecked); whether a
     84   rewritten initramfs and our own kernel arguments pass depends on how the shim is set up.
     85 - **The disk layout:** Btrfs subvolumes and compression, optionally LUKS. `bootc install` options for
     86   these are unchecked; a layout of our own may need `to-filesystem`.
     87 - **Branding:** the early boot messages still say "Fedora Linux" until the initramfs is rebuilt, and
     88   a live ISO rebuilds it anyway, so this may come free.
     89 - **Does the live session fit in the squashfs and RAM:** the desktop was only ever tried in the VM
     90   with software rendering.
     91 
     92 ## Order of work
     93 
     94 1. **A live ISO that boots to a login in QEMU**, from the contract's `fedora-payload` example or a
     95    copy of our image with the missing packages. This proves the pipeline and the tool.
     96 2. **Our own image as the live system**, with the Patina session and `liveuser`.
     97 3. **The installer script**, installing the payload onto a virtual disk that then boots.
     98 4. **The user account**, by whichever way the open question settles.
     99 5. **Publishing and CI**: the image on a registry, the ISO as a CI artifact, the installer pointing
    100    at the published image.
    101 6. **The Patina installer app**, and the branding.
    102 
    103 ## Consequences
    104 
    105 - The test rig stays for development; the installer is a separate path that shares the Containerfile.
    106 - The ISO carries the whole system image, so it is big and rebuilt with every release.
    107 - It depends on `image-builder`'s ISO support being usable, which is young and described as an
    108   experiment; titanoboa is the fallback.
    109 - Building ISOs needs rootful podman (the contract's tools run in a container), so the host needs
    110   podman, which this machine does not have.