Repository navigation
Check Mac snapshot restores against the boot files outside the snapshot - #560
Merged
Merged
Conversation
…atch The kernel and initramfs on /boot, and m1n1, the device trees and U-Boot on the ESP, stay outside every snapshot. omarchy-mac-snapshot-check runs as limine-snapper-sync's pre hook: a Limine Mac restores only the snapshot it booted, and only when that root passes the boot check. Given a snapshot root, it checks the root carries the kernel on /boot, for the GRUB-era swap.
omarchy-mac-boot depends on limine-snapper-sync, so a Mac that still boots GRUB has limine-snapper-restore installed and was sent to it. Route Macs by the boot loader instead; x86 keeps its routing. The swap now refuses a Limine Mac, and on a GRUB Mac refuses a snapshot without the kernel on /boot.
The staging check followed each staged /etc path to its target, so the pre hook linked to /usr/bin read as unshipped wherever omarchy-mac-boot is not installed.
The full boot check also holds LUKS keyslots, provisioning leftovers and package file drift, none of which a restored root's next boot reads, so it refused restores on healthy Macs. The restore hook now runs --boot-chain, still with no reboot pending.
limine-snapper-restore's own list can restore a snapshot other than the booted one the pre hook checked. A post hook now checks the restored @ holds the booted root's kernel, device trees, m1n1, U-Boot and Limine, and that the UKI the restore put back carries that kernel; otherwise it keeps the reboot from being offered and says how to put the backup back. Also name Limine among a refused snapshot's packages, read --restore-kernels snapshots off the top level, refuse when the platform cannot be told, and stop waiting for Enter after five minutes.
A snapshot from before Limine reads as a GRUB Mac from inside, so its boot went to the subvolume swap, which cannot run there. Limine's restore hook says why it cannot be restored.
…apshot-restore # Conflicts: # docs/lifecycle-dispatch.md
After a mismatched snapshot is restored from limine-snapper-restore's list, the ESP holds its UKI, so the pre hook refused the restore the post hook told the owner to run. The post hook now leaves the backup to pick in /run, and the pre hook lets that restore through for the post hook to check. The post hook also compares crypttab and the root mount, names the backup by when it was written, says to ignore the reboot prompt that follows, and refuses when the platform detector does not give a clear answer.
…n a mismatch The post hook passed a root from before the Limine activation picked from the restore's list; it now requires the activation and the same ESP, as the pre hook does for a booted root. A root it cannot read or a platform it cannot tell is reported unchecked and no longer arms the undo, and the undo applies only while the booted root fails its own check, so a leftover marker skips nothing. Locks count only when root owns them, and the subvolume swap refuses a Mac's snapshot boot with why. The top-level mountpoint's parent can be set for tests, which now run the mount and unmount.
…snapshot-boot refusal plainly The post hook now asks what omarchy-mac-limine-active asks of a root: limine-update as well as the activation marker and defaults. A snapshot boot refused by the subvolume swap may be a GRUB Mac's too, so the refusal no longer says it predates Limine.
This was referenced Sep 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ticket 36 of the Apple Silicon convergence plan: snapshot boot and restore with boot-coherence checks.
Uses #543's
omarchy-apple-silicon-boot-check --boot-chain, which is now on quattro-upstream. Current quattro-upstream is merged in.What changed
Limine Macs keep the x86 path: limine-snapper-sync writes the snapshot entries, you boot a snapshot from the Limine menu, and
omarchy-snapshot restorerunslimine-snapper-restore.omarchy-mac-bootaddsomarchy-mac-snapshot-check, linked into limine-snapper-sync's hooks. It only acts on a restore on a Mac:pre.d/04-omarchy-mac-snapshot-check). Exit 100 stops the restore before anything changes. It refuses:--boot-chainagainst the live/bootand system ESP, with no reboot pending (the kernel Limine saved with the snapshot is the one the restore puts back). The message gives the reason, why boot files aren't in snapshots, and the snapshot's kernel, m1n1, U-Boot and Limine package versions to install first if you want that snapshot anyway.--restore-kernels <id>for a snapshot that doesn't carry the kernel on/boot. The snapshot is read off a read-only top-level mount in a snapshot boot.omarchy-snapshot restore. It sorts before the activation gate so that message shows.post.d/99-omarchy-mac-snapshot-check). limine-snapper-restore's own list can put back a snapshot other than the booted one. After a finished restore, the restored@must carry the Limine activation, tooling and ESP, and hold the booted root's kernel, device trees, m1n1, U-Boot, Limine, crypttab and root mount. The UKI the restore put on the ESP must carry that kernel./run), naming the backup only if it still exists. The post hook checks the undo's result and clears the marker on a match.limine-snapper-restoreinstalled (omarchy-mac-boot depends on it) and were sent there.omarchy-snapshotnow routes a Mac that doesn't boot Limine to the subvolume swap. A snapshot boot counts as Limine. The swap refuses a Limine Mac and a Mac's snapshot boot, and on a GRUB Mac it refuses a snapshot without the kernel on/boot. x86 routing and--rehearseare unchanged. mx-mac'somarchy-mac-snapshot-*tools already refuse or no-op on Limine Macs and aren't ported.docs/lifecycle-dispatch.md. Restore isn't a dispatch operation, so theboot-rebuildrow no longer names this ticket.Limits:
omarchy-mac-boot, so snapshots taken before this package restore unchecked. The manual says so, and tickets 43/45 decide whether conversion prunes them.Testing
packages/omarchy-mac/boot/test/snapshot-check-test.shruns both hooks on Post-update boot verification blocks update completion and the reboot #543's fixture Limine Mac with the real boot check, and checks the fixture is unchanged and nothing is left mounted. It covers:--restore-kernels, including the top-level readtest/shell.d/snapshot-restore-mac-test.shrunsomarchy-snapshot restoreon platform fixtures. Alimine-snapper-restorestand-in runs pre hooks, the restore (the booted snapshot or one picked from the list) and post hooks. It covers:51 seeded regressions were all caught over five rounds. They cover the hooks, routing, the list path, the undo and its gating, the UKI, Limine-activation, crypttab and fstab checks, the package list, the top-level mount, detector errors, backup naming and link order.
Shellcheck: nothing new in the scripts beyond an SC2001 note on a multi-line indent.
Arch Linux ARM container, non-root:
packages/omarchy-mac/boot/test/allpasses. Runtime./test/all: 7 of 334 files fail, all of them on plain quattro-upstream in the same container too (no omarchy-pkgs checkout, host detection).Converged M2, read-only, before its current reinstall. The hooks were copied to
/tmp; the btrfs top level and ESP were mounted read-only and then removed. Results:--boot-chain--restore-kernels 1passesThat run found the installed Omarchy lacks
omarchy-hw-platform, so the hook falls back toomarchy-hw-apple-siliconthere.Not done: VM acceptance of booting and restoring a snapshot. That needs tickets 23 and 28. Steps:
omarchy-snapshot createand checklimine-snapper-listshows it.omarchy-snapshot restore, and expect "matches". After the reboot, the root is restored andomarchy-apple-silicon-boot-check --boot-chainpasses.linux-aurorabuild and reboot. Boot the earlier snapshot and restore. Expect a refusal naming/boot/vmlinuz-linux-aurora, with the root unchanged.lin the restore and pick a snapshot from before that update. Expect "Do not reboot yet" and no reboot offer.Second review: clean after five rounds. Fixed along the way: