Skip to content

Boot through systemd-boot, with snapshot boot and restore - #19667

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

omarchybot merged 42 commits into
quattrofrom
systemd-boot-2

Conversation

@omarchybot

@omarchybot omarchybot commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

Secure Boot on stock consumer hardware needs a Microsoft-signed shim, and shim review's established second stages are GRUB and systemd-boot, not Limine. New UEFI installs boot systemd-boot (with omacom/omarchy-iso#489), and existing installs can move with omarchy-boot-switch, keeping what Limine gave us: a boot entry for every snapshot, booted writable, and restorable.

Secure Boot itself is not turned on here. That waits on the Omarchy shim, kernel lockdown and module signing (see "Not in this PR").

Packaging lands with omacom/omarchy-pkgs#3202. This replaces #18974, rebased onto quattro. The QEMU prototype and design notes are on omacom/omarchy-iso sdboot-snapshot-prototype.

How it boots

  • Boot images. Every kernel build is a boot image: kernel, initramfs and the command line in effect, kept in a boot store. The store is a new top-level btrfs subvolume, @omarchy-boot, mounted at /var/lib/omarchy/boot, so a restore never rolls it back.
  • One signed UKI per image. omarchy-boot-sync turns each image into one UKI built with ukify. The live system and every snapshot taken on that image are profiles inside it, each with its own rootflags=subvol= (snapshots also get noresume). Under Secure Boot, systemd-stub ignores outside command lines, so each snapshot's root selection has to be inside the signed image.
  • Pinned snapshots. A snapshot is pinned to the boot image that was current when it was taken. Rolling back from a broken initramfs or command-line change therefore boots the old ones too.
  • One rebuild pipeline. omarchy-boot-systemd's pacman hooks replace mkinitcpio's: same triggers, but they build a plain initramfs, store it as an image and publish it. A snapper plugin pins each new snapshot; omarchy-boot-sync.service publishes it.
  • Overlay hook for everyone. omarchy-snapshot-overlay boots a read-only snapshot writable through a tmpfs overlay. It replaces btrfs-overlayfs on every install, Limine ones included, so no hook belongs to a Limine package any more.

The switch: omarchy-boot-switch

It runs in stages recorded in the boot store, so it can be re-run, finished or reverted from wherever it stopped:

  1. Preflight. Checks for x86 with UEFI and not an Intel Mac, Omarchy's btrfs @ layout, free space on the ESP and root, no pending provisioning, and Omarchy's new initramfs hooks. It also confirms the command line can be carried over faithfully.
  2. Staged.
    • Creates the store.
    • Moves the command line out of Limine's config into /etc/kernel/cmdline and /etc/cmdline.d/. The result is checked against limine-entry-tool --get-cmdline: same parameters, and repeated parameters in the same order.
    • Builds the images and installs systemd-boot next to Limine.
  3. Trial. BootNext starts systemd-boot once, with Limine still first in BootOrder. A trial that fails comes back up on Limine.
  4. Promoted. The trial came up, so systemd-boot moves to the front of BootOrder.
  5. Active. The next boot proves the firmware starts systemd-boot from its boot order. Then:
    • omarchy-boot-systemd replaces the Limine packages, and owns the replacement hooks.
    • A recovery snapshot is taken and its entry verified.
    • Limine's files, its per-snapshot copies and its NVRAM entry are removed.
    • EFI/BOOT/BOOTX64.EFI becomes systemd-boot if it was Limine's.

omarchy-boot-switch revert puts Limine back at any stage before active.

Snapshots taken before the switch stay on disk but can't be booted or restored from systemd-boot, because their roots expect Limine. The switch says so before asking.

Rollout. New installs get systemd-boot. Existing installs aren't prompted: there's no update prompt and no menu entry, only the omarchy-boot-switch command. Once the Microsoft-signed shim ships, an update will offer the switch as "Upgrade to Secure Boot". BIOS installs stay on Limine. omarchy-boot-backend and the omarchy-boot-cmdline/omarchy-boot-rebuild helpers keep every other command working on either loader. ARM platforms and BIOS installs stay on Limine.

Restore

omarchy snapshot restore N works from the live system or from a booted snapshot, in two phases:

  1. Staging. Makes a writable copy of the snapshot at the btrfs top level and writes a journal in the boot store, with both roots identified by subvolume UUID.
  2. Maintenance boot. The omarchy-restore initramfs hook applies the journal with nothing running:
    • @ becomes @backup-<tx> and the copy becomes @.
    • The nested subvolumes (.snapshots, swap, var/lib/machines, var/lib/portables) move over onto their empty placeholders.

Every step checks what's already done, so a power cut resumes, and a failure puts everything back. When the restored root uses the running kernel and initramfs, the boot just continues (one passphrase). Otherwise the hook arms a one-shot boot of the restored root's own image and reboots. The replaced root stays bootable as "Before restore", and omarchy snapshot restore backup undoes the restore.

Staging refuses while the swapfile holds a hibernation image, and blocks hibernation until the restore is done. A moved swapfile's resume_offset is recomputed.

Tested on a real encrypted Omarchy install in QEMU

An Omarchy 4.0.4 install (LUKS + btrfs + Limine + snapper) was updated to 4.5.0. It then got this branch and the omarchy-pkgs branch as packages built inside it, as a release would deliver them. After the rebase onto quattro, the same VM moved to the edge channel and the whole switch ran again from Limine to active.

  • Preflight on a real Limine install; command-line conversion matches Limine's.
  • Stage, BootNext trial, LUKS unlock, promotion, then finalization on the next boot:
    • Limine packages, ESP files and NVRAM entry gone;
    • firmware fallback replaced;
    • recovery snapshot booting.
  • revert from a half-staged machine restores BootOrder, the command line, fstab and the ESP, and deletes the store.
  • A broken systemd-boot during the trial falls back to Limine (marked trial-failed); re-running the switch then succeeds.
  • Snapshot boot: right root, tmpfs overlay, noresume; changes discarded.
  • Restore from a booted snapshot, with nested subvolumes moved and the swapfile active after.
  • Undo via "Before restore".
  • Single-boot restore when the boot image is unchanged.
  • Cancelling a staged restore.
  • Kernel reinstall through the new pacman hook rebuilds, publishes and verifies.
  • systemd-boot's own entry IDs match the published mapping, and the menu reads "Omarchy", "Snapshot N (description · date)".
  • The switch run a second time, scripted, from a clean 4.5 install. This caught a real bug, now fixed: a timing-dependent SIGPIPE in the boot entry lookup could end staging silently with the new entry left first in BootOrder.
  • Hibernation on systemd-boot:
    • removing and re-setting it up moves the swapfile and rebuilds;
    • hibernate, then resume restores the session;
    • a reboot after a real resume completes, same as on Limine.
  • Factory reset after a full switch, on the encrypted VM:
    • staging put Limine back first in BootOrder and as the fallback loader;
    • systemd-boot's entry, files, boot images and boot store were removed;
    • the factory root booted through Limine, unlocked on its own and started first-boot setup.
  • ./test/shell and test/cli pass: 437 of 438 files; remote-session-service-test fails the same way on clean quattro on this machine, with OMARCHY_PKGS_PATH pointing at the omarchy-pkgs branch so config-test sees the new units. A new boot-cmdline-test.sh, plus updated hibernation, kernel, snapper, plymouth, top-row, deferred-hardware, factory-reset (and a new factory-reset-systemd-boot-test.sh), Snapdragon, Yoga and mkinitcpio-hooks tests.

The Limine path in the same VM still builds its UKIs with the new initramfs hooks.

Also on this branch

  • Every Limine touchpoint ported. Hardware leaves (x86, Snapdragon, the Galaxy Book4 Edge, ZBook Ultra G3a and Raspberry Pi 4), the AMD GPU memory cap, hibernation setup and removal, plymouth-set, keyboard-toprow, provision-hardware and omarchy-kernel go through omarchy-boot-cmdline/omarchy-boot-rebuild. Limine's files stay byte-for-byte the same; only the comment headers in a few drop-ins are gone.
    • Snapper enables limine-snapper-sync only on Limine.
  • Factory reset after switching returns the machine to Limine, which the factory root was installed with:
    • Staging installs Limine from the factory root and gives it a boot entry behind systemd-boot.
    • Once the factory root is at @, Limine goes first and takes the fallback back. systemd-boot's entry, files and boot images go, along with the boot store and any @backup-*/@restore-* roots, which hold the previous owner's system.
    • A reset that fails earlier leaves systemd-boot booting.
    • It refuses while a switch is on trial or a restore waits for its reboot.
  • Menu.
    • System > Snapshots: boot one once.
    • System > Restore This Snapshot: shown while running one.
  • Docs. docs/boot.md (reference), the snapshots manual page for both loaders, docs/file-layout.md, docs/lifecycle-dispatch.md, AGENTS.md.
  • aarch64 groundwork. The switch picks the loader and fallback path for the EFI architecture, images read /etc/kernel/uki.conf (Snapdragon device trees), and rebuilds run the /etc/boot/hooks/pre.d hooks. Preflight still admits x86 only until ARM hardware is tested; N1x needs a fallback image variant first.

Fresh installs and ARM

  • omarchy-boot-switch install puts a machine that never had Limine straight on systemd-boot. The installer runs it in the new root (ISO PR Install UEFI machines with systemd-boot omarchy-iso#489). It creates the store, takes /etc/kernel/cmdline and moves any Limine-format drop-ins to /etc/cmdline.d/, copies the loader, builds and verifies the images, and handles the fallback path and NVRAM entry. --no-efi-register, --no-fallback and --prefer serve the installer.
  • omarchy-boot-backend recognises such a machine by omarchy-boot-systemd's snapper plugin, even where the store isn't mounted.
  • Factory reset of a systemd-boot install runs the same install in the factory clone, into a fresh @omarchy-boot-next store. That store replaces the old owner's at activation, and the old owner's boot images leave the ESP then.
  • First-boot provisioning drops its auto-unlock and rebuilds on either loader.
  • aarch64.
    • The switch admits aarch64 machines other than Apple Silicon, and can run omarchy-boot-switch.
    • N1x writes its parameters through omarchy-boot-cmdline.
    • The DGX Spark's Limine-only workaround (no UKI) is skipped on systemd-boot.
  • In the encrypted VM, the systemd-boot install path (install) booted systemd-boot first with the full command line. The ISO's integration run covered a fresh install and a factory reset of it; see the ISO PR. Not booted on ARM hardware yet.

Not in this PR

  • Turning on Secure Boot. Needs:

    • the Microsoft-signed Omarchy shim;
    • CONFIG_LOCK_DOWN_IN_EFI_SECURE_BOOT in linux-omarchy;
    • module signing for DKMS/NVIDIA;
    • MOK enrollment.

    The boot store already supports a persistent "signing required" policy.

  • Theming systemd-boot's menu. It has 16 text colors and no theme support; it stays stock and hidden. Tokyo Night lives in the picker and the UKI splash.

The design was reviewed twice by Codex (xhigh); both reviews' findings shaped the staging, restore journal and packaging above.

Screenshots

From an encrypted Omarchy VM on Limine, taken through the whole flow.

Switching. The switch's explanation (run as omarchy-boot-switch; nothing prompts for it yet), staging done, then the notice after the trial boot:

omarchy-boot-switch explains the switch and asks
Staging done; the switch offers the trial reboot
After the trial boot: Omarchy started with systemd-boot

Snapshots on systemd-boot. The boot menu (hold Space), a snapshot booted with its notice, System > Snapshots (with Restore This Snapshot at the top while running one), the restore and its notice:

systemd-boot's menu with Omarchy and two snapshot entries
Running snapshot 6, and the switch's finished notice
Searching "snap" from System: the snapshot rows use the wide card
System > Snapshots: Restore This Snapshot on top while running one, then the snapshots to boot
The restore prompt
After the restore: System snapshot 7 restored

Factory reset after the switch. It puts Limine back and the machine boots into first-boot setup:

The factory reset question
The reset staged, with Limine put back
First-boot setup after the reset

Codex review (xhigh)

A Codex review of the three PRs found these, now fixed and checked in the VM:

  • A command line without drop-ins failed to assemble, which stopped image builds on machines without hibernation or quirks (new boot-sync-cmdline-test.sh).
  • A restore was marked done before its entry was published, kept other kernels' images the restored root lacks, and wasn't undone after a power loss mid-swap. The initramfs hook now rolls an interrupted swap back on the next ordinary boot.
  • efibootmgr --create put the new entry first until the order was reset; entries are created with --create-only now.
  • revert was allowed once finishing had started removing Limine.
  • A factory reset deleted the old boot store before the new one took its name; it renames first now.
  • The ESP is found at /efi where an install put it there.

Retesting in the VM then found two more, also fixed: the restore commit's build output hid its result from the confirm service, so no "Snapshot restored" notice was shown, and the login notifier could run before the confirm service had written the notice. Codex also flagged omarchy-boot-switch's snapshot check as matching \t literally; the pattern holds a real tab, and the switch reaches active.

Second Codex review (xhigh)

A second pass over everything since the first review found these, all fixed and checked in the encrypted VM:

  • Restore recovery ran before hibernation resume. The early recovery added after the first review mounted btrfs before the resume hook, on Limine too, which can corrupt a hibernated system's filesystem. It now runs from the root mount handler, after resume, and only on a machine systemd-boot started. In the VM: hibernate and resume work.
  • Recovery decides by the entry that booted. A swap interrupted with @ gone finishes when the boot is on the restored image's own entry (or the same image), and is undone otherwise. A finished swap booted on the old kernel re-arms the restored image's one-shot entry, twice at most. In the VM:
    • @ renamed away mid-swap, then an ordinary boot: the restore finished and committed.
    • The same on another image: the old root came back, with the restore marked failed.
    • An ordinary restore still applies at its maintenance boot.
  • Revert after package removal. Finishing records its first step before the package transaction, so revert can't run once Limine may be gone.
  • Snapshot as the default. With the preferred kernel being removed, the default comes from kernels that still have a current image, not a snapshot's.
  • Factory reset of a systemd-boot install. loader.conf's default stays the old one until the factory root is in place, and the boot stores swap with one atomic exchange (mv --exchange, checked on btrfs subvolumes).
  • Release pipeline. The rc release workflow builds and carries omarchy-boot-systemd with the pair (omarchy-pkgs#3202).

🤖 Generated with Claude Code

dhh and others added 10 commits November 21, 2026 14:39
omarchy-boot-switch moves an x86 install from Limine to systemd-boot in
stages: a boot store on its own btrfs subvolume, the kernel command line out
of Limine's config, boot images built next to Limine, a BootNext trial,
promotion once it boots, and finalization (the Limine packages, files and
entry go, a recovery snapshot comes) once the firmware starts systemd-boot
from its boot order. revert puts Limine back before then.

omarchy-boot-sync builds one UKI per boot image, with the live system and
every snapshot pinned to that image as its profiles, and stages snapshot
restores that the omarchy-restore initramfs hook applies with nothing
running. omarchy-snapshot-overlay replaces btrfs-overlayfs for every install.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01CY6YBjgjqqbJnZaM3wihLS
omarchy-boot-sync prefer PKGBASE makes that kernel's live entry the default
and preferred prints it, for omarchy-kernel.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01CY6YBjgjqqbJnZaM3wihLS
Hardware leaves, hibernation setup and removal, the Plymouth theme, the
keyboard top row, deferred hardware provisioning and the default kernel go
through omarchy-boot-cmdline and omarchy-boot-rebuild, which keep Limine's
files exactly as before and write systemd-boot's where a machine switched.
Snapper enables limine-snapper-sync only for Limine, Direct Boot and factory
reset refuse on systemd-boot, and hibernation removal clears its parameters.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01CY6YBjgjqqbJnZaM3wihLS
System > Snapshots lists systemd-boot's snapshot entries and restarts into
the one picked; System > Restore This Snapshot shows while running one.
Setup > Switch to systemd-boot offers the switch on x86 machines still on
Limine, and Direct Boot and Reset Computer hide after it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01CY6YBjgjqqbJnZaM3wihLS
docs/boot.md covers boot images, the switch's stages and how restores are
applied; the snapshots manual page covers both boot loaders.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01CY6YBjgjqqbJnZaM3wihLS
The switch picks systemd-boot and the firmware fallback path for the EFI
architecture, images read /etc/kernel/uki.conf, where Snapdragon machines
list their device trees, while their profiles don't duplicate them, and
rebuilds run the /etc/boot/hooks/pre.d hooks that refresh that list (Limine's
own hooks excepted). Preflight still admits x86 only until ARM hardware is
tested.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01CY6YBjgjqqbJnZaM3wihLS
Finding the new boot entry stopped reading efibootmgr at the first match,
which could kill it with SIGPIPE and, under pipefail, end the switch silently
right after the firmware put that entry first. A rerun then kept that order.
The lookup reads to the end, and staging always restores the boot order the
machine had before the switch. Other early-closing pipes read to the end too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01CY6YBjgjqqbJnZaM3wihLS
The Snapdragon, Yoga Slim 7x and Zenbook A16 setups keep their Limine
drop-ins and gain the systemd-boot form for when ARM machines can switch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01CY6YBjgjqqbJnZaM3wihLS
The AMD GPU memory cap and the ZBook Ultra G3a, Galaxy Book4 Edge and
Raspberry Pi 4 setups write their kernel parameters through
omarchy-boot-cmdline. The switch's offer runs after every migration that
still rebuilds through Limine, and Direct Boot, which quattro removed, no
longer blocks the switch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01CY6YBjgjqqbJnZaM3wihLS
The factory root was installed with Limine, so the reset puts Limine's
binary and boot entry back from it, keeps systemd-boot first until the
factory root is at @, then hands the boot order and fallback loader to
Limine and removes systemd-boot's entry, files and boot store, and the
roots snapshot restores replaced. A switch still on trial or a restore
waiting for its reboot is turned away.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01CY6YBjgjqqbJnZaM3wihLS
@greptile-apps

greptile-apps Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The latest change appears safe to merge and preserves the user's chosen snapshot boot.RetriggerView in GreptileConfidence Score: 5/5

[Critical impact] The latest change appears safe to merge and preserves the user's chosen snapshot boot.

Summary

This PR adds systemd-boot, snapshot boot entries, and snapshot restore support. The latest change keeps a pending restore from replacing a snapshot the user chose for the next boot.

  • UEFI installs can use systemd-boot with bootable kernel images.
  • Snapshots can boot once or replace the running system.
  • Factory reset restores the boot setup that belongs to the factory system.
  • Hardware and system tools can update boot settings through either loader.

Reviews (26) · Last reviewed commit: "Re-arm only a stale maintenance boot, no..." · Reviewed by Greptile

Comment thread bin/omarchy-boot-sync Resolved
Comment thread bin/omarchy-boot-switch Resolved
Comment thread bin/omarchy-boot-sync Resolved
Comment thread bin/omarchy-boot-backend Resolved
Comment thread manual/47-system-snapshots.md Resolved
Comment thread bin/omarchy-boot-notify Resolved
Comment thread bin/omarchy-boot-switch Resolved
Comment thread bin/omarchy-boot-switch Resolved
dhh and others added 3 commits November 21, 2026 16:15
omarchy-boot-switch install puts a machine that never had Limine
straight on systemd-boot: the boot store, the command line (moving any
parameters written in Limine's format), the loader, verified boot
images, the fallback loader and a first boot entry. The installer runs
it in the new root, and a factory reset of a root installed that way
runs it in the factory clone, into a fresh boot store that replaces the
old owner's once the clone is at @. omarchy-boot-backend recognises
such a machine by omarchy-boot-systemd's pacman hook, and dropping the
first-boot auto-unlock rebuilds on either loader.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01CY6YBjgjqqbJnZaM3wihLS
The switch admits aarch64 machines other than Apple Silicon and the Setup
menu offers it there; the update keeps offering it only on x86, where it
has been run on real machines. N1x writes its kernel parameters through
omarchy-boot-cmdline, and the DGX Spark's Limine workaround of booting
without a UKI applies only to Limine.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01CY6YBjgjqqbJnZaM3wihLS
Comment thread bin/omarchy-system-factory-reset Resolved
Comment thread bin/omarchy-boot-switch Resolved
/run is a shared mount, so a bind of the next root onto itself joined
its peer group, and the proc, sys, dev and run binds for the chroot
propagated onto the subvolume itself, which then could not be renamed
to @. omarchy-boot-switch install checks for btrfs with stat, which
needs no mount at /, and the swapfile the reset recreates in the next
root is switched off again, as it keeps its subvolume busy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01CY6YBjgjqqbJnZaM3wihLS
The restore after a failed rebuild writes the unlock drop-in itself, in
Limine's or systemd-boot's format, and the re-key journal test loads
the rebuild helpers it now goes through.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01CY6YBjgjqqbJnZaM3wihLS
From a Codex review:
- A command line without drop-ins no longer fails to assemble, which
  stopped image builds on machines without hibernation or quirks.
- A restore is published before its journal says done, so a power loss
  or failed publish retries at the next boot; images of kernels the
  restored root lacks at that version are dropped.
- A normal boot after a power loss mid-swap puts the replaced root back
  before mounting @, instead of failing to find it.
- New boot entries are created out of the boot order, so no power loss
  can leave an untested loader first.
- Revert refuses once finishing has started removing Limine.
- A factory reset renames the old boot store aside before the new one
  takes its name, so the factory root always finds one.
- The ESP is found at /efi where an install put it there.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01CY6YBjgjqqbJnZaM3wihLS
Comment thread bin/omarchy-boot-sync Resolved
dhh and others added 2 commits November 21, 2026 18:07
The restore commit printed the boot images' build output ahead of its
result, so the confirm service never saw "restored:" and set no
notice, and published the restore's own entries once more after the
journal was done. Publishing reports on stderr and runs again after
the commit. The login notifier waits for the confirm service, which a
user unit can't be ordered after, so it reads this boot's notice.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01CY6YBjgjqqbJnZaM3wihLS
Comment thread bin/omarchy-boot-switch Resolved
@dhh
dhh requested a review from ryanrhughes November 21, 2026 17:59
dhh and others added 2 commits November 21, 2026 19:00
- Boot notices are i18n keys rendered in the user's language by the
  login notifier, and the snapshot-boot notice reads from the catalog.
- A promoted switch keeps Limine's images current: it is still the
  fallback until the switch finishes.
- omarchy-snapshot create fails unless the new root snapshot has a boot
  entry, so an update only goes ahead once its rollback point boots.
- A committed restore removes the restore's hibernation block, which an
  undo would otherwise bring back.
- A factory reset publishes the kernels of the root it builds, not the
  old one still at @.
- The boot commands get a CLI group description, literals in [[ ]]
  comparisons are quoted, the manual describes factory reset after the
  switch, and the reset test runs the real cleanup trap.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…windows

From a second Codex review:
- The early restore recovery mounted btrfs in run_hook, before the
  resume hook, which can corrupt a hibernated system's filesystem, on
  Limine too. It now runs from the root mount handler, after resume,
  and only on a machine systemd-boot started.
- Recovery decides by the entry that booted: a swap interrupted on the
  restored image's own entry (or the same image) finishes, otherwise it
  is undone, and a finished swap booted on the old kernel re-arms the
  restored image's one-shot entry, twice at most.
- Finishing the switch records its first step before the package
  transaction, so revert can't run once Limine may be gone.
- With the preferred kernel being removed, the default comes from the
  kernels that still have a current image, not a snapshot's.
- A factory reset of a systemd-boot install leaves loader.conf's
  default alone until the factory root is in place, then writes it,
  and swaps the boot stores with one atomic exchange.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Comment thread bin/omarchy-boot-sync Resolved
dhh and others added 10 commits November 25, 2026 17:46
A boot image embeds the device trees uki.conf names and the hardware IDs
systemd-stub picks one by. A dtbs package's upgrade without a kernel change
left the image as it was.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ge cases

- The kernel removal hook runs after the transaction. A kernel upgrade
  removes the old version's vmlinuz too, and the pre-transaction hook
  dropped the live image (and its UKI) before the new one was built; a
  failed build or a power loss then left no live entry. The sync now drops
  the current image of a kernel that is no longer installed, under the
  lock, which also covers a preferred kernel removed while a switch is on
  trial (loader.conf pointed at an image the sync had just deleted).
- A pending restore's journal follows the restored root's entry id, which
  changes when the snapshots on its image do.
- Snapshot profiles come from the live root's snapshots, so a factory reset
  doesn't list the old owner's.
- The sync and verify refuse an ESP that isn't mounted; the units order
  after /efi too.
- Cancelling a restore from a booted snapshot also lifts the hibernation
  block in @; the resume_offset check matches whole parameters; a derived
  image's manifest takes the command line verbatim.
- root_kernels no longer fails on a root without kernels.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- revert takes nothing off the ESP when staging stopped before backing
  it up: what is there then is another installation's systemd-boot.
- The finish replaces the fallback loader only when it is Limine's, by
  the binary rather than a hash taken at staging, so another system's
  stays and an upgraded Limine is still replaced.
- A finish that finds no package records no step, so revert still works,
  and omarchy-boot-switch fetches the package again while promoted, as the
  notice says. A missing package no longer aborts before the notice.
- Promoting the trial sets a boot order without a trailing comma when
  nothing else is in it.
- The ESP space check counts the installed kernels.
- A missing /etc/default/limine reads as no command line; limine is kept
  when anything requires it, in any locale.
- The machine id is read through a seam the tests use.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Returning a switched machine to Limine, the factory root's
  limine-install makes Limine the fallback loader whatever was there.
  The copy of the ESP taken before the reset now decides: a fallback that
  was systemd-boot's stays Limine's (and its recursive menu entry goes),
  another system's is put back. The test's limine-install stub now writes
  the fallback as the real one does.
- First-boot provisioning on systemd-boot no longer rebuilds Limine
  entries in a limine.conf that belongs to another installation on a
  shared ESP (and no longer fails on the missing limine-update).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- omarchy snapshot create needs no systemd-boot entry until the switch
  finishes: nothing pins snapshots to boot images before then, so an
  update between the trial boot and the finish no longer fails.
- omarchy-kernel set reaches both loaders while a switch is under way.
- omarchy-boot-notify waits for omarchy-boot-confirm while its start is
  still queued, not only while it runs, so a quick login gets this boot's
  notice. /proc/cmdline is read through a seam, so the test doesn't depend
  on how the machine running it booted.
- omarchy-boot-cmdline get reads a drop-in of only comments as empty
  instead of failing.
- The menu's Snapshots provider runs nothing on Limine, where
  omarchy-snapshot list asks sudo with no terminal, and search skips
  provider menus their guard hides.
- The initramfs hooks find /new_root on mkinitcpio before 41, which has no
  /sysroot.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
systemd-stub drew Omarchy's logo on black while the kernel loaded, a
screen Limine never showed, before Plymouth's own unlock screen. Boot
images carry no splash now, and a store's old splash.bmp goes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The splash never entered a published image's key (the key was taken
before the first build made splash.bmp), so dropping it left existing
images as they were. A new format rebuilds each one once.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
quattro dropped image-deferred-hardware-test.sh in its test trimming; the
copy this branch kept for its cmdline.d case had gone stale against
quattro's batched hardware setup, so it goes here too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Comment thread bin/omarchy-boot-switch Resolved
Comment thread bin/omarchy-boot-sync Resolved
Comment thread bin/omarchy-system-factory-reset Resolved
- The switch copied the root's fstab options to the boot store, subvolid=
  included, which selects the root whatever subvol= says.
- Image cleanup kept a pending restore's image but not the live one it
  replaces, which the commit records as "Before restore".
- Factory reset deleted another installation's systemd-boot on a shared
  ESP; it now puts back what the switch saved and keeps its boot entry.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Comment thread bin/omarchy-boot-switch Resolved
dhh and others added 2 commits November 25, 2026 22:40
The rewrite moves into store_fstab_entry so the subvolid= fix has a test
that fails on the old rewrite.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A rebuild of the live image before the reboot moved the maintenance
profile to the new image while the firmware's one-shot boot still named
the old one. The sync re-arms it, as it already updates the journal's
restored entry.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Comment thread bin/omarchy-boot-sync Resolved
@omarchybot
omarchybot merged commit c3108ac into quattro Nov 25, 2026
6 checks passed
@omarchybot
omarchybot deleted the systemd-boot-2 branch November 25, 2026 21:51
cursor Bot pushed a commit to mark-groves/omarchy that referenced this pull request Nov 25, 2026
Omarchy can now boot through systemd-boot as well as Limine. systemd-boot machines publish one unified kernel image per kernel, built on the machine, with each recent snapshot as a profile of it, so snapshots stay bootable from the (hidden) menu. Snapshot restore swaps a snapshot in as @ from a maintenance boot, keeps the replaced root as "Before restore", and factory reset works on both loaders.

Commands go through a loader-neutral layer (omarchy-boot-backend, omarchy-boot-cmdline, omarchy-boot-rebuild) instead of writing Limine config directly. New UEFI installs get systemd-boot from the installer once omarchy-boot-systemd is published; existing Limine machines stay as they are, with omarchy-boot-switch as a quiet, revertible way to move over. BIOS stays on Limine. docs/boot.md describes the design.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
trukhinyuri added a commit to trukhinyuri/omarchy that referenced this pull request Nov 30, 2026
…cmp guard

Switch migrations/1793143637.sh to omarchy-boot-cmdline and
omarchy-boot-rebuild so it works on both Limine and systemd-boot (omacom#19667),
and defer with exit 75 when removing power_wrap_drv.usb4_release=0 on a
machine whose linux-omarchy package is older than 7.3-3.
@emirb emirb added this to the 4.6.0 milestone Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants