@TomAoki this should be managed by openswap (wiki.archlinux.org/title/Dm-cr) and it seems that everything is properly configures, but something goes wrong. The automatic configuration procedure is likely causing some problems and unlocking the swap partition fails. Even when providing the (correct) password, the system can unlock it but resume fails. I haven't investigated that much - it works on Tumbleweed and this was just an experiment, so I'm fine.

Still, I love how the GELI manages this at (full) disk level. You unlock the disk and you don't need to unlock all the different partitions one by one. Unfortunately, suspension doesn't work (yet) on my minipc and hibernation isn't supported at all. I'm mostly using it on laptop, anyway.

@stefanoStefano Marinelli
Interesting document. Thanks!

I'm not enough understanding sleep / hibernation on ACPI, but if BIOS / firmware just attempts to start the OS just as regular cold boots and restoring memory image from hibernation partition / file / swap is fully on the OS side only, restoring from encrypted image would sanely work, if the OS supports it (AFAIK, FreeBSD does NOT yet support hibernation).

But if the restoration in on BIOS / firmware side like done on APM era, restoring from encrypted hibernation partition / file / swap would likely to fail, unless the mechanisms are enough standardized and implemented in both side.

On APM era, where to hibernate was on BIOS and ThinkPads I've used at the era required dedicated hibernation partition and it could not be in DOS-Extended partitions (required one in four partition to be dedicated). Some BIOS'es seem to require swap file that is in any partition the BIOS can sanely access and formatted in anything the BIOS can read / write, and at least in some cases, the swap file should not be fragmented.

AFAIK, things were done unattended to running OS and the OS would be surprized that RTC is suddenly advanced a lot (it would allow OS to notice that hibernation is done, possibly some APM status were provided, though).
Any OS supporting hibernation needed to notice the fact it was restored from hibernation and re-initialize anything the BIOS does NOT care. Without it, the OS couldn't be hiernated.

0

If you have a fediverse account, you can quote this note from your own instance. Search https://mastodon.bsd.cafe/users/TomAoki/statuses/115724977798054672 on your instance and quote it. (Note that quoting is not supported in Mastodon.)