FS#23182 - [cryptsetup] Multiple device support for encrypt hook
Attached to Project:
Arch Linux
Opened by Stefan J. Betz (encbladexp) - Monday, 07 March 2011, 22:04 GMT
Last edited by Buggy McBugFace (bugbot) - Saturday, 25 November 2023, 20:22 GMT
Opened by Stefan J. Betz (encbladexp) - Monday, 07 March 2011, 22:04 GMT
Last edited by Buggy McBugFace (bugbot) - Saturday, 25 November 2023, 20:22 GMT
|
Details
Currently the encrypt hook for mkinitcpio can parse only on
volume for encryption in the early boot stage. But there are
some situations where multiple encrypted volumes are
required to build a lvm or raid device.
sda1 -> Encrypted sdb1 -> Encrypted Both volumes (sda1 and sdb1) are from the same volume group or raidset, but encrypted with different settings and/or passwords. The following syntax for encrypt maybe a good solution for this: cryptdevice=/dev/sda1:sda1_crypt,/dev/sdb1:sdb1_crypt |
This task depends upon
Closed by Buggy McBugFace (bugbot)
Saturday, 25 November 2023, 20:22 GMT
Reason for closing: Moved
Additional comments about closing: https://gitlab.archlinux.org/archlinux/p ackaging/packages/cryptsetup/issues/6
Saturday, 25 November 2023, 20:22 GMT
Reason for closing: Moved
Additional comments about closing: https://gitlab.archlinux.org/archlinux/p ackaging/packages/cryptsetup/issues/6
The lvm volume or the raid volume.
The goal is only that you can decode multiple volumes / partitions directly in the initrd, I think there are enough applications for it! My LVM Setup is only one, but there are many others (encrypted swap without LVM for hibernate).
In the morning I turn on my laptop, wait to enter password for the encrypted disc and use the bathroom. When I am back, GNOME is running with opened windows, just sit down and start working. :D
I changed the "encrypt" hook to split cryptdevice by ',,' (you can have a comma in parameters) and for each device ask for a password. The password is remembered and tried for the next disc by default. In other words, I enter the password only once and both discs are decrypted. If you want to enter your password in the secure way, attach /bin/stty to ramdisk (FILES="/bin/stty" in /etc/mkinitcpio.conf)
I searched for a while and with the current encrypt hook for me works the setup contained in the patch. It's my first edit and i'm not sure it's correct. I tested with passphrase and i'm testing for keyfile.
encrypt.patch (0.9 KiB)
Does this solve the issue?
I've attached the patch I'm using, which is inspired by a version found on the forums. At least one of the versions mentioned here is probably better-thought-out; I wrote this at 11pm thinking mostly of bed. I'll echo the sentiment that it would be very nice having something like this in the package.
But my encrypt hook is 100% backwards compatible with the existing encrypt hook, yet adds support for (unlimited, up to kernel command line limit) multiple devices and caches passwords in between them, any way we could get that merged so it can *just work* in the future?
Hook is attached, and full change history can be seen here:
https://github.com/moparisthebest/archlinux_encrypthook
https://bbs.archlinux.org/viewtopic.php?id=196840
Feel free to add / adapt it. I'm willing to do it if someone will point me in the right direction.