systemd-sleep should respect RESUME= on the kernel cmdline · Issue #9559 · systemd/systemd

@mbiebl if the user has set a swap partition as the device in /sys/power/resume, that will be used above any swapfile. The other bug was related to using swapfiles on Btrfs and having resume_offset= ignored. The fix added support for both resume= and resume_offset= (both required for swapfiles) so I believe it should resolve this issue, too. The logic goes like this:

  • if the user has /sys/power/resume && /sys/power/resume_offset, they have correctly configured a swapfile - use that.

  • else if the user has only set /sys/power/resume, they have correctly configured a partition, use that.

  • else if the user has only set /sys/power/resume_offset but not /sys/power/resume, log a debug message and ignore the offset and continue to the next condition.

  • finally, if the user has requested hibernate and has not correctly configured /sys/power/resume and /sys/power/resume_offset, try and determine the correct configuration by inspecting /proc/swaps.

https://github.com/zachsmith/systemd/blob/64602c843beb228be919e5f0639427b60d589ec6/src/sleep/sleep.c#L159-L183

If you have time, maybe build the PR or a recent pull of master and try it out and see if it fixes your issue or just wait for the next release on your distro - just wanted you to know if was there and hopefully fixes your bug.