systemd-keyscript@system.service: Failed to execute command: No such file or directory
First, let me start off by saying thank you so much for creating this project. And I understand if you haven't a moment to help me. I've spent the last week or so trying to figure how to get a script to run to generate a keyfile for a rd.luks volume.
I've spent the last day playing with this project and I believe I'm closer than I've ever been.
I've followed the directions in your README and added a script called /etc/systemd-keyscript/initramfs/scripts/system.sh and the boot line is rd.luks.name={UUID}=system, and it seems that the service your script creates is running since i've seen this line in the journal:
systemd-keyscript@system.service: Failed to execute command: No such file or directory
As you can see though, it seems like it can't find the script file. I've extracted the /boot/initramfs-linux.img and have in fact seen the systemd file that was generated by your script, and the script file.
➜ cat usr/lib/systemd/system/systemd-cryptsetup@system.service:
[Unit]
Description=Keyscript prerequisite for systemd-cryptsetup@%I
Before=systemd-cryptsetup@%i.service
DefaultDependencies=no
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/etc/systemd-keyscript/scripts/%I.sh
[Install]
WantedBy=systemd-cryptsetup@%i.service
➜ cat etc/systemd-keyscript/scripts/system.sh
#!/bin/sh
echo "Creating keyfile..."
echo "Creating keyfile..." | systemd-cat
modprobe -a -q tpm_crb >/dev/null 2>&1
tpm2_unseal -c 0x81000000 -p pcr:sha1:0,8 -o /crypto_keyfile.bin
I don't seem to see "Creating keyfile..." in any logs or output.
Any ideas would be greatly appreciated, in the mean time i'll continue to try to debug.
Thanks again!