Repository navigation
Name the hibernation resume device by its filesystem UUID - #16658
Merged
Merged
Conversation
Hibernation setup wrote resume= from findmnt's SOURCE column. On an unencrypted install that is the partition's kernel name, such as /dev/nvme1n1p4. NVMe names follow the order the controllers finish probing, so on a machine with two NVMe disks they can swap between boots: resume= then names a partition on the other disk, the initramfs finds no hibernation image there, and the machine cold-boots with the session lost. On an MSI desktop with two NVMe disks the install's root came up as nvme0n1p4 while resume= named nvme1n1p4, an ext4 partition on the other disk. Write resume=UUID=<filesystem UUID> instead. Both resume paths accept it: mkinitcpio's resume hook hands off to systemd-hibernate-resume on systemd 255 and later, which resolves resume= with fstab_node_to_udev_node() to /dev/disk/by-uuid/, and the hook's own resolve_device() handles UUID= on older systemd. The udev hook ships 60-persistent-storage.rules, so the link exists in the initramfs. The kernel's early lookup rejects UUID= and leaves resume to the initramfs, which is where it runs on these installs anyway, since nvme is a module there. A device-mapper name such as /dev/mapper/root on an encrypted install is chosen by whoever opened the device and does not move, so it stays as it is. If findmnt reports no UUID, setup falls back to the kernel name it wrote before.
A machine set up before keeps resume=/dev/nvme0n1p2 in its drop-in, and setup stopped at "Hibernation is already set up" without looking at it. Now a rerun on a configured machine rewrites the line setup itself writes, in the current and the Omarchy 3.4 form, with the filesystem UUID and rebuilds the boot image. Device-mapper names, a drop-in already naming a UUID and a drop-in edited by hand are left alone, so a second run changes nothing. limine-mkinitcpio 1.40 reports "mkinitcpio failed for kernel ..., skipping." and still exits 0, so setup treats that line as a failed rebuild, as migration 1791621765 does. On a failed rebuild the old line goes back, so the drop-in matches the boot image and the next run tries again. Both lines are written through install_root_file, the staged, atomic replace the script already uses for its sleep hook, and are staged before the drop-in changes, so a full disk cannot leave it half-written. --no-rebuild leaves the rebuild to the caller, as the installer and the factory reset expect.
Every unencrypted install so far carries a kernel name in /etc/limine-entry-tool.d/resume.conf, and nothing reruns hibernation setup on its own, so the previous change would only reach new installs and factory resets. The migration runs setup on machines whose drop-in names a /dev/ path outside /dev/mapper and whose resume hook is in place; setup renames the device and rebuilds the boot image. Machines without that drop-in, encrypted installs, and drop-ins already naming a UUID are skipped. If the boot image is not rebuilt, setup puts the old drop-in back and exits 1, so the migration stays pending and the next omarchy-migrate retries it.
Contributor
[Medium impact] The PR appears safe to merge; no actionable issues remain. SummaryThis PR names unencrypted resume devices by filesystem UUID while preserving
The previous retry-loss finding is fixed. No new actionable issues were found.
|
A drop-in from a setup whose offset lookup failed reads resume=/dev/nvme0n1p2 resume_offset= and does not match the line the rename looks for, which needs a number there. The rename ran first and skipped it, then the offset repair filled the offset in and rebuilt the boot image with the kernel name still in it, and setup exited 0, so the migration was marked done. Run the rename after the offset repair, which leaves the device as it found it. Such a drop-in now gets its offset, then the UUID, and the boot image carries both.
The repository keeps a command's tests in its area's existing file, and hibernation-setup-test.sh is that file. Its locale case still skips on a machine without hibernation; the resume device cases redirect every path they write and run anywhere. Trimmed to the cases that carry logic: the UUID and device-mapper names on first setup, a rerun renaming a kernel name once (with and without an empty offset), the restore when a kernel's image is not rebuilt, and drop-ins setup does not own.
When the boot image was not rebuilt after the rename, setup put the old line back. That retry only held if the restore itself succeeded and the run lived long enough to do it. Closing the update terminal while the image builds kills setup in between: the drop-in already names the UUID, the boot image still names the kernel device, and the next omarchy-migrate saw a UUID, exited 0 and marked the migration done. In a VM with the 4.5.0rc1 install, a SIGHUP to the migration's process group a second into the build left exactly that, with /boot/limine.conf still carrying resume=/dev/nvme0n1p2 for good. Setup now writes /var/lib/omarchy/hibernation-resume-rebuild before it touches the drop-in and removes it only after a rebuild that limine-mkinitcpio did not report as skipped. While the marker exists, setup rebuilds, and the migration runs setup again. A failed, skipped or interrupted rebuild therefore leaves a state the next run finishes, and the restore goes away. --no-rebuild callers rebuild themselves and get no marker.
omarchybot
added a commit
to yashranaway/omarchy
that referenced
this pull request
Oct 31, 2026
quattro now renames a kernel-name resume device and rebuilds the boot image behind a pending marker (omacom#16658), in the same already-set-up block. --force and the offset repair rebuild only when that marker is not already doing it, so a run rebuilds once. quattro's test runs the real command with its system paths rewritten into a scratch directory, so the OMARCHY_HIBERNATION_* path overrides this branch added for its tests are no longer needed and are dropped; the forced-rebuild cases move into that harness. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 31, 2026
20 of 34 tasks
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hibernation setup writes
resume=from findmnt's SOURCE column. On an unencrypted install that is the partition's kernel name (resume=/dev/nvme0n1p2). NVMe names follow the order the controllers finish probing, so on a machine with two NVMe disks they can swap between boots, and then:Call to Hibernate failed: Specified resume device is missing or is not an active swap device.Encrypted installs get
/dev/mapper/root, which is stable, so this hits unencrypted installs on machines with more than one NVMe disk, whichever installer made them. It was found on an MSI desktop with two NVMe disks, where the install's root came up as nvme0n1p4 whileresume=named nvme1n1p4, an ext4 partition on the other disk.This writes
resume=UUID=<filesystem UUID>instead, keeping/dev/mapper/*names as they are:resumehook hands off tosystemd-hibernate-resumeon systemd 255 and later, which resolvesresume=withfstab_node_to_udev_node()to/dev/disk/by-uuid/; the hook's ownresolve_device()handlesUUID=on older systemd, and theudevhook ships60-persistent-storage.rules, so the link exists in the initramfs./dev/disk/by-uuid/, butresume=on the command line wins over it, which is why a stale kernel name loses the session even though that variable names the right disk.Machines set up before keep their kernel name until something rewrites it, so a rerun of hibernation setup on a configured machine now renames the device in the line setup itself writes (current and 3.4 forms), and rebuilds the boot image. A marker in /var/lib/omarchy, written before the drop-in changes, stays until a rebuild succeeds, so a rebuild that fails, that limine-mkinitcpio reports as skipped while still exiting 0 (as migration 1791621765 already handles), or that is cut off by closing the update terminal is done again on the next run. A migration runs setup on machines whose drop-in names a kernel device or that still have the marker, and whose resume hook is in place; a failed rebuild leaves it pending. Hand-edited drop-ins, encrypted installs and drop-ins already naming a UUID are left alone. The factory reset deletes the drop-in and reruns setup in the factory root, which now writes the UUID.
What the initramfs logs on a two-NVMe machine when the other disk probes first, before:
and after, with
resume=UUID=973278e9-…and the same probe order, the session comes back:#11477 reconciles the drop-in from
findmnt -no SOURCEon every rerun, so whichever of the two lands second should take the device fromresume_devicehere; otherwise a rerun would put the kernel name back. The UUID form was first suggested in a comment on #1417.