Skip to content

Place the hibernation resume hook before filesystems - #8888

Closed
yashranaway wants to merge 4 commits into
omacom:quattrofrom
yashranaway:fix/hibernation-resume-hook-order
Closed

yashranaway wants to merge 4 commits into
omacom:quattrofrom
yashranaway:fix/hibernation-resume-hook-order

Conversation

@yashranaway

@yashranaway yashranaway commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

Places the hibernation resume hook before filesystems and repairs existing installs. Fixes #8471.

<<<< AI wording below >>>>

Problem

Appending resume after filesystems can make mkinitcpio mount the root filesystem before resume handling, so hibernation cannot restore reliably.

Fix

Install a managed drop-in that removes duplicate resume hooks and inserts one before filesystems. The migration accepts both legacy and managed configs, records machine-wide rebuild completion, and retries if limine-mkinitcpio fails before that marker is written.

Verification

  • bash test/shell.d/hibernation-resume-hook-test.sh
  • bash test/shell.d/bin-style-test.sh
  • bash -n bin/omarchy-hibernation-setup bin/omarchy-hibernation-remove migrations/1787968459.sh test/shell.d/hibernation-resume-hook-test.sh
  • git diff --check
  • The migration test covers failed rebuild, successful retry, and another user's no-op path.

Copilot AI balanced review requested due to automatic review settings August 29, 2026 06:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates hibernation setup so mkinitcpio runs resume before filesystems, including migration and removal compatibility.

Changes:

  • Generates a managed, deduplicated resume-hook configuration.
  • Migrates legacy drop-ins and adds focused shell coverage.
  • Recognizes both legacy and managed formats during removal.

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 2 out of 4 changed files in this pull request and generated 1 comment.

File Description
bin/omarchy-hibernation-setup Writes and upgrades the ordered resume configuration.
bin/omarchy-hibernation-remove Detects managed and legacy configurations.
migrations/1787968459.sh Migrates existing legacy drop-ins.
test/shell.d/hibernation-resume-hook-test.sh Tests ordering, deduplication, fallback, and migration parity.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread migrations/1787968459.sh Resolved
@TechLuddite

Copy link
Copy Markdown
Contributor

Thanks for putting a complete change together here. Updating omarchy-hibernation-setup and
omarchy-hibernation-remove in step, adding a migration and adding a test is more thorough than I
expected, and if the repositioning is wanted then this is the shape it should take.

My hesitation is upstream of the implementation: I am not convinced the ordering is load-bearing. I
have posted the detail on #8471, but the short version is that /usr/lib/initcpio/init runs every
run_hook at line 43 and only mounts root at line 67, filesystems and fsck have no runtime hook
at all, and btrfs-overlayfs is a run_latehook, so resume at position 15 is the next run_hook
to execute after encrypt. On an encrypted-root machine here the kernel log shows the resume attempt
landing after dm-crypt initialises and before the first mount of the root filesystem.

If that holds, this PR takes on migration and compatibility risk without a behaviour change to show
for it, which seems like the wrong trade even though the code is sound. If it does not hold, I would
rather be corrected here than have the maintainers act on my say-so, so please push back.

One thing worth doing either way, independent of ordering: #11791 reports that the enterprise Wi-Fi
path creates a fresh profile rather than reusing an existing one. Unrelated to this PR, but it is the
other place in the tree where a drop-in and a generated config disagree about who owns the value.

@yashranaway

Copy link
Copy Markdown
Contributor Author

You're right: mkinitcpio runs resume before mounting root even when it follows filesystems, so I closed this unnecessary PR.

@yashranaway
yashranaway deleted the fix/hibernation-resume-hook-order branch September 24, 2026 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

omarchy-hibernation-setup's HOOKS+=(resume) can never place resume before filesystems

3 participants