I see that @gmazyland was saying there are two ways to implement this and neither is 'cryptsetup'.
Having got it working, my solution requires modification to two files which are packaged in `cryptsetup` and `cryptsetup-initramfs` in Ubuntu, and adding one file to `/etc/initramfs-tools/hooks` (or the platform equivalent location)
I see that @gmazyland was saying there are two ways to implement this and neither is 'cryptsetup'.
Having got it working, my solution requires modification to two files which are packaged in `cryptsetup` and `cryptsetup- initramfs` in Ubuntu, and adding one file to `/etc/initramfs -tools/ hooks` (or the platform equivalent location)
I've generated minimal patches of what needs doing in my repo under the 'patches' directory. /github. com/wmcelderry/ systemd_ with_tpm2/ tree/main/ patches
https:/
and the extra hook script is under 'scripts': /github. com/wmcelderry/ systemd_ with_tpm2/ tree/main/ scripts
https:/
I'm not claiming these are the best way to implement the solution, but it makes it very clear what I have done to get it working.
If there's a better way to implement this, I'd love to hear your thoughts and integrate it.