From: Daan De Meyer Date: Tue, 8 Apr 2025 14:41:29 +0000 (+0200) Subject: Don't use gen_kernel_images() in run_depmod() X-Git-Tag: v26~256 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5793e64958520cfb5d853c843e9e46219ad320e4;p=thirdparty%2Fmkosi.git Don't use gen_kernel_images() in run_depmod() We don't actually care about kernel images in this function, so let's not depend on those being present. Fixes #3670 --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index dd4ca8de4..57a759c62 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -2967,10 +2967,13 @@ def run_depmod(context: Context, *, cache: bool = False) -> None: return if not cache: - for kver, _ in gen_kernel_images(context): + for modulesd in (context.root / "usr/lib/modules").glob("*"): + if not modulesd.is_dir(): + continue + process_kernel_modules( context, - kver, + modulesd.name, modules_include=finalize_kernel_modules_include( context, include=context.config.kernel_modules_include, @@ -2991,8 +2994,9 @@ def run_depmod(context: Context, *, cache: bool = False) -> None: "modules.symbols.bin", ) - for kver, _ in gen_kernel_images(context): - modulesd = context.root / "usr/lib/modules" / kver + for modulesd in (context.root / "usr/lib/modules").glob("*"): + if not modulesd.is_dir(): + continue if ( not cache @@ -3003,8 +3007,8 @@ def run_depmod(context: Context, *, cache: bool = False) -> None: if all(m.stat().st_mtime <= mtime for m in modulesd.rglob("*.ko*")): continue - with complete_step(f"Running depmod for {kver}"): - run(["depmod", "--all", kver], sandbox=chroot_cmd(root=context.rootoptions)) + with complete_step(f"Running depmod for {modulesd.name}"): + run(["depmod", "--all", modulesd.name], sandbox=chroot_cmd(root=context.rootoptions)) def run_sysusers(context: Context) -> None: