[Merge] ~jefferyto/ubuntu/+source/initramfs-tools:ubuntu-core-dev-hibernate-fixes into ~ubuntu-core-dev/ubuntu/+source/initramfs-tools:ubuntu/devel
Jeffery To
mp+467060 at code.launchpad.net
Mon Jun 10 19:04:33 UTC 2024
> Your change drops the check for the swap type and your commit message does not convince me to drop it.
I wish I had some definitive documentation on how /sys/power/resume is to be set and/or used, that would really help in this case. I believe if /sys/power/resume is set (i.e. not "0:0") that indicates that hibernation is enabled, i.e. the system can be put into hibernation with the resume image written to the indicated device, and the system can be resumed from the indicated device.
* I copied part of the commit message from https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/initramfs-tools/commit/?id=f65627d96f16388deb7c3e1c88b1098baec6a59b.
The next commit that changes scripts/local-premount/resume is https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/initramfs-tools/commit/?id=b3a78e4f80570efda6ae480e8915288a93b9a488. Before this commit, the resume device was always set in the kernel, either by calling /bin/resume or writing to /sys/power/resume directly.
This commit, b3a78e4f80570efda6ae480e8915288a93b9a488, also caused the issue with setting RESUME=UUID=... (by assuming the resume variable was always a device path). I am not convinced this commit was sufficiently tested.
* As part of the change in systemd to save the hibernation device to EFI (https://github.com/systemd/systemd/blob/953c60e2f1022ade270ebb623a9cf1c679d888c1/NEWS#L2398-L2402), I believe it became more strict about checking that hibernation was explicitly enabled (with either resume= being set on the kernel command line or with /sys/power/resume being set).
If you read through https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/2057687, users have been manually setting /sys/power/resume to fix the issue of not being able to initiate hibernation. (I also could not initiate hibernation but the error I got was different, I believe because I am using a swap partition instead of a swap file.) I have also been using the change in this commit for several days and it has been working for me.
* AFAICT dracut (https://salsa.debian.org/debian/dracut/-/blob/a350037a46942ee345a9a335acedc3586aaa0309/modules.d/95resume/resume.sh#L17) and mkinitcpio (https://gitlab.archlinux.org/archlinux/mkinitcpio/mkinitcpio/-/blob/a8e6ee59acb93c604ab7649d26c07588bc056926/hooks/resume#L34) always set /sys/power/resume.
> What value does $SWAPTYPE have in the failing case?
The failing case is during a normal boot, so the swap partition/file does not contain a resume image. I haven't checked with a swap file, but for a swap partition $SWAPTYPE is "swap".
> Why are moving around the plymouth code?
Setting /sys/power/resume does not cause something to immediately happen, so I see no reason to split the calls to plymouth into two separate sections. (I assume this was done in the past because /bin/resume may exit with an error.) I can revert the changes to the plymouth code if you prefer.
--
https://code.launchpad.net/~jefferyto/ubuntu/+source/initramfs-tools/+git/initramfs-tools/+merge/467060
Your team Ubuntu Core Development Team is subscribed to branch ~ubuntu-core-dev/ubuntu/+source/initramfs-tools:ubuntu/devel.
More information about the Ubuntu-reviews
mailing list