]> git.ipfire.org Git - thirdparty/systemd.git/commit
hibernate-resume: automatically decrypt dissected swap if told so via autoSwap 37335/head
authorMike Yuan <me@yhndnzj.com>
Sat, 3 May 2025 16:41:00 +0000 (18:41 +0200)
committerMike Yuan <me@yhndnzj.com>
Mon, 5 May 2025 17:37:11 +0000 (19:37 +0200)
commit656a7bb1fb324aec8aeab4b07bf27d71e9e2e107
tree07ce925c5fa2493885578b40cac8504ce3d29f4e
parenta88ee2c8df4dd26acfb8bf66650610167ffc8df2
hibernate-resume: automatically decrypt dissected swap if told so via autoSwap

With the addition of /dev/disk/by-designator/ along with
ID_DISSECT_PART_DESIGNATOR attr, it is now trivial to tell
whether the swap device we hibernated into is the "auto" one.
Hence use that bit of info and generate cryptsetup unit
in hibernate-resume-generator if that's the case.

Ideally, gpt-auto should really just handle swap already
in initrd, which would save us a myriad of trouble and
the system behaves more consistently. But I don't see that
happening anytime soon. This is the second best option
we have I reckon.

Closes #27247 (#35328, #37330)
src/hibernate-resume/hibernate-resume-config.c
src/hibernate-resume/hibernate-resume-config.h
src/hibernate-resume/hibernate-resume-generator.c