Repository navigation
Conversation
[High impact] Modifies hibernation setup and resume device configuration. The PR is not ready to merge because an empty unquoted resume parameter can remain broken after setup retries. Findings
SummaryThe PR avoids writing an empty resume device, makes missing resume configuration retryable, and adds fixture-based setup tests.
Reviews (6) · Last reviewed commit: "Ignore trailing comments when deciding a..." · Reviewed by Greptile |
Greptile P1/P2 on omacom#13908: if the first run wrote the HOOKS marker but skipped resume.conf (empty findmnt), later runs now create or repair incomplete/empty resume tokens and rebuild initramfs once.
|
Nice fix for #12630, and the fixture tests are thorough. Nit: |
Greptile P1/P2 on omacom#13908: if the first run wrote the HOOKS marker but skipped resume.conf (empty findmnt), later runs now create or repair incomplete/empty resume tokens and rebuild initramfs once.
Reject non-digit RESUME_OFFSET and non-/dev RESUME_DEVICE on create, repair, and append paths.
Greptile: device-mapper paths like /dev/mapper/crypt@home were rejected. Accept @ in the resume device regex on create and repair paths, cover it in tests, and keep missing-drop-in retry / single-rebuild behavior intact.
41f00d8 to
bd8001c
Compare
quattro added its own test/shell.d/hibernation-setup-test.sh (the locale-safe memory prompt check, omacom#14520), which collided with this branch's new test of the same name. Keep quattro's file as it is and move this branch's fixture test to hibernation-resume-setup-test.sh: the two test different things, and quattro's skips the whole file on a host without /sys/power/image_size, which would have skipped the fixture tests too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
quattro's setup now skips itself on Apple Silicon before doing anything, and the fixture test let the real detector answer, so on an Asahi host every case failed at its first assertion. Answer no in the fixture, as the test already does for omarchy-cmd-missing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com>
The append path decided a parameter was missing from patterns that only recognise the double-quoted form, but Limine also accepts unquoted command lines. A working drop-in such as KERNEL_CMDLINE[default]=quiet resume=/dev/mapper/other resume_offset=6789 would get a second resume= and resume_offset= for /swap/swapfile appended and the UKI rebuilt, overriding a configuration quattro left alone. Append each one only when no active KERNEL_CMDLINE line mentions it in any form. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com>
The append guard matched resume= anywhere on an active line, so a trailing comment such as "# previously resume=/dev/old" counted as a configured device and the missing parameter was never added. Stop the match at the first #. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com>
| RESUME_CHANGED=true | ||
| fi | ||
| # Append only when no active line sets it in any form, quoted or not. | ||
| elif ! grep -Eq '^[[:space:]]*KERNEL_CMDLINE\[default\]\+?=([^#]*[[:space:]"])?resume=' "$RESUME_DROP_IN"; then |
There was a problem hiding this comment.
Empty unquoted parameters remain broken
If an existing drop-in has an unquoted assignment with an empty resume=, this check treats the parameter as already set. The repair above only handles quoted assignments, so setup neither fills in the device nor appends a usable value. Hibernation resume remains broken after a retry. The same problem applies to an empty unquoted resume_offset= at line 123.
Knowledge Base Used: Pin root before the Quattro package transaction
|
Reviewed at 5644c6d against What ran. Everything ran on a disposable Omarchy VM. A reproduction written separately from the test here ran a path-redirected copy of the script with Pushed to this branch.
Competing fixes. #9860 and #11477 also fix #12630. #9860 is the oldest, but it exits 1 when the device is unknown, which fails a factory reset. It also cannot repair a machine where the marker was written but the drop-in was not. #11477 rejects device names containing Waiting on the maintainer. |
|
Re-reviewed at 5644c6d against Conflict. Competing fixes. Three open pull requests fix #12630: #9860, #11477 and this one. By default the oldest one wins, unless a newer one is clearly better.
When the device can be found and the rebuild succeeds, this and #11477 behave the same on the drop-in from #12630. This one also does two things #11477 doesn't: it repairs a hand-edited drop-in in place where #11477 refuses one, and it accepts What ran. Nothing ran this round. Comparing the three fixes needed only the diffs and the code on Waiting on: the maintainer, to choose between the fixes for #12630. #11477 also needs porting onto #16658 before it can land. |
Summary
Fixes #12630:
omarchy-hibernation-setupcould writeresume=with an empty device whenfindmntreturned nothing, which produces a broken kernel command line.Changes
resume=in its activeKERNEL_CMDLINE[default]assignment, fill it in whenfindmntnow finds the device, and rebuild (unless--no-rebuild). Comments that containresume=are left alone.test/shell.d/hibernation-setup-test.sh, which runs a copy of the script against a fixture with stubbedsudo,findmntandbtrfs.Testing
test/shell.d/hibernation-setup-test.sh(8 cases),bash -nandshellcheckon both filestest/shell.d/unowned-system-paths-test.shcould not run here because theomarchy-pkgscheckout is not available.