-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
no TOTP displayed in systemd-based initramfs #82
Comments
Thank you for your detailed report! Could you test the following approach, please, which works at least on my machine?
/usr/lib/systemd/system/sysinit.target.wants/tpm2-totp.service needs to be a symlink to that unit file: sudo ln -s ../tpm2-totp.service /usr/lib/systemd/system/sysinit.target.wants/ /etc/initcpio/install/sd-tpm2-totp:
Now regenerate the initramfs and reboot:
I'll add some more explanation as a separate comment. |
Your unit file generally looks fine, but seems to lack a target specification when it should be executed, which might explain why it is executed too late: the service needs to be started as part of However, mkinitcpio doesn't create the necessary symlink to actually enable it automatically, so you have to create it yourself, see the
This should be handled by the |
Thanks alot, that fixed it :) The critical missing thing was actually the manual symlink in The first TOTP gets displayed 1-2 seconds after the LUKS password prompt, so still suboptimal, but at least it's there at all. On a related note, I'm not entirely sure if Oh, and just to clarify: my I can try preparing a pull requests in the coming days if you so desire. |
Great to hear :)
Yeah, that's very confusing indeed - I guess this should be fixed in mkinitcpio as well so that units under the
Same here, I think it's just the kernel module taking some time to load (which might have a somewhat low priority during boot).
I think it should be fine, according to the systemd.exec documentation the standard TTY is
The In contrast, the mkinitcpio I am not sure whether there is a better way than specifying the required kernel module statically: usually it is better to just include the necessary modules and let udev to do its job to load them on demand. That's what we do for
Sure, that would be great 🎉 |
Never mind, I just forgot to include the udev rules file in the This way, the unit file and install hook look pretty similar to the existing |
Thanks for the quick replies :)
Yeah, I realized and implemented that in the meantime as well - taking the plymouth fix from #74 serves as a pretty good skeleton. Preliminary local PKGBUILD based on Anything special to consider before making a pull request? |
Awesome :) I'll start a new release cycle once this has been merged as well.
Keeping the structure similar to #75 seems like a good idea, otherwise nothing special as far as I can think of - we use the Developers Certificate of Origin, so remember to signoff your commits ( Is the D-Bus/tpm2-abrmd error message still present in your local testing? In that case, I'd include the |
Similar to #74, TOTP is not displayed when using systemd initramfs, i.e. following
mkinitcpio.conf
hooks on Arch:HOOKS=(… systemd tpm2-totp …)
I tried writing a small systemd unit file and accompanying installation hook, but no luck.
I checked that all the files are present in the initramfs with
lsinitcpio
and tried to trace unit execution withsystemd-analyze plot
.The unit always gets started way too late in the boot process, long after
systemd-ask-password-console.service
.Also,
tpm2-totp
seemed to fail on first invocation during initramfs stage with:tpm2-totp[…]: failed to allocate dbus proxy object: Could not connect: No such file or directory
Could this be a side effect of having
tpm2-abrmd
installed? I saw that it uses dbus andusr/lib/libtss2-tcti-tabrmd.so
got included in the initramfs.On a side note - I haven't researched how to stop the service after the
initrd.target
. Right now it keeps lingering in the booted system until stopped manually.Thanks for writing awesome tpm2 tools ;)
For reference, the systemd unit (commented out parameters are from exploring possible permutations):
tpm2-totp.service
… and a small install hook:
sd-tpm2-totp
NOTE: The unit has to be installed in
/usr/lib/systemd/system
, not/etc/systemd/system
, otherwise theadd_systemd_unit
function fails silently duringmkinitcpio
and the unit doesn't get included in the initramfs.The text was updated successfully, but these errors were encountered: