Repository navigation
Integrate snapshot, snapper, and update-space fixes - #21027
chessing234 wants to merge 14 commits into
Conversation
install/config/snapper.sh called snapper unconditionally, so on aarch64 (where snapper is only a dependency on x86_64) 'omarchy apply system --first-install' aborted with exit 127 before enable-services.sh, firewall.sh, install/login and post-install ever ran. On ext4/xfs roots it also installed a config claiming FSTYPE=btrfs and enabled a cleanup timer that then failed daily. The step now exits 0 with a reason line when snapper is not installed or the root filesystem is not btrfs, matching the guard pattern migration 1784809452 already uses. Fixes omacom#19666, fixes omacom#6683.
omarchy-snapshot create printed 'Snapshots can be selected during boot.' without ever running limine-snapper-sync, so a mismatched /etc/default/limine left the snapshot out of the boot menu while every omarchy-update reported the safety net as present (omacom#16498). Run the sync after creating the snapshots and warn, pointing at its journal entries, when it fails; the snapshot itself still exists, so this warns without failing the update.
df's free space on btrfs can sit entirely inside partly-used data chunks, where metadata chunks cannot go. When the device is fully allocated and metadata headroom is nearly gone, an update dies with ENOSPC while df still shows gigabytes free, and the pre-update guard never noticed because it reads only df. Read the chunk accounting from btrfs and stop with the balance remedy once unallocated device space and metadata headroom are both nearly gone. Fixes omacom#15528
Read each path from the restore journal without splitting on spaces. Use the same reader when rolling back an interrupted restore so a moved child goes back to the original root. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
…shot omarchy-update-stay-awake refuses an OMARCHY_PATH that does not name its install, so an update from a shell without the session environment pruned the package cache and took a snapshot before aborting. Run the same check on omarchy-update itself before any step. Refs omacom#19343
Confidence Score: 5/5
[High impact] The latest changes appear safe to merge, with all four previous findings addressed. SummaryThis PR joins fixes across snapshot creation, boot entries, restores, migration records, and update-space checks.
|
|
Thanks for bringing the snapshot and update fixes together, @chessing234. Would you be willing to take responsibility for keeping my nested-subvolume restore fix (#20876) current with Before I’d support handing off upkeep to the combined branches, I’d like the outstanding Greptile findings on both PRs fixed or answered with evidence. Two examples are Btrfs allocation accounting here and the queued battery warning in #21013. |
|
Thanks for folding this in, @chessing234. The OMARCHY_PATH check and its test in #21027 match #19389 line for line, and my commit is kept as is. I'm happy for #19389 to be closed as superseded once #21027 is merged. Until then I'll leave it open, since it's verified on its own. |
|
Codex High classified this as a bug fix after reading the diff against |
|
ready for a look @dhh @ryanrhughes |
|
Thanks for the time you put into this. Some of the fixes you added on top catch real bugs in the original PRs. I'm closing it anyway, along with the other Integrate PRs. Each bundle puts several people's work in one branch. We can't review it one change at a time or revert a single piece. Merging it would also leave every original PR open. That's why our PR template asks for one problem per PR. None of the bundles ran on an Omarchy install either. Please post each fix on the PR it belongs to, so its author can pick it up. If two PRs conflict, a comment on the later one helps us most. A small fix of your own, tested on a real install, is always welcome. Smaller and proven gets merged. Thanks! |
Why this is one review
These ten open PRs all change the path from "an update takes a snapshot" through "that snapshot can actually boot" and "a restore does not lose migrations or nested subvolumes." Reviewed apart, they conflict in
bin/omarchy-snapshot,bin/omarchy-update-requires-free-space,install/config/snapper.sh, and the shell tests around them. Each one is a real failure mode (a regular.snapshotsdirectory, a snapshot boot that looks like a full disk, metadata ENOSPC whiledfstill shows space, a Limine sync that rejects the entry, snapper missing on aarch64, pins left behind after snapper deletes a snapshot, nested subvolumes flattened on restore, migrations not rerun after a restore, and an update that prunes the cache before it noticesOMARCHY_PATHis wrong). Together they are one snapshot/update story.Incorporated PRs
Authorship is the original commits, cherry-picked onto current
quattro. Nothing here squashes another author's work onto this branch's owner.omarchy-snapshot createexplains a.snapshotsdirectory that is not a btrfs subvolume, and still prints the snapper number (-p) so the systemd-boot boot-entry check can see it. Cleanup does not run after a failed create.update.needsFreeSpace. When/is mounted from.snapshots/*/snapshot, it also says to reboot into the regular entry. No new i18n key.snapperis missing or/is not btrfs. systemd-boot still enables cleanup withoutlimine-snapper-sync.limine-snapper-syncand only says the snapshot is bootable when that sync accepts it. A rejected sync warns and does not fail the update. systemd-boot still requires the new boot entry before the update continues.dflooks fine.omarchy-updatechecksOMARCHY_PATHbefore it prunes the package cache or takes a snapshot.How the overlaps were resolved
quattroand the directory recovery text from Explain snapshot failures caused by regular directories #11287. stderr is a temp file so-pstill lands inroot_number.findmntforOPTIONS,FSTYPE, andSOURCEso those cases do not clobber each other. Default fstype stays ext4 so the olderdfcases do not enter the btrfs branch.omarchy-boot-syncand thesnapshot-Nentry. The Limine test stubsomarchy-cmd-missing,omarchy-boot-backend, andomarchy-version, which currentomarchy-snapshotcalls before the sync.OMARCHY_PATHcase.Testing
On macOS, with GNU bash 5.3 (system bash 3.2 has no
mapfile):test/shell.d/snapshot-create-test.sh: pass, including the directory explanation, the systemd-boot boot entry, and the quiet 127 when snapper is absent.test/shell.d/snapper-test.sh: pass, including Limine sync success and the warning when the sync rejects the entry, the missing snapper binary, and a non-btrfs root.test/shell.d/migrate-scope-test.sh: the migration runner cases pass. The last case dies on BSDfind(-printf), which this machine does not have.test/shell.d/update-disk-space-test.sh: the helper's own low-space exit passes. The update-wrapper cases stop on BSDreadlink(-e), which Check OMARCHY_PATH before an update prunes the cache and takes a snapshot #19389 uses and GNUreadlinkprovides on Omarchy.test/shell.d/update-sequence-test.shandtest/shell.d/boot-sync-test.sh: the harness hits BSDsedand missingflockbefore the new assertions.test/shell.d/boot-restore-commit-test.sh: the snapshot-boot wait passes. The commit case dies indate '+%b %-d'(%-dis GNU date). Nested-subvolume assertions sit after that.Those gaps are this machine, not dropped behavior. I did not run this on an Omarchy install (no btrfs root, no Limine, no snapper here).
Closure of the original PRs is the maintainers' call, after this is accepted.
Made with Cursor