From: Daan De Meyer Date: Thu, 18 Jan 2024 09:26:10 +0000 (+0100) Subject: Improve check for whether we have to rerun depmod X-Git-Tag: v20.2~5^2 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2301%2Fhead;p=thirdparty%2Fmkosi.git Improve check for whether we have to rerun depmod Let's check if any extra modules were dropped in by users and rerun depmod in that case. --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index 96f945605..4d5521221 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -2289,12 +2289,16 @@ def run_depmod(context: Context, *, force: bool = False) -> None: ) for kver, _ in gen_kernel_images(context): + modulesd = context.root / "usr/lib/modules" / kver + if ( not force and not context.config.kernel_modules_exclude and - all((context.root / "usr/lib/modules" / kver / o).exists() for o in outputs) + all((modulesd / o).exists() for o in outputs) ): - continue + mtime = (modulesd / "modules.dep").stat().st_mtime + if all(m.stat().st_mtime <= mtime for m in modulesd.rglob("*.ko*")): + continue process_kernel_modules( context.root, kver,