omarchy hibernation remove leaves resume.conf behind, so a later setup keeps a stale resume_offset
System
- Omarchy 4.0.4-1
- Btrfs root on LUKS, Limine + UKI, NVIDIA GPU (desktop)
What happened
omarchy-hibernation-setup writes /etc/limine-entry-tool.d/resume.conf:
KERNEL_CMDLINE[default]+=" resume=/dev/mapper/root resume_offset=1929151"
omarchy-hibernation-remove deletes the swapfile, the /swap subvolume, the fstab entry, and /etc/mkinitcpio.conf.d/omarchy_resume.conf, but not resume.conf. After limine-mkinitcpio and a reboot, the kernel cmdline still carries resume=... resume_offset=..., which now points at a deleted swapfile.
Why it matters
If hibernation is set up again later, omarchy-hibernation-setup only writes the resume parameters when the file is missing:
if [[ ! -f $RESUME_DROP_IN ]]; then
The new swapfile gets a new physical offset, but the old resume_offset is kept. Hibernation then writes the image to the new swapfile, and resume looks in the wrong place, so the session is silently lost on the next boot.
Steps to reproduce
omarchy hibernation setupomarchy hibernation removels /etc/limine-entry-tool.d/:resume.confis still there- Reboot, then
cat /proc/cmdline:resume=andresume_offset=are still present omarchy hibernation setupagain:resume.confis not rewritten, andresume_offsetno longer matchessudo btrfs inspect-internal map-swapfile -r /swap/swapfile
Expected
remove deletes /etc/limine-entry-tool.d/resume.conf before running limine-mkinitcpio, which undoes what setup wrote.
Suggested fix
In bin/omarchy-hibernation-remove, before regenerating the initramfs:
RESUME_DROP_IN="/etc/limine-entry-tool.d/resume.conf"
if [[ -f $RESUME_DROP_IN ]]; then
echo "Removing resume kernel parameters"
sudo rm "$RESUME_DROP_IN"
fi
Also worth considering: setup could always regenerate resume.conf instead of skipping it when it exists, so an offset left over from any source gets corrected.
Minor: remove also leaves rtc-alarm.conf (on s2idle systems) and /usr/lib/systemd/system-sleep/keyboard-backlight. Both are harmless without hibernation, so this may be intentional.
Confirmed in source on quattro (7dd477b35). Nothing was run: the mechanism reads directly from the two scripts, and a real reproduction needs a btrfs swapfile, Limine and a hibernate cycle.
bin/omarchy-hibernation-remove deletes the swapfile, the /swap subvolume, the fstab entry and /etc/mkinitcpio.conf.d/omarchy_resume.conf, then runs limine-mkinitcpio with /etc/limine-entry-tool.d/resume.conf still in place, so the rebuilt entries keep resume=/resume_offset= for a swapfile that no longer exists. bin/omarchy-hibernation-setup only writes resume.conf when it is missing (line 137), so a later setup keeps the old offset for the new swapfile. The early "already set up" branch doesn't step in, because remove deleted the mkinitcpio marker it checks, and it only repairs an empty offset anyway. omarchy-system-factory-reset already deletes both drop-ins before it reruns setup, but plain remove doesn't. Machines that have already run remove still have the leftover file, and running remove again won't clean it up, because it exits once the marker is gone.
Two open pull requests fix this and both already say Fixes #13583: #13584 and #13768. Both make remove delete resume.conf before rebuilding, and both make setup recompute the offset every time, so they also repair a file left behind by an earlier remove the next time hibernation is set up. #13584 also deletes the drop-in when no offset can be determined, while #13768 leaves the old file in place in that case. Each is reviewed as its own item, and the choice between them is the maintainer's. #10037 reports the cmdline half of the same gap.
Reviewed by Claude Opus 5.5, with Codex Medium as a second opinion. Codex agreed on the mechanism, but independence isn't guaranteed. It also pointed out the leftover file on machines that already ran remove, which both pull requests handle through setup. Codex did not consider this a duplicate of #10037, so this issue stays open. It's now waiting on the maintainer to pick a fix.
Confirming on 4.5.0-3 after a real remove → setup cycle, with two details the thread doesn't have yet.
1. On current systemd the symptom is "hibernate unavailable", not a lost session. systemd 262's logind compares the swapfile's real offset with /sys/power/resume_offset. When they differ it answers CanHibernate: "na" and logs nothing, so hibernate quietly disappears. That includes UPower's critical-battery action: CriticalPowerAction=Auto falls through to power-off. Here, resume.conf from a June setup still said resume_offset=19670272, while the recreated swapfile was at 58301484.
2. Installs that ran setup on 3.5.x carry a second stale copy in /etc/default/limine. From 3ce7ef757 (first released in v3.5.0) until 75cb4f719 (v4.0.0), setup also appended the resume line to /etc/default/limine. 4.0 stopped writing it, but nothing removes copies already there, so after resume.conf was corrected this machine booted with both:
resume=/dev/mapper/root resume_offset=19670272 ... resume_offset=58301484
The kernel takes the last resume_offset=, so the stale value was harmless once resume.conf was right. But neither #13584 nor #8199 touches /etc/default/limine, so on these installs remove would still leave resume= pointing at the deleted swapfile. An earlier comment on #10037 says the append was dev-only; it did ship in the 3.5.x releases.
Confirmed the legacy /etc/default/limine case. The append introduced in 3ce7ef7570 shipped in both v3.5.0 and v3.5.1, checked directly against those tags. 75cb4f7195 stopped writing it for 4.0; current setup and removal do not clean up the old copy.
I checked quattro at 9f2e2e94ab on disposable workers built from the Omarchy ISO. With a seeded legacy line, current removal deleted the resume hook but left both configuration sources behind during a real UKI rebuild. Deleting only resume.conf and rebuilding still left resume parameters in the actual UKI's .cmdline. A separate control used a unique offset and the historical /dev/mapper/root line: with the drop-in absent throughout, the parameters appeared when that legacy line was present, disappeared when it was removed, and returned when it was restored.
#8199 and #13584 already link this issue and address drop-in removal and stale offsets on a later setup. Neither cleans /etc/default/limine; #13768 is now closed. Cleanup must preserve other boot arguments: omarchy-upgrade-to-quattro can also put resume parameters on the same line as root=, so deleting whole lines indiscriminately would remove required boot settings. This remains waiting on the maintainer to account for the legacy case alongside the existing fixes.
Codex High ran the worker checks. Opus 5.5 High and muse-wonder via pi, thinking high, agreed with the source diagnosis; their independence from the brief is not guaranteed. Both also identified the combined-line cleanup hazard, which I checked against the upgrade helper. These were configuration and UKI rebuild checks, not a full remove/setup or hibernate/resume cycle, and I did not exercise the reported systemd 262 refusal or critical-battery behavior.
#19969, merged as 4574aa8bb5350141542166b9d09206cc7413702c, now removes resume.conf and the pending rebuild marker alongside the resume hook. On a disposable worker built from the Omarchy ISO, all seven focused hibernation tests passed. Running current removal with seeded configuration also deleted both the hook and drop-in before a successful real UKI rebuild.
Machines left half-removed by older versions still need repair: with the hook absent, current removal says “Hibernation is not set up” and leaves a stale drop-in behind. #20000 carries that cleanup and the fresh-setup offset rewrite from the now-closed #8199/#13584. Its diff leaves the already-configured setup branch unchanged, so it does not automatically refresh a nonempty stale offset when the hook is already present.
The legacy /etc/default/limine case also remains. On today's code, a unique offset seeded there survived removal and appeared in the rebuilt UKI's actual .cmdline, even though resume.conf was gone. #20000 does not touch that file. This issue remains open for the maintainer to account for legacy cleanup alongside #20000; an automatic closing link would leave that reported case unresolved.
Codex High ran the worker checks. Opus 5.5 High and muse-wonder via pi, thinking high, agreed with the source diagnosis; independence from the brief is not guaranteed. They also identified the unchanged already-configured branch and clarified the limits of the probe, which I checked against the source and logs. These were configuration-removal and UKI-generation checks, with no swapfile recreation, full setup/hibernate/resume cycle, or exercise of the reported systemd refusal and critical-battery behavior.