You are not logged in.

#1 2014-01-11 13:04:41

Luker
Member
Registered: 2014-01-11
Posts: 3
Website

encrypt initrd hook: resume support without LVM

Arch supports resume from encrypted volumes, but only if you encrypt everything in a LVM volume and use it for both the system and the swap.

Personally I do not like LVM that much, and in general it's a layer of complexity that should not be required for encryption..

So I modified a little the "encrypt" hook, and added support for resume.

The needed kernel options are the same as for the "encrypt" and "resume" hooks. no modification needed there.
For the swap partition you specify the encrypted partition or encrypted UUID, the script handles the rest.

basically it adds this checks:

  • if a luks swap partition is found, then decrypt, update "resume=" variables and try to resume.

  • if the swap partition is not encrypted it tries to resume anyway.

  • tries to use the same keyfile for both root filesystem and swap.

  • if keyfile fails, revert to password.

  • tries to use the same password for both swap and root filesystem. If it fails it asks for another password.

The only thing left to test is the tuxonice resume from file feature, which should work, but I haven't tested it yet, and I need some help there 'cause there might be a problem, like opening twice the encrypted partition or something like that.

You can find the modified hook (I call it "encrypt_resume") here:http://pastebin.com/mShQU7JD
If you don't want to substitute your "encrypt" hook remember to copy the encrypt install script.

# cp /usr/lib/initcpio/install/encrypt /usr/lib/initcpio/install/encrypt_resume 

Comments? Tuxonice file testers?


GPG Key id: 762C35A5
https://www.fenrirproject.org

Offline

Board footer

Powered by FluxBB