[systemd-devel] Ordering units and targets with devices

Michael Cassaniti michael at cassaniti.id.au
Wed Aug 17 13:23:15 UTC 2022


Hi,

I'm trying to order my units and targets during early boot so that:
1. A symlink to the specific FIDO2 token I'm using gets created. I 
already have a udev rule in place for this and it successfully creates 
the symlink under /dev. Because I have two tokens I need to specify 
which one to use.
2. The unit for systemd-cryptsetup at root.service has to wait for this 
unit. The unit gets generated from systemd-cryptsetup-generator so I 
can't just add Requires= stanzas to the unit. I do have a /etc/crypttab 
file.

I have the following shell code generating everything a the right time 
within dracut, but this hasn't solved my problem.

     cat > /etc/systemd/system/dev-yubico\x2dfido2.device << EOF
     [Unit]
     Description=Device for Yubico FIDO2 token
     DefaultDependencies=no
     RequiredBy=cryptsetup-pre.target

     [Install]
     WantedBy=cryptsetup-pre.target

     EOF

     systemctl enable dev-yubico\x2dfido2.device
     systemctl add-wants cryptsetup.target cryptsetup-pre.target


Any help here is appreciated. The issue is that the FIDO2 token shows up 
on the USB bus after the disk is detected and the unit 
systemd-cryptsetup at root.service starts. I don't have a TPM2 chip so that 
rules out using a TPM instead.

Thanks in advance,
Michael Cassaniti, Australia

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20220817/af1609cc/attachment.sig>


More information about the systemd-devel mailing list