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 in dist/initcpio/hooks that we use to start show-/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 service plymouth-tpm2-totp.service that triggers plymouth-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 in plymouth-tpm2-totp. However, this feature is out of scope for this commit.
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