From: Daan De Meyer Date: Sun, 19 Jan 2025 19:34:31 +0000 (+0100) Subject: Allow adding kernel modules in extension images X-Git-Tag: v25~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6f04eee659ccf883892d77eb161e85ec6f50d92d;p=thirdparty%2Fmkosi.git Allow adding kernel modules in extension images When building standalone extension images (without Overlay=yes), let's process kernel modules but not run depmod. depmod produces a single monolithic file which means we can't extend it from an extension image without overriding the base file. --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index df2f229c1..3a7c03999 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -2778,7 +2778,23 @@ def configure_clock(context: Context) -> None: def run_depmod(context: Context, *, cache: bool = False) -> None: - if context.config.overlay or context.config.output_format.is_extension_or_portable_image(): + if context.config.overlay: + return + + if not cache: + for kver, _ in gen_kernel_images(context): + process_kernel_modules( + context.root, + kver, + include=finalize_kernel_modules_include( + context, + include=context.config.kernel_modules_include, + host=context.config.kernel_modules_include_host, + ), + exclude=context.config.kernel_modules_exclude, + ) + + if context.config.output_format.is_extension_or_portable_image(): return outputs = ( @@ -2800,18 +2816,6 @@ def run_depmod(context: Context, *, cache: bool = False) -> None: if all(m.stat().st_mtime <= mtime for m in modulesd.rglob("*.ko*")): continue - if not cache: - process_kernel_modules( - context.root, - kver, - include=finalize_kernel_modules_include( - context, - include=context.config.kernel_modules_include, - host=context.config.kernel_modules_include_host, - ), - exclude=context.config.kernel_modules_exclude, - ) - with complete_step(f"Running depmod for {kver}"): run(["depmod", "--all", kver], sandbox=chroot_cmd(root=context.root))