[RFC] Add support for systemd initcpio setups#25
Open
fuhry wants to merge 5 commits into
Open
Conversation
NOT WORKING ON SYSTEMD 253 AND ABOVE. NOT VERIFIED TO BE COMPATIBLE WITH EXISTING CRYPTTABS. In its current state, this crashes systemd-253 and above with the error message "Failed to start up manager" during early boot, which halts startup. Support for systemd also requires the pgp keyfile to be specified as `pgp-keyfile=...` as an option in the crypttab entry, instead of in the keyfile column. (Otherwise, systemd-decrypt will try to load it as an ordinary keyfile.) Documentation and migration tools will be updated once this gets closer to release quality.
|
Hey, did you maybe forget to include the |
Owner
Author
|
Hi @fossdd, sorry about that, I've pushed it now. Thanks for flagging! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Significant rewrite/expansion of the scencrypt hook to allow it to work with systemd-based initcpios.
Instead of replacing the
systemd-cryptsetupflow, this method piggybacks on it by using a generator to add dependencies and overrides for systemd-cryptsetup disk targets, as follows:systemd-initramfs-gpg-init.serviceinitializes the GPG homedir inside the initramfs by importing all of the public keys which were packed into the initramfs.systemd-gpg-decrypt@.servicegets the passphrase or PIN fromsystemd-ask-passwordand passes it to gpg, which stores the keyfile at a known location (based on the key's filename).systemd-cryptsetup-pgp-keyfile@.servicecopies the key from the decrypted location to the/run/cryptsetup-keys.ddirectory where it is automatically picked up bysystemd-cryptsetupand used to decrypt the disk.Because it uses
systemd-ask-password, this means you can even use plymouth!Demo video running in a virtual machine with a real Yubikey passed through on USB: https://fuhry.com/b/initramfs-scencrypt-systemd-demo.webm
This does break backward compatibility with version 1.x, because there is no way to make
systemd-cryptsetupwork when the key-file column (column 3) of crypttab points to a file. It has to be set tononeand the pgp keyfile must be passed in an option instead. A migration script (aptly namedscencrypt-migrate) is included which mostly automates the process of modifying crypttab.