Skip to content

Commit

Permalink
feat(crypt): check if tpm2-tss module is needed in hostonly mode
Browse files Browse the repository at this point in the history
In hostonly mode, include the tpm2-tss module if any encrypted volumes
are configured to be decrypted using the TPM2 device.
  • Loading branch information
aafeijoo-suse authored and johannbg committed Nov 24, 2021
1 parent bf8738d commit 5d990a0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion modules.d/90crypt/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 5d990a0

Please sign in to comment.