Skip to content
This repository was archived by the owner on Jan 23, 2024. It is now read-only.

GPG support ? (root_key & root_keydev) #54

@jeandestouches

Description

@jeandestouches

Hi,
Would it be possible to add root_key & root_keydev parameter + GPG support ?
To be able to boot a vmlinuz kernel (with better-initramfs embedded into it) stored on an (unencrypted) USB key alongside a keyfile.gpg, which then unlocks the main drive. (LUKS)
At boot, better-initramfs would provide a prompt to decrypt the gpg key, similar to what it does with askpass & cryptsetup. (using something like : gpg --decrypt /mnt/usb/keyfile.gpg | run cryptsetup --keyfile=- luksOpen [...] )
Of course, the USB key would be need to be mounted on /mnt/usb before that, using root_keydev to grab the UUID and root_key to avoid hardcoding "keyfile.gpg" in the init file and allow to pass the keyfile name as a parameter.

Similar to what sakaki achieved here : https://wiki.gentoo.org/wiki/User:Sakaki/Sakaki%27s_EFI_Install_Guide/Preparing_the_LUKS-LVM_Filesystem_and_Boot_USB_Key#Creating_a_Password-Protected_Keyfile_for_LUKS

sakaki recommends gnupg 1.4.x ("latest" being 1.4.23, which compiles fine on musl for information, I tried with sakaki's staticgpg ebuild bumped to 1.4.23 on a gentoo musl vm) :
"Unfortunately, the version of gpg that is emerged by Portage by default is the 2.x variant. This requires a (rather convoluted) service known as pinentry to ask you for your password (even when compiled statically), and currently genkernel's initramfs builder (and init script) does not work correctly with it. Instead, genkernel expects to be using a version 1.x gpg which can query for passphrases itself, without invoking an outside agent."

(this might be old info, maybe it is possible to use latest gnupg instead now, I don't know)

https://wiki.gentoo.org/wiki/User:Sakaki/Sakaki%27s_EFI_Install_Guide/Building_the_Gentoo_Base_System_Minus_Kernel
https://github.com/sakaki-/sakaki-tools/blob/master/app-crypt/staticgpg/staticgpg-1.4.16-r1.ebuild

Thanks. (using better-initramfs for more than a year now, really nice!)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions