Repository navigation
Conversation
Co-authored-by: JustNak <[email protected]>
Co-authored-by: JustNak <[email protected]>
There was a problem hiding this comment.
Pull request overview
Extends hibernation removal to clean stale Limine resume configuration safely.
Changes:
- Removes resume and RTC alarm drop-ins before rebuilding initramfs.
- Adds coverage for full, partial, and absent configurations.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
bin/omarchy-hibernation-remove |
Removes Limine resume drop-ins while preserving the suspend hook. |
test/shell.d/hibernation-remove-test.sh |
Tests removal behavior and rebuild ordering. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
|
Reviewed at 91bd9c3 against The bug is real. On a worker built from the Omarchy ISO, I ran my own harness against The half-removed case matters most. Anyone who already ran Related: this fixes #10037, #10374 and #12096. All three report the same leftover No second opinion. The configured reviewer (Codex Medium) did not run: its daily review budget was spent when this item came up. That is why this PR is not labelled |
|
The second opinion has now run. Codex Medium reviewed this head (91bd9c3) against Re-run on a worker. I merged this head with current The open question is This waits on the maintainer for that call. It is not labelled |
`omarchy-hibernation-remove` deletes `/etc/limine-entry-tool.d/rtc-alarm.conf` when that file is the only marker. It then runs `limine-mkinitcpio`. Setup writes that file only when it is missing. Factory-reset leaves it. A machine with only the RTC alarm is not hibernation.
The presence check treated `/etc/limine-entry-tool.d/rtc-alarm.conf` as hibernation. Setup writes that file only when it is missing, and factory-reset leaves it. `omarchy-hibernation-remove` now enters for the resume hook or `resume.conf`. It deletes `resume.conf` before `limine-mkinitcpio`.
[Medium impact] The PR appears safe to merge; the previous retry failure is fixed. SummaryRemoves stale hibernation settings before rebuilding the boot image.
Reviews (5) · Last reviewed commit: "Write the resume hook only after the off..." · Reviewed by Greptile |
`omarchy-hibernation-remove` still runs `limine-mkinitcpio` and prints "Hibernation removed" when `rm` cannot delete `resume.conf`. The rebuilt UKI then keeps `resume=` and `resume_offset=`.
A failed `rm` of `/etc/limine-entry-tool.d/resume.conf` fell through to `limine-mkinitcpio`. The rebuild kept `resume=` and `resume_offset=`, and the script printed "Hibernation removed". The command now exits before that rebuild.
|
Re-reviewed at c6b0494 against
A failed deletion now stops the script. Tests on a worker. I merged this head with current Second opinion. Codex Medium reviewed both pushes and found no defect in them. Independence is not guaranteed, because it can read my notes. It raised three points:
This waits on the maintainer. It is not labelled |
`chmod a-w` does not stop `rm` when the suite runs as root. The shell test then deletes `resume.conf` and fails its own assertion. The failure case now stubs `rm` for that path.
|
Re-reviewed at b1a66d2 against The test now works as root too. The old version made the drop-in directory read-only, and root ignores that. The new version puts a stub Tests on a worker. I merged this head with current Second opinion. Codex Medium reviewed the new commit and the whole PR and found no defect. Independence is not guaranteed, because it can read my notes. It also confirmed that the failure path is reached whichever user runs the test. This waits on the maintainer. It is not labelled |
Setup only wrote the resume drop-in when it was missing, so a drop-in an earlier remove left behind kept the deleted swapfile's resume_offset and resume read the wrong place. When the offset cannot be found, a stale drop-in is dropped rather than kept. From omacom#13584. Co-Authored-By: Daniel Moore <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
The test now runs the real remove for a full setup and for a machine an older remove left with only resume.conf, and checks the drop-in is gone before the boot image is rebuilt. The source grep, the no-op cases and the stubbed rm failure tested nothing the base branch gets wrong, which AGENTS.md asks tests not to do. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Re-reviewed against current What I pushed.
Tests on a worker built from the Omarchy ISO, at 6a36eca.
This head is labelled Second opinion. Codex Medium and muse-wonder (via pi, thinking high) reviewed this head. Codex found no defect. Independence is not guaranteed, because both can read my notes. Muse-wonder raised points I had not weighed. None of them is introduced by this PR, so I have not changed anything for them:
Still open for the maintainer.
@JustNak, the description's "What changed" and "Tests" sections no longer match the branch: setup now changes too, and the test file has one case. It would help to update them. This waits on the maintainer. It is not labelled |
A failed map-swapfile lookup wrote the hook, deleted resume.conf and rebuilt without resume parameters. Every later run then took the already-set-up branch and never wrote the drop-in. Look the offset up first, stop with an error if it is empty, and write resume.conf before the hook so setup stays retryable.
|
Re-reviewed at 88fa1eb against current What it fixes. Before, if the offset lookup failed during a first setup, setup still wrote the resume hook. The hook is what makes a later run report "Hibernation is already set up", so setup never came back to write the resume parameters. Now setup looks up the offset first and stops with an error if it is empty. It writes Who else is affected.
Tests on a worker built from the Omarchy ISO, at 88fa1eb.
This head is labelled Second opinion. Codex Medium and muse-wonder (via pi, thinking high) reviewed this commit. Neither found a defect. They agree with my reading of both callers, and that the new test exercises the script rather than its stubs. Independence is not guaranteed, because both can read my notes. Still open for the maintainer, unchanged from my last comment:
This waits on the maintainer. It is not labelled |
|
Duplicate resolved: I closed #13768 as superseded by this one. Same fix for #13583, and this branch covers three cases mine did not — a stale No action requested, just so the three duplicates against #13583 can be triaged without mine in the list. |
|
An "already configured but not actually configured" machine on the current release, for the case this PR's early-exit change covers. MacBookPro11,5, Omarchy 4.5.0-3,
Running the installed That is the second bullet on this PR's remove side — repairing the drop-in when the hook is gone — and the reason I closed #13768 in favour of this one. Recording it so the state has a real-release reproducer rather than only a constructed one. |
|
Thanks for the real-machine repro. That state (hook present, |
…20000) * Clean up stale hibernation resume drop-ins and keep setup retryable Extracted from #8199 and #13584 on top of #19969. Co-authored-by: JustNak <[email protected]> Co-authored-by: Daniel Moore <[email protected]> * Keep hibernation removal retryable when only rebuild marker remains * Guard empty resume device, keep failed lookups non-fatal, and clean partial setups Co-authored-by: JustNak <[email protected]> Co-authored-by: Daniel Moore <[email protected]> * Keep resume.conf removal in factory reset so failed lookup leaves no stale offset Co-authored-by: JustNak <[email protected]> Co-authored-by: Daniel Moore <[email protected]> --------- Co-authored-by: JustNak <[email protected]> Co-authored-by: Daniel Moore <[email protected]>
…macom#20000) * Clean up stale hibernation resume drop-ins and keep setup retryable Extracted from omacom#8199 and omacom#13584 on top of omacom#19969. Co-authored-by: JustNak <[email protected]> Co-authored-by: Daniel Moore <[email protected]> * Keep hibernation removal retryable when only rebuild marker remains * Guard empty resume device, keep failed lookups non-fatal, and clean partial setups Co-authored-by: JustNak <[email protected]> Co-authored-by: Daniel Moore <[email protected]> * Keep resume.conf removal in factory reset so failed lookup leaves no stale offset Co-authored-by: JustNak <[email protected]> Co-authored-by: Daniel Moore <[email protected]> --------- Co-authored-by: JustNak <[email protected]> Co-authored-by: Daniel Moore <[email protected]>
omarchy-hibernation-removesays it removes swap and boot resume settings. It deletes the swapfile and/etc/mkinitcpio.conf.d/omarchy_resume.conf, then runslimine-mkinitcpio. It never deletes/etc/limine-entry-tool.d/resume.conf. That drop-in is what setup writes forresume=andresume_offset=, and it is whatlimine-mkinitcpiobakes into the UKI. After remove, the swapfile is gone and the next UKI still tries to resume from it.Setup did not repair this. It only wrote
resume.confwhen the file was absent, so a leftover file kept the old offset (#13583). Factory-reset already deletesresume.confwhen the swapfile is gone for exactly that reason: a surviving offset drop-in "bakes the old swapfile's offset into the rebuilt UKI and breaks resume."What changed
Remove:
resume.confbeforelimine-mkinitcpio, so the rebuilt UKI has noresume=and noresume_offset=.resume.confstill there. It deletes the file and rebuilds instead of stopping at "Hibernation is not set up".resume.confcannot be deleted./etc/limine-entry-tool.d/rtc-alarm.confand/usr/lib/systemd/system-sleep/keyboard-backlightalone.rtc-alarm.confon its own does not count as hibernation being set up.Setup:
resume.conffrom the current swapfile, instead of keeping a leftover one. This is the setup half of Remove resume kernel parameters when removing hibernation #13584, by @STRd6.btrfs inspect-internal map-swapfilereturns nothing, setup exits 1 without writing the hook, touchingresume.confor rebuilding. It writesresume.confbefore the hook. Before, a failed lookup still wrote the hook and rebuilt without resume parameters, and every later run said "Hibernation is already set up" with no drop-in. Now the next run tries again.Not covered here:
resume.confis not repaired. Setup still takes its "already set up" branch there. That is hibernation setup cannot repair a half-configured state, and --force does not bypass the early exit #7619.resume=cached in/boot/<machine-id>/limine_history/snapshots.jsonfor Snapper snapshot entries. This PR does not touch that.Tests
With the setup script from 6a36eca in place, the new case fails:
Other tests at 88fa1eb:
hibernation-available-test.sh9/9,mkinitcpio-hooks-test.sh43/43,factory-reset-dispatch-test.sh12/12,factory-reset-elevation-test.sh9/9,factory-reset-limine-test.sh15/15 andfactory-reset-prompt-test.sh1/1 pass.factory-reset-accounts-test.shfails "normal reset stages successfully" on my machine, and it fails the same way on plainquattro(7eedd17).Fixes #10037
Fixes #10374
Fixes #12096
Fixes #13583