Docs The system
Boot, install and update
This chapter covers how a BifrOSt PC starts, how the installer puts the system on a disk, and how system updates are staged, probed and rolled back. It also covers the recovery tools you use when a boot fails.
The boot path
UEFI firmware starts the BifrOSt EFI loader, BOOTx64.efi. The loader is a Rust UEFI application built from tools/splash-efi. It is the only boot program on the system. It draws the logo while the kernel and initramfs load, then starts the kernel with the EFI stub.
The loader reads its kernel command line from the first file it finds in this order:
\EFI\BIFROST\boot.cfg\EFI\BIFROST\cmdline.txt\EFI\BOOT\cmdline.txt\bifrost\cmdline.txt
An installed disk registers the firmware entry BifrOSt for \EFI\BIFROST\BOOTx64.efi. It keeps a copy of the loader in EFI\BOOT as the removable-media fallback. The installed command line names the initramfs, the root by UUID, and the root subvolume:
initrd=\initramfs-linux.img root=UUID=<uuid> rootflags=subvol=@system rw quiet loglevel=3 ...
The initramfs is built by mkinitcpio. Its hooks are set by the installer:
HOOKS=(base udev autodetect microcode modconf kms keyboard block filesystems bifrost-mounts)
The bifrost-mounts hook mounts each Btrfs subvolume in fstab and the EFI system partition before switch_root. It uses busybox init, not systemd, to avoid the mount-event rate limit in the systemd initramfs.
Startup screen
Plymouth is no longer part of the boot path. The EFI loader paints the first frame. The simple framebuffer driver keeps that frame on screen while Linux starts. Then bootweave (springboard/src/bin/bootweave.rs) starts the desktop session and records the handoff. The compositor is still labwc. A native BifrOSt compositor is not yet available.
The live ISO is UEFI only. Its EFI system partition holds the loader, the kernel and the initramfs. Machines that start in legacy BIOS mode cannot boot it.
Measure boot time
Use tools/boot-bench.py to boot the system in OVMF and report the median time of each step. It runs on the live medium or on an installed disk image.
tools/boot-bench.py live|installed [--runs N] [--inject] [--esp IMG] [--record]
| Step | Source |
|---|---|
| Firmware and loader | The loader's LoaderTimeInitUSec and LoaderTimeExecUSec values, read with systemd-analyze |
| Kernel, initramfs and userspace | systemd-analyze |
| Milestones | /run/bifrost/boot-marks, in milliseconds since kernel start |
| Modesets after the loader | KMS lines that selected a mode, and wlroots Modesetting lines |
--inject copies the working tree into the test system, so you do not need to rebuild the ISO. --record appends the medians to docs/perf-history.jsonl.
The loader sets the display's largest GOP mode, which is the only modeset at boot. The first screen after the loader fades in from the loader's frame over 450 ms.
The installer
The installer is bifrost-installer, a native Rust program that runs on the live ISO. It draws directly on DRM and KMS and reads keyboard and pointer events from evdev. It does not use a web view or a text console. The source is in springboard/src/installer/, with the entry point in springboard/src/bin/installer.rs.
The installer does the following, in order:
- Copies the files it needs from the live medium into RAM. A network failure after this point cannot stop an install that has started.
- Partitions the disk and formats the partitions.
- Mounts the Btrfs subvolumes.
- Runs
pacstrapwith the base packages, the runtime package list and the GPU packages for the detected hardware. Network access is required. - Writes the system configuration: fstab, hostname, locale, keyboard,
os-release, and the update channel. - Creates one account in the
wheelgroup and locks the root account. The password is set withchpasswd, read from standard input. - Installs the boot loader and writes the kernel command line.
- Enables the session, networking and SSH services.
The progress screen reports four stages: Preparing the disk, Installing the system, Setting up your account and apps and Finishing.
Install modes
| Mode | What happens |
|---|---|
| Erase disk | Creates a new GPT table. Asks for confirmation first. Creates a 512 MiB FAT32 EFI system partition and a Btrfs root partition with the label BifrOSt. |
| Install next to what is there | Uses the largest free region of a GPT disk and keeps the other partitions. It reuses an existing FAT32 EFI partition of at least 400 MiB. Otherwise it creates a new one. The free region must be at least 12 GiB, plus 512 MiB if a new EFI partition is needed. |
The installer supports GPT disks only.
Disk layout
New installs use Btrfs with zstd:3 compression and noatime. The EFI system partition stays FAT32. The installer creates six subvolumes:
| Subvolume | Mount point | Purpose |
|---|---|---|
@system | / | Operating system files and the package database |
@home | /home | User files and account data |
@state | /var/lib/springboard | Apps, preferences and app data |
@recovery | /var/lib/bifrost-recovery | The recovery engine and its records |
@cache | /var/cache | Download caches |
@logs | /var/log | Logs |
Updates replace only @system, and the other subvolumes are kept. Existing ext4 systems cannot be converted in place. They need an offline reinstall or a migration.
Unattended install
Set BIFROST_AUTO=user:password:/dev/DISK to run the installer without a display. It erases DISK, uses Erase mode, the first keyboard layout and en_US.UTF-8, and exits with 0 on success or 1 with the failure message.
An unattended install erases the disk without asking for confirmation. Use it only on a disk you intend to erase.
Developing the installer
Run the unit tests with cd springboard && cargo test --lib installer. On a development VM, set BIFROST_DISK_FIXTURE to a file of parted -sm outputs, separated by lines of ---, to test disk selection without touching a disk.
Software Update
System updates ship as the springboard-shell package from the BifrOSt repository. The shell is the desktop, and the update also covers base-system packages when the disk layout supports rollback.
Publish a build with tools/pc-publish.py, or with bifrost pc publish, which runs the same script:
tools/pc-publish.py [--release] [--skip-build] [--no-serve]
The version comes from springboard/Cargo.toml. Add the matching entry to CHANGELOG.md before you publish.
On the installed system, the user starts the update from Settings > Software Update. The update runs bifrost-update-guard install, which does the following:
- Refreshes the package database.
- Checks what would change. On a disk without a Btrfs root snapshot, it refuses any base-system upgrade and changes no packages.
- Saves a snapshot of the current system. On Btrfs, it snapshots
@systeminto@rollbackand copies the matching kernel and initramfs to the EFI system partition. On other layouts, it saves the shell files and package database. - Installs the packages.
When the update includes a new kernel or root, the system waits for the reboot. bifrost-update-guard apply does not reboot until pacman and the initramfs hook have finished writing the new files. It waits up to 10 minutes, runs sync, and then reboots. If the files are not complete in that time, it does not reboot.
Probation and acceptance
A new version starts on probation. It is accepted only after it has run without interruption. The guard checks these conditions every two seconds:
- The Wayland socket
/run/bifrost/user/wayland-0exists. - The shell answers a
staterequest on the control socket. - The heartbeat file
/var/lib/springboard/heartbeatchanges at least every 15 seconds.
After 30 seconds of healthy running, the update is accepted. If the conditions are not met within 90 seconds, the guard restores the previous version.
The probation phases are:
| Phase | Meaning |
|---|---|
prepared | The shell files and package database are saved. Nothing has been installed yet. |
system-prepared | The snapshot is taken and the boot files are saved. The system is waiting for the reboot. |
system-probation | The new kernel and root are running. The guard is checking the session. |
probation | The new shell is running. The guard is checking the session. |
accepted | The update passed probation. The saved previous version stays on disk. |
restoring | A rollback is in progress. |
rolled-back | The previous version was restored. |
Watchdog timers are set in /etc/systemd/system.conf.d/bifrost-watchdog.conf, with a runtime watchdog of 60 seconds and a reboot watchdog of 120 seconds. These timers check that the system is responsive. They do not check every input device.
Crash-loop guard
The shell counts starts that do not stay up for 60 seconds in /var/lib/springboard/boot_attempts. After three such starts, it exits with status 70 and stays down until the counter is cleared. The counter resets when the installed shell version changes. To clear it by hand, run rm /var/lib/springboard/boot_attempts and then systemctl restart springboard.
Rollback and recovery
A rollback on a Btrfs system uses the EFI loader. The loader reads the pending marker \EFI\BIFROST\pending before it starts the kernel:
- No marker: the loader starts the current kernel and root.
- Marker
0: the new generation gets one boot attempt. The loader consumes the attempt by changing the marker. - Any other value, or a load error after an attempt: the loader starts the previous kernel and root from
\EFI\BIFROST\rollback.txt.
If power is lost during an update, the marker still points to the previous generation. A rollback restores @system from @rollback and copies back the matching boot files. Failed roots are kept as @failed-* subvolumes for diagnosis.
Commands
Run these commands as root. Read-only status does not need root.
- bifrost-update-guard status
- Prints the current phase and the previous version.
- bifrost-update-guard install
- Checks for a system update, takes the snapshot and installs the packages.
- bifrost-update-guard watch
- Runs probation. The
bifrost-update-guard.serviceunit runs this command, and it exits when probation ends. - bifrost-update-guard rollback
- Restores the previous version by hand. Use it when the current version works but you want the previous one.
After an update, you can check the result with bifrost-update-guard status. The phase is accepted when the update passed probation.
Limits
- On ext4, the guard protects only shell-package updates. It refuses base-system upgrades.
- Administrator
pacmancommands are outside the guard. Usebifrost-update-guard installfor managed updates. - Snapshot rollback does not repair the EFI loader, the firmware or the disk.
- Full recovery from a damaged kernel or root has not yet been tested on hardware.
The recovery engine is a static binary in @recovery. It runs independently of the shell and the desktop session. The source is in packaging/arch/recovery/: guard.rs for the update guard and system.rs for the snapshot and boot-file logic.
Related chapters
The services that start after boot are described in System services. The process and package layout is in Architecture. To publish an app rather than a system update, see Publishing.