Dracut module to unseal TPM and retrieve password to pass to LUKS
dracut tpm2-tools cryptsetup
The following should be set in the kernel commandline:
rd.luks.key # Default: /crypto_keyfile.bin
rd.luks_tpm2_auth # Default: pcr:sha1:0,2,4,7
rd.luks_tpm2_handle # Default: 0x81000000
The package is available on the AUR as dracut-luks-tpm2
.
$ git clone https://github.com/mihirlad55/dracut-luks-tpm2
$ cd dracut-luks-tpm2
$ ./install.sh
This was adapted from the mkinitcpio hook by pawitp which can be found at https://github.com/pawitp/arch-luks-tpm.
For more info on setting up the TPM, I highly recommend checking out pawitp's articles on Medium: