sector-f-linux

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

commit 10bae84022e200de14ea9dc941edc1a41a15f1c3
parent 0236d416518a823607300a31445cc890acb79b22
Author: Divan Visagie <me@divanv.com>
Date:   Fri, 20 Nov 2026 23:26:25 +0100

Docs: ADR-0011 (proposed), the first boot is the installer; ADR-0010 amended

The direction: a machine is set up the way a Mac is. The live disc only picks a target drive and puts the whole system on it (wipe, bootc install to-disk, from the payload in the ISO), with a picker that shows what is on each drive and never offers the boot stick; the first boot, when no user exists, runs a Patina setup assistant that makes the account and the per-machine things (machine ID, SSH host keys, encryption keys); and a factory reset is that same first boot again, with no live disc. Whole drive only; a partition install and /home on a second drive are later.

The open questions (the boot entry on a real multi-drive machine, a no-user session for the setup, encryption, the Btrfs layout, how ostree stores /etc changes for resets) and an order of work, starting with an experiment, are in the ADR. ADR-0010's status points to it and its user-account question is marked settled.

Diffstat:
Mdocs/adr/0010-a-live-installer-built-from-the-image.md | 12++++++------
Adocs/adr/0011-the-first-boot-is-the-installer.md | 104+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 110 insertions(+), 6 deletions(-)

diff --git a/docs/adr/0010-a-live-installer-built-from-the-image.md b/docs/adr/0010-a-live-installer-built-from-the-image.md @@ -4,8 +4,10 @@ Date: 2026-11-20 ## Status -Proposed. The user wants a live-CD installer: boot a stick, see the Patina desktop, install from -it. This records what was found about building one and what is still unknown. Nothing here has +Proposed, and amended by [ADR-0011](0011-the-first-boot-is-the-installer.md): the live installer only +picks a target drive and puts the whole system on it, and the account is made by a setup assistant +on the first boot, not by the installer. The user wants a live-CD installer: boot a stick, see the +Patina desktop, install from it. This records what was found about building one and what is still unknown. Nothing here has been built; "checked" means looked at on 2026-11-20, "unchecked" means taken from a README. ## Context @@ -72,10 +74,8 @@ regenerated initramfs, and `iso.yaml`. ## Open questions -- **The user account.** The image has no user. `bootc install` has no option to make one, as far as - I know. The choices are a first-boot setup app that makes it (a Patina "welcome" screen), or the - installer writing the account into the installed system's `/etc` and `/var/home` after the - install. Needs a look at what `bootc install` offers (kickstart-like config, `to-filesystem`). +- **The user account.** Settled in ADR-0011: a first-boot setup assistant makes it, and the + installer only picks the drive. - **Where the published image lives**, and who builds it: `ghcr.io/Sector-F-Labs/...` from CI, with signatures. The installer's `--target-imgref`, the update policy and the registry's trust all hang on this. diff --git a/docs/adr/0011-the-first-boot-is-the-installer.md b/docs/adr/0011-the-first-boot-is-the-installer.md @@ -0,0 +1,104 @@ +# 0011. The first boot is the installer; the live disc only picks a drive + +Date: 2026-11-20 + +## Status + +Proposed. The user's direction: a machine should be set up the way a Mac is. The system is put on a +drive and expanded, and the first boot, when no user exists, runs a setup built into Patina. Amends +[ADR-0010](0010-a-live-installer-built-from-the-image.md): the live installer stays, but its job +shrinks to choosing a drive. Nothing here has been built; "to verify" marks what has not been +looked at. + +## Context + +[ADR-0010](0010-a-live-installer-built-from-the-image.md) planned a live disc with an installer that +runs `bootc install`, and left open how the first user gets made: the published image has no +accounts (only the test image has one), so a fresh install would boot to a login screen with +nobody on it. + +[ADR-0008](0008-install-by-receiving-the-system-as-a-zfs-stream.md) (superseded, written for ZFS) +had already worked out what an image-based install has to get right: every machine must differ in +a few things (machine ID, SSH host keys, encryption keys), and a cloned encrypted image would give +every machine the same master key. It assumed an installer that took the whole disk. The reasons it +gave for that still hold. + +The comparison the user draws is macOS: a new machine boots into Setup Assistant, and "Erase All +Content and Settings" returns it there without reinstalling the OS. Raspberry Pi OS, Chromebooks +and the Steam Deck work the same way. Our architecture suits it: `/usr` is the read-only image, and +everything that belongs to a person lives in `/etc` and `/var`. + +On a desktop there is often more than one drive, and a drive per system is the cleaner arrangement +than sharing one. + +## Decision (proposed) + +Two jobs, kept apart: + +**1. The live disc picks a drive and puts the whole system on it.** +- It boots the Patina desktop and offers an Install app that lists the machine's drives. +- The user picks one; it is erased and the system installed on all of it, with + `bootc install to-disk --wipe --filesystem btrfs` from the payload in the ISO (ADR-0010), so no + network is needed. +- **Whole drive only.** Installing into a partition beside other things is a later option, and so + is putting `/home` on a second drive. +- **The picker is the dangerous part**, so it shows each drive's model, size and serial and what is + on it (partition names, filesystem labels, a Windows or Linux install), never offers the drive + the live system booted from or one with something mounted, and asks for a confirmation that + names the drive. + +**2. The first boot sets the machine up.** +- The installed image has no users. When none exists, a setup assistant (a Patina app, in the + family of Files and Settings) runs before any login: the account and its password, hostname, + timezone and keyboard, and joining the tailnet if wanted. +- It makes the account through AccountsService, the D-Bus service GDM and GNOME use (to verify + that it can run without GNOME, and what permissions the setup session needs). +- Everything that must differ between machines is made here, not in the image: the machine ID and + SSH host keys (systemd and sshd already do this at first boot), and any encryption key, made on + the machine it protects. + +**3. Factory reset is the same first boot again.** A reset action clears `/var`, restores `/etc` to +the image's defaults and reboots into setup, with no live disc and no reinstall of the system. +Separate Btrfs subvolumes for `/var` and `/home` would make it quick, and systemd has a +factory-reset mechanism (to verify that it fits an ostree system, and how the image's `/etc` is +restored: how ostree stores local `/etc` changes has not been looked at). + +## Open questions + +- **Does the installed system boot from the chosen drive on a real, multi-drive desktop?** + `bootc` writes the bootloader to that drive's EFI partition. Whether it also registers a + firmware boot entry, which a machine with a Windows drive or two may need, is unchecked. +- **A no-user session for the setup.** Patina's compositor needs a setup mode, run by GDM or by a + greeter of our own, as an unprivileged account, the way `gnome-initial-setup` runs. How, and + whether GDM's own initial-setup support can be used, is to look at. +- **Encryption.** It cannot be in a shared image. Creating the encrypted storage at first boot with + a key made on that machine (`systemd-repart` can, with the TPM or a passphrase), or an encrypted + home per user (`systemd-homed`), are options; neither has been tried on this stack. +- **The Btrfs layout.** Whether `bootc install` can create subvolumes for `/var` and `/home`, or + the first boot has to. +- **Joining the tailnet** (a pre-auth key, or approving the new node), and anything else the + assistant should ask. + +## Order of work + +1. **A quick experiment:** on a VM installed from the published image, which has no users, make an + account over D-Bus at first boot and log it into the Patina session. It shows whether the + assistant is mostly a Patina interface over existing plumbing, or whether the session needs real + work. +2. **The live disc boots in QEMU** with two blank virtual disks (ADR-0010, step 1). +3. **The drive picker**, as a script first, tested on the two disks: the chosen one gets the + system, the other is untouched. +4. **The setup assistant.** +5. **The boot entry on real multi-drive hardware.** +6. **Factory reset**, and the `/var` and `/home` layout. +7. **Encryption.** + +## Consequences + +- The installer needs no account screens and no partition editor, so the live app is a drive + picker with a progress bar. Its code is small; the setup assistant is where the work is. +- The same assistant serves a new install and a reset, so what a user sees the first time is what + they see after "erase and start again". +- Releases can also ship as a plain disk image that is written to a drive and grown on first boot, + for machines installed from another computer, with no live disc. +- The whole-drive rule means a dual-boot on one drive is not supported, by choice.