Skip to content

Installing Luft

Installing involves three parts: Install Luft, the app in apps/system/setup; installer, the service behind it on com.lantharos.Installer1; and Kestrel’s setup mode, which runs both before anyone has an account. The same app runs from the USB stick and from Meet Luft’s partitions.

/usr/lib/installer/install.toml says which images the installer may put on a drive:

version = "1.2-nightly.21"
[images.default]
source = "containers-storage:ghcr.io/lantharos/luft:1"
target = "ghcr.io/lantharos/luft:1"
size = 5286520084

The image itself ships only the settings above the tables, such as smallest-system, the size in bytes below which drives and free spaces aren’t offered (32 GiB unless set). The stick’s build in os/iso adds the rest: the version it carries, from the image’s label, and an [images.NAME] table for each image with the size Podman reports for it. [images.nvidia] is picked on computers with an NVIDIA graphics card, and a stick with a single table installs that image everywhere.

source is where the stick holds the image, target where the installed system gets its updates: ghcr.io/lantharos/luft:1 on a release’s stick, :1-nightly on a nightly’s, with -nvidia for the NVIDIA image. The image doesn’t know its own channel, so a release can be exactly the image that was tested as a nightly.

The stick keeps both images in a read-only image store that the live session adds to Podman’s storage, so installing needs no network. While bootc unpacks, the installer puts /var/tmp on the new drive, because bootc keeps each layer there until it’s unpacked and the live session’s own changes live in memory. Kernel arguments come from the image’s /usr/lib/bootc/kargs.d and are sealed into its startup image.

When the drive’s EFI system partition is smaller than 1 GB, as Windows’ usually is, the installer adds a 2 GB XBOOTLDR partition in front of Luft’s for the startup images and boot entries. bootc uses it for them since 1.17.5.

A stick can be weeks old, so when the computer is online as copying starts, the installer installs the newest image of the stick’s channel from target instead, and uses the stick as a cache for it:

  1. It opens target in the registry through skopeo with a policy of its own: the rules /etc/containers/policy.json sets for that repository, the same signatures updates check, with everything else refused. An image without them, a repository the policy doesn’t require signatures for, or no answer within 15 seconds means the stick’s image is installed, as it would be offline.
  2. It installs the registry’s image only when its org.opencontainers.image.version is newer than the stick’s, both are nightlies or both releases, and both have NVIDIA’s driver or neither (com.lantharos.nvidia-driver).
  3. It opens the new system’s composefs repository the way bootc creates it, and fills it from both sides at once, four layers at a time each: the layers the two images share come from the stick, matched by their uncompressed digest, and only the others download. skopeo checks every layer against its digest before it’s kept.
  4. With every layer there, it stores the image’s configuration next to them and writes an OCI layout with only the manifest and configuration into the scratch folder on the new drive. bootc installs from that layout, finds every layer already in the repository, and builds the system without another download. The repository folder is bind-mounted onto itself, like the scratch folder, since bootc wants an empty root.

When a layer fails to download, or nothing arrives for 30 seconds, the installer gives up on the download and bootc installs the stick’s image, finding the shared layers already copied. bootc only ever installs one complete image, so a system is never half the stick’s and half the newer one. Layers that downloaded for nothing stay in the repository until the first update collects them.

The progress bar follows whichever side is further behind while both run, and bootc’s own work after them.

The stick’s kernel command line has rd.live.image, which is how the installer knows where it runs. greetd signs in the passwordless live account with kestrel-session --setup as its initial_session, polkit allows that account everything, and Install Luft appears in Gust only there.

  • Setup’s first screen starts from the language, formats, time zone and keyboard layouts Meet Luft wrote into meet.json, or else from a Windows it can read on the computer, and from the time zone Fedora’s GeoIP service gives once it’s online. It only says it guessed when one of these told it something.
  • Changing the language on that screen changes the live account’s language through AccountsService, so Kestrel follows, and UseLanguage makes the service answer in it too. The service keeps the choice in /run/installer/language across its idle restarts.
  • After copying, trustctl startup install puts shim and SushiBoot on the EFI system partition and makes the new system the firmware’s next start (BootNext), so a stick left in doesn’t start setup again. With Secure Boot on and Luft’s key not yet trusted, trustctl secure-boot enroll --state queues the key in the new system’s /var/lib/trustd, and the service publishes its code as SecureBootCode so the restart screen can show it. Boot and recovery covers what happens to the request at the next start.
  • The recovery key is saved onto a USB drive through UDisks, printed, or written down and checked by typing back three of its 12 words. Encryption stays off until one of them worked, and the key is never saved into the live session’s home, which is gone after the restart.
  • Wi-Fi networks joined in the live session come along from /etc/NetworkManager/system-connections and /run/NetworkManager/system-connections. Before the account exists, passwords the session’s keyring held move into NetworkManager’s own files, readable by root alone, so the network belongs to everyone on the computer and connects at the first start.

After copying, the installer writes the locale, keyboard, time zone, computer name and account into the new system, and /var/lib/installer/first-boot with the account’s name. greetd gets an initial_session for that account, so every start goes straight back into setup until it’s finished.

The account’s Luft Keyring is created with its password, plus a one-time key in /var/lib/luft-keyring that unlocks it in those setup sessions, since an automatic sign-in has no password to unlock it with. While setup is pending, the service also enrolls Luft’s Secure Boot key, adds fingerprints, has luft-sign-in add a security key (EnrollSecurityKey) and tells the firewall the first network’s type (SetNetworkType), so the person isn’t asked for the password they just chose. It does these only for the account setup is pending for, signed in at the computer, and only for programs outside a sandbox.

FinishFirstBoot, which only that account may call, removes the initial_session, the marker and the keyring’s one-time key, and the next start shows the login screen. Setup doesn’t stay open forever: installer-expire-setup.service counts the starts, and after five, or a day after installing, it finishes setup the same way before the login screen appears. The service stops doing setup’s work at the same limits.

With "forSomeoneElse": true, Install needs no account and writes none. Luft’s partition is encrypted with a temporary key instead of the owner’s, the Wi-Fi joined on the stick isn’t carried over, and the new system starts in setup as the luft-setup account until its owner has made theirs. Computers waiting for their owner follows it from there.

kestrel-session --setup runs Kestrel in setup mode until Install Luft finishes, then starts the normal session, and --setup-only ends the session instead. kestrel-session does the same by itself when first-boot names the person signing in. Setup mode runs as kestrel-setup.target, which starts the graphical session as the desktop does, so file dialogs, printing, the portal’s appearance settings and Luft’s palette all work. It keeps the firmware logo on screen while Sushi hands over and ends on the blurred wallpaper the desktop starts with, so there’s no flash between them.

Services that belong only on the desktop wait for kestrel-session.target. The portal service stops with setup mode and starts again once the desktop’s Kestrel is ready, since it learns which portals Kestrel serves when it starts, and setup mode serves fewer.