Skip to content

Clean up stale hibernation resume drop-ins and keep setup retryable - #20000

Merged
dhh merged 4 commits into
quattrofrom
extract/hibernation-stale-resume-cleanup
Nov 24, 2026
Merged

dhh merged 4 commits into
quattrofrom
extract/hibernation-stale-resume-cleanup

Conversation

@dhh

@dhh dhh commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Extracted from #8199 by @JustNak and #13584 by @STRd6 on top of #19969.

  • Treat a leftover /etc/limine-entry-tool.d/resume.conf, pending rebuild marker, swapfile, or swapfile /etc/fstab entry as configured in bin/omarchy-hibernation-remove so half-removed or partially set-up machines can be cleaned up cleanly, abort before limine-mkinitcpio if deleting the hook or drop-in fails, and skip limine-mkinitcpio when no boot config files were present.
  • Always rewrite /etc/limine-entry-tool.d/resume.conf during fresh bin/omarchy-hibernation-setup runs so a stale drop-in cannot pin hibernation to a deleted swapfile's offset, and update bin/omarchy-system-factory-reset accordingly.
  • Write resume.conf before omarchy_resume.conf in bin/omarchy-hibernation-setup and warn non-fatally (writing neither file) when either the resume device or swapfile offset lookup returns empty, keeping unattended callers (--force --no-rebuild) working and setup retryable.
  • Extend test/shell.d/hibernation-setup-test.sh to cover stale drop-in rewrites, failed device/offset lookups, partial-setup removal, half-removed cleanup, and aborted deletion.

Note: overlaps #11477 for already-configured swapfile offset reconciliation.

Verified by Codex and Claude

Fixes #10037

Extracted from #8199 and #13584 on top of #19969.

Co-authored-by: JustNak <[email protected]>
Co-authored-by: Daniel Moore <[email protected]>
@greptile-apps

greptile-apps Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Cleans up leftover hibernation files and keeps failed setup attempts retryable.

  • Hibernation setup refreshes resume settings before adding the resume hook.
  • Hibernation removal cleans up leftover settings and partial setup.

The previous factory-reset finding is fixed. No new actionable issues were found in the changes since that review.

Reviews (4) · Last reviewed commit: "Keep resume.conf removal in factory rese..." · Reviewed by Greptile

Comment thread bin/omarchy-hibernation-remove Resolved
@omarchybot

Copy link
Copy Markdown
Collaborator

Codex High reviewed a0df3596379576f12046777461136a1841266296 on a disposable worker: all 141 CLI checks and 94 relevant shell checks passed. Six checks of the intended cleanup and retry behavior failed on the base, passed on this head, and failed again with the fix reverted. Actual hardware hibernation and real UKI generation were not exercised.

Opus 5.5 High found two additional failure paths, which I confirmed on the worker: an offset lookup failure makes --force --no-rebuild exit 1, which halts the ISO install through its checked setup call; and running remove after that failure reports “Hibernation is not set up” while leaving the swapfile and fstab entry behind. muse-wonder via pi, thinking high, found that a failed device lookup can overwrite a valid leftover drop-in with an empty resume= value and then create the hook; that also reproduced on this head while the base preserved the previous drop-in.

The setup changes overlap #11477, which also handles already-configured machines with a recreated swapfile. That older PR keeps precedence for the overlapping work, though it needs updating to retain current UUID-based resume devices. I handed this PR’s half-removed cleanup, deletion-failure guards and pending-marker retry improvements to its queue item. This is waiting on the maintainer to decide how to combine the changes and handle lookup failures in unattended setup callers.

omarchybot added a commit to yashranaway/omarchy that referenced this pull request Nov 24, 2026
Reconcile the current swapfile offset with the stable resume device in one atomic write. Keep the persistent rebuild marker until every kernel image builds, including after interrupted setup or removal, rather than restoring stale parameters. Preserve custom drop-ins and nonfatal lookup failures in factory reset's first-time setup call.

Carry the partial-removal cleanup and checked deletions from omacom#20000 into this older fix so a missing resume hook cannot hide a leftover drop-in or pending rebuild. Keep the existing UUID, ARM opt-in and root-owned installation behavior.

Co-Authored-By: David Heinemeier Hansson <[email protected]>
Co-Authored-By: Codex High <[email protected]>
Co-Authored-By: Opus 5.5 High <[email protected]>
Co-Authored-By: muse-wonder via pi (thinking high) <[email protected]>
…artial setups

Co-authored-by: JustNak <[email protected]>
Co-authored-by: Daniel Moore <[email protected]>
Comment thread bin/omarchy-system-factory-reset Resolved
…stale offset

Co-authored-by: JustNak <[email protected]>
Co-authored-by: Daniel Moore <[email protected]>
@dhh
dhh merged commit d7598e8 into quattro Nov 24, 2026
3 checks passed
@dhh
dhh deleted the extract/hibernation-stale-resume-cleanup branch November 24, 2026 08:17
cursor Bot pushed a commit to mark-groves/omarchy that referenced this pull request Nov 24, 2026
…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]>
@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

bug Something isn't working

Projects

None yet

3 participants