dist: add sd-plymouth-tpm2-totp mkinitcpio hook #75
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.
mkinitcpio supports two different kinds of initramfs images: one with a busybox init (
HOOKS=(base udev ...)
) and one with a systemd init (HOOKS=(systemd sd-...)
). Only the former supports the runtime hooks indist/initcpio/hooks
that we use to startshow-
/plymouth-tpm2-totp
, the latter relies on system unit files to start programs.This commit adds a new mkinitcpio hook
sd-plymouth-tpm2-totp
to be used for systemd-based mkinitcpio initramfs images. It adds a systemd serviceplymouth-tpm2-totp.service
that triggersplymouth-tpm2-totp
once Plymouth has been started and/dev/tpm0
is available. While the hook itself is specific to mkinitcpio, this service might be useful for other systemd-based initramfs generators as well.Unlike the other currently available hooks, this service currently does not allow selecting a different NV index using the kernel command line. As far as I am aware, there is no built-in way to supply arguments from the kernel command line to systemd units, so the easiest approach might be parsing
/proc/cmdline
directly inplymouth-tpm2-totp
. However, this feature is out of scope for this commit.Closes: #74