tpm2-software / tpm2-totp

Attest the trustworthiness of a device against a human using time-based one-time passwords
https://tpm2-software.github.io
BSD 3-Clause "New" or "Revised" License
164 stars 37 forks source link

no OTP shown with sd-plymouth #74

Closed bigfreak85 closed 3 years ago

bigfreak85 commented 3 years ago

With these Hooks the OTP wont show up:

HOOKS=(systemd consolefont sd-plymouth tpm2-totp autodetect modconf block filesystems keyboard fsck)

I use systemd instead of udev.

diabonas commented 3 years ago

If you are using Plymouth, you need to use the plymouth-tpm2-totp mkinitcpio hook instead of tpm2-totp. (This hook is not part of the Arch Linux package because Plymouth is not officially supported there, so you need to install tpm2-totp-git from the AUR or compile from source instead.)

bigfreak85 commented 3 years ago

thx for the Info. I have build from source and now when i change my Hooks to:

HOOKS=(base udev consolefont plymouth plymouth-tpm2-totp autodetect modconf block filesystems keyboard fsck) i get the generated OTP displayed in Plymouth

But if i use this HOOKS line HOOKS=(systemd consolefont sd-plymouth plymouth-tpm2-totp autodetect modconf block filesystems keyboard fsck) nothing happens. i think the /usr/bin/plymouth-tpm2-totp is not started because i dont use udev (rule?)

diabonas commented 3 years ago

Appearently mkinitcpio runtime hooks are not triggered in systemd-based initramfs images:

Note: Runtime hooks are only used by busybox init. systemd hook triggers a systemd based init, which does not run any runtime hooks but uses systemd units instead.

Can you try building my work in progress branch sd-plymouth-tpm2-totp? It includes a systemd service as an alternative to the BusyBox runtime hook to start plymouth-tpm2-totp and should hopefully work out of the box after replacing plymouth-tpm2-totp with sd-plymouth-tpm2-totp in the HOOKS variable.

bigfreak85 commented 3 years ago

as you said works out of the box! Thx

diabonas commented 3 years ago

Great, thank you for testing! I have submitted my branch as #75, so this feature will make it to the tpm2-totp-git AUR package soon.