Skip to content

Boot systemd-boot installs from a pre-built initramfs - #529

Merged
omarchybot merged 2 commits into
quattrofrom
systemd-boot-fast-install
Nov 25, 2026
Merged

omarchybot merged 2 commits into
quattrofrom
systemd-boot-fast-install

Conversation

@omarchybot

Copy link
Copy Markdown
Collaborator

Brings systemd-boot installs back to Limine's install speed. On real hardware a systemd-boot install took 9.6 s against about 4.6 s on Limine: mkinitcpio on the target is 4.0 s of it. The Limine path avoids that with the image's pre-built UKI, but that one has a systemd-hook initramfs without Omarchy's snapshot and restore hooks, so systemd-boot can't use it.

  • Image (build-root-image.sh): builds a pre-built initramfs with the image's own busybox hook set (encrypt, omarchy-snapshot-overlay, omarchy-restore), generic like the UKI (no autodetect, no kms), and records its kernel, keymap and a hash of every file it is built from. An image whose omarchy-boot-rebuild can't take it carries none.
  • Install (finalize_systemd_boot): passes it to omarchy-boot-switch install --initramfs (omacom/omarchy companion PR) unless the machine needs its own build: a different kernel build, a keyboard layout other than the image's, an aarch64 board with its own platform, a shared ESP (the generic image is about twice the machine's), or any change to the files it is built from (hardware modules such as NVIDIA's, the provisioning key, hibernation's resume hook, modprobe options).
  • Afterwards: the file is deleted once the boot is set up, so it doesn't stay in @ and the factory snapshot.

The image grows by about 70 MB. Integration results and install timings in QEMU follow in a comment.

🤖 Generated with Claude Code

dhh and others added 2 commits November 25, 2026 22:31
The root image now carries the initramfs omarchy-boot-switch install
would build on the target, next to Limine's pre-built UKI: the image's
own mkinitcpio configuration (the busybox hooks with encrypt and
Omarchy's snapshot-overlay and restore hooks) for its kernel, generic
the way the UKI is, without autodetect and kms. It measures about
50 MiB. build-root-image.sh records its kernel, version, MODULES lines,
keymap and a hash of every file it is built from.

finalize_systemd_boot passes it as --initramfs to omarchy-boot-switch
install when the target's omarchy-boot-switch takes the option, the
image's kernel is installed as built, and none of the pre-built UKI's
fall-backs apply: no added initramfs modules, the image's keymap, no
provisioning key, no aarch64 board with a platform of its own. Anything
else a hardware script changed in the initramfs configuration, module
options or initcpio hooks builds on the machine too. That saves the 4 s
of mkinitcpio that made systemd-boot installs slower than Limine's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review follow-ups: the input hash already catches added modules and the
provisioning key, so their separate checks and the modules record go (the
modules check also defeated the kernel-modules drop-in's ignore). A shared
ESP builds the smaller machine image, the image skips the file when its
omarchy-boot-rebuild can't take it, and the file is deleted once the boot
is set up instead of staying in @ and the factory snapshot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5 · The PR appears safe to merge; no actionable issues were found.RetriggerView in GreptileConfidence Score: 5/5

[High impact] The PR appears safe to merge; no actionable issues were found.

Summary

Adds a pre-built initramfs for compatible systemd-boot installs to skip building it on the target.

  • Eligible systemd-boot installs reuse the image's initramfs.

No actionable issues were found. No runtime tests were run.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Build root image] --> B{Runtime supports pre-built initramfs?}
  B -->|Yes| C[Build initramfs and record inputs]
  B -->|No| D[Ship without pre-built initramfs]
  C --> E{Target matches recorded inputs and guards?}
  D --> F[Build on target]
  E -->|No| F
  E -->|Yes| G[Pass initramfs to boot setup]
  F --> H[Finish boot setup]
  G --> H
  H --> I[Delete pre-built files]
  I --> J[Create factory snapshot]
Loading

Reviews (1) · Last reviewed commit: "Trim the pre-built initramfs checks and ..." · Reviewed by Greptile

@github-actions

Copy link
Copy Markdown

Install test passed

x86_64 vs quattro aarch64 vs quattro
Result ✅ passed ✅ passed
Build the ISO 87.0 s +4.0 s 160.0 s −12.0 s
Install 19.7 s +2.3 s 16.8 s −1.6 s
First boot 6.7 s +1.0 s 4.9 s +0.0 s
Everyday boot 7.5 s +1.7 s 4.7 s +0.1 s

Boots are loader, kernel and userspace, without the VM's firmware.

Install phases, x86_64
Phase This PR quattro
Preparing live environment 1.3 s 1.3 s
Preparing install target 8.8 s 7.4 s
Installing Arch + Omarchy 8 s 7.3 s
Configuring system 0.6 s 0.5 s
Staging provisioning 0 s 0 s
Finalizing boot and user 0.7 s 0.6 s
Configuring login 0 s 0 s
Configuring SSH access 0.3 s 0.2 s
Configuring Tailscale 0 s 0 s
Configuring DNS resolver 0 s 0 s
Validating boot setup 0 s 0 s
Creating factory snapshot 0.1 s 0.1 s
Install phases, aarch64
Phase This PR quattro
Preparing live environment 1.3 s 1.4 s
Preparing install target 4.8 s 4.7 s
Installing Arch + Omarchy 8.8 s 10.5 s
Configuring system 0.6 s 0.6 s
Staging provisioning 0 s 0 s
Finalizing boot and user 0.9 s 0.8 s
Configuring login 0 s 0 s
Configuring SSH access 0.3 s 0.3 s
Configuring Tailscale 0 s 0 s
Configuring DNS resolver 0 s 0 s
Validating boot setup 0.1 s 0.1 s
Creating factory snapshot 0.1 s 0.1 s

Run · 2705676

@omarchybot
omarchybot merged commit 2f7cabf into quattro Nov 25, 2026
22 checks passed
emirb added a commit that referenced this pull request Nov 26, 2026
Brings in the hardware layers (#530), the library read before the first
pacman transaction (#531), systemd-boot installs (#489, #529) and the
setup form's XKB layouts (#528).

Two conflicts. In builder/build-root-image.sh both steps stay: the
hardware layers first, which write into the image tree, then the Try
layer against the finished image. In phases_impl.py the hardware layer
paths join the squashfs ROOT_IMAGE and its mount paths.
outfoxxed added a commit that referenced this pull request Nov 28, 2026
This reverts commit 2f7cabf, keeping the layers comment a later commit
reworded. The pre-built initramfs has no GPU drivers, and on an image with
the boot splash no keyboard layout but US, so a password typed at install in
a non-Latin layout could not be typed at the first boot's prompt.
systemd-boot installs build their own on the machine again.
_recorded_initramfs_inputs stays: the Snapdragon UKI (#588) reads its
record with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
outfoxxed added a commit that referenced this pull request Nov 28, 2026
This reverts commit 2f7cabf, keeping the layers comment a later commit
reworded. The pre-built initramfs has no GPU drivers, and on an image with
the boot splash no keyboard layout but US, so a password typed at install in
a non-Latin layout could not be typed at the first boot's prompt.
systemd-boot installs build their own on the machine again.
_recorded_initramfs_inputs stays: the Snapdragon UKI (#588) reads its
record with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
outfoxxed added a commit that referenced this pull request Nov 28, 2026
This reverts commit 2f7cabf, keeping the layers comment a later commit
reworded. The pre-built initramfs has no GPU drivers, and on an image with
the boot splash no keyboard layout but US, so a password typed at install in
a non-Latin layout could not be typed at the first boot's prompt.
systemd-boot installs build their own on the machine again.
_recorded_initramfs_inputs stays: the Snapdragon UKI (#588) reads its
record with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
outfoxxed added a commit that referenced this pull request Nov 28, 2026
This reverts commit 2f7cabf, keeping the layers comment a later commit
reworded. The pre-built initramfs has no GPU drivers, and on an image with
the boot splash no keyboard layout but US, so a password typed at install in
a non-Latin layout could not be typed at the first boot's prompt.
systemd-boot installs build their own on the machine again.
_recorded_initramfs_inputs stays: the Snapdragon UKI (#588) reads its
record with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
outfoxxed added a commit that referenced this pull request Nov 28, 2026
This reverts commit 2f7cabf, keeping the layers comment a later commit
reworded, and removes the parallel build of its initramfs that 61c8412
added. The pre-built initramfs has no GPU drivers, and on an image with
the boot splash no keyboard layout but US, so a password typed at install in
a non-Latin layout could not be typed at the first boot's prompt.
systemd-boot installs build their own on the machine again.
_recorded_initramfs_inputs stays: the Snapdragon UKI (#588) reads its
record with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dhh pushed a commit that referenced this pull request Nov 28, 2026
* Install with greetd's login screen and Omarchy's boot splash

configure_login points greetd's login screen at the install's user through
the target's omarchy-system-login, with autologin on an encrypted install,
in place of SDDM's state and autologin files.

An image whose settings package carries the omarchy-splash hook gets no
pre-built UKI: its systemd initramfs runs Plymouth, so every install builds
the busybox initramfs the splash runs in, and shows the splash from its
first boot. Nor does such an image ship omarchy-boot-systemd: the splash is
untested with systemd-boot, so a build that would ship them together fails.
prebuilt-uki-test.sh runs the pre-built UKI builds, in turn and in
parallel, with and without the splash.
Comments, docs and tests name the login screen and the splash where they
named SDDM and Plymouth.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Log Try in with greetd and Omarchy's login screen

The Try layer enables greetd and has omarchy-system-login log its user in
at boot. After a logout the login screen asks for the user's empty password,
and Enter logs back in. SDDM's Relogin goes, with the passwordless theme and
the session wrapper that kept it working, and so does the udev settle
drop-in: omarchy-system-wait-drm runs before greetd.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Revert "Boot systemd-boot installs from a pre-built initramfs (#529)"

This reverts commit 2f7cabf, keeping the layers comment a later commit
reworded, and removes the parallel build of its initramfs that 61c8412
added. The pre-built initramfs has no GPU drivers, and on an image with
the boot splash no keyboard layout but US, so a password typed at install in
a non-Latin layout could not be typed at the first boot's prompt.
systemd-boot installs build their own on the machine again.
_recorded_initramfs_inputs stays: the Snapdragon UKI (#588) reads its
record with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants