diff options
author | Antonio Alvarez Feijoo <antonio.feijoo@suse.com> | 2021-11-23 14:53:18 +0100 |
---|---|---|
committer | Jóhann B. Guðmundsson <johannbg@gmail.com> | 2021-11-24 06:49:39 +0000 |
commit | 5d990a004b5ae6863f2c9a633b184c07dd73563d (patch) | |
tree | 4a0eb2b25133e03f8453fcbab7cf13bb7a176e86 | |
parent | bf8738d31ca53ad6410c46c1f9b2a4a12273b9a3 (diff) | |
download | dracut-5d990a004b5ae6863f2c9a633b184c07dd73563d.tar.gz |
feat(crypt): check if tpm2-tss module is needed in hostonly mode
In hostonly mode, include the tpm2-tss module if any encrypted volumes
are configured to be decrypted using the TPM2 device.
-rwxr-xr-x | modules.d/90crypt/module-setup.sh | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/modules.d/90crypt/module-setup.sh b/modules.d/90crypt/module-setup.sh index acb9cf83..639d9cdd 100755 --- a/modules.d/90crypt/module-setup.sh +++ b/modules.d/90crypt/module-setup.sh @@ -18,7 +18,14 @@ check() { # called by dracut depends() { - echo dm rootfs-block + local deps + deps="dm rootfs-block" + if [[ $hostonly && -f "$dracutsysrootdir"/etc/crypttab ]]; then + if grep -q "tpm2-device=" "$dracutsysrootdir"/etc/crypttab; then + deps+=" tpm2-tss" + fi + fi + echo "$deps" return 0 } |