[Pkg-utopia-maintainers] Bug#555712: Patch for upower and encrypted swap

Erich Schubert erich at debian.org
Mon Mar 29 19:28:50 UTC 2010


Hi,
Attached is a patch that allows hibernation on swap devices set up via
"decrypt_derived". This is a hack, but I don't have the time to contact
the cryptsetup authors on whether it is safe to add a "can_hibernate"
option to /etc/crypttab. This would then IMHO be a clean solution:

1. The user adds "can_hibernate" to /etc/crypttab to mark swap devices
as safe for hibernation
2. cryptsetup knows about can_hibernate but ignores it (mostly)
3. Debian setup scripts should be modified to mark safe devices by
default, so new users won't have to change anything
4. upower allows hibernation when all swap devices are safe.

Attached patch checks for "decrypt_derived"; this is not the full
solution outlined above. Replacing that string with "can_hibernate"
should take us pretty close to that though. Splitting at "," and then
doing an exact strcmp doesn't give us that much extra sanity, does it?
I believe you can also rewrite the code to not use split and thus not do
extra mallocs (and require the cleanups for that).
The outline for that would be to skip to the second tab char in the
crypttab line, then try matching "can_hibernate" or jumping to the
next , until the end of the line is reached.

Any takers?

Regards,
Erich
-------------- next part --------------
A non-text attachment was scrubbed...
Name: encrypted-swap
Type: text/x-patch
Size: 2157 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-utopia-maintainers/attachments/20100329/f98a7f5e/attachment.bin>


More information about the Pkg-utopia-maintainers mailing list