Skip to content

Commit 108a6e9

Browse files
committed
add dm-integrity kmods based on header info
Signed-off-by: Zen <[email protected]>
1 parent 5aa4b2d commit 108a6e9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/ugrd/crypto/cryptsetup.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,13 @@ def _detect_luks_header_integrity(self, luks_info: dict) -> dict:
238238
Enables the dm-integrity module, and returns the integrity type."""
239239
for segment in luks_info.get("segments", {}).values():
240240
if integrity_type := segment.get("integrity", {}).get("type"):
241-
self["_kmod_auto"] = ["dm_integrity", "authenc"]
241+
integrity_kmods = ["dm_integrity", "authenc"]
242+
if integrity_type.startswith("hmac"):
243+
integrity_kmods.append("hmac")
244+
self.logger.info(
245+
f"[{c_(luks_info['name'], 'blue')}]({c_(integrity_type, 'cyan')}) Enabling kernel modules for dm-integrity: {c_(' '.join(integrity_kmods), 'magenta')}"
246+
)
247+
242248
return integrity_type
243249

244250

0 commit comments

Comments
 (0)