Skip to content

Commit 3aee53a

Browse files
committed
move integrity modules to kmod_auto
cryptsetup doesn't automatically enable required ones Signed-off-by: Zen <[email protected]>
1 parent 28d5514 commit 3aee53a

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/ugrd/crypto/cryptsetup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ 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["kernel_modules"] = "dm_integrity"
241+
self["_kmod_auto"] = "dm_integrity"
242242
return integrity_type
243243

244244

src/ugrd/fs/mounts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ def _autodetect_dm(self, mountpoint, device=None) -> None:
562562
self.logger.info(f"[{c_(dev_name, 'blue')}] Slave is a CRYPT-SUBDEV, using its slave instead: {c_(slave_source, 'cyan')}")
563563
# Add the kmod for it
564564
self.logger.info(f"[{c_(dev_name, 'blue')}] Adding kmod for CRYPT-SUBDEV: {c_('dm-crypt', 'magenta')}")
565-
self["kernel_modules"] = "dm_integrity"
565+
self["_kmod_auto"] = "dm_integrity"
566566

567567
autodetect_mount_kmods(self, slave_source)
568568

tests/test_cryptsetup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def test_cryptsetup_integrity(self):
3636
generator = InitramfsGenerator(
3737
logger=self.logger,
3838
config="tests/cryptsetup_included_key.toml",
39-
kernel_modules=["dm-integrity", "hmac", "sha256"], # Specify this because its usually auto-detected during header validation
39+
_kmod_auto=["dm-integrity", "hmac", "sha256"], # Specify this because its usually auto-detected during header validation
4040
cryptsetup={"root": {"_dm-integrity": "hmac(sha256)"}}, # Use the type like defined in the header, not the proper args to test processing
4141
)
4242
generator.build()

0 commit comments

Comments
 (0)