Skip to content

Commit 5d990a0

Browse files
aafeijoo-susejohannbg
authored andcommitted
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.
1 parent bf8738d commit 5d990a0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Diff for: modules.d/90crypt/module-setup.sh

+8-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,14 @@ check() {
1818

1919
# called by dracut
2020
depends() {
21-
echo dm rootfs-block
21+
local deps
22+
deps="dm rootfs-block"
23+
if [[ $hostonly && -f "$dracutsysrootdir"/etc/crypttab ]]; then
24+
if grep -q "tpm2-device=" "$dracutsysrootdir"/etc/crypttab; then
25+
deps+=" tpm2-tss"
26+
fi
27+
fi
28+
echo "$deps"
2229
return 0
2330
}
2431

0 commit comments

Comments
 (0)