]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
kmod: Reorder ko extension list 4092/head
authorDaanDeMeyer <daan.j.demeyer@gmail.com>
Thu, 25 Dec 2025 20:41:11 +0000 (21:41 +0100)
committerDaanDeMeyer <daan.j.demeyer@gmail.com>
Fri, 26 Dec 2025 09:03:00 +0000 (10:03 +0100)
It's unsure whether python uses a hash based lookup for this or not,
so let's list the most commonly expected extensions first. Kernel
modules tend to be compressed these days, so those are the ones we
list first, with preference to zstd and xz.

mkosi/kmod.py

index 590f96cc3402970fc0388c1286ec06e3a64c1c38..ae296cb45a06968aeb89cd325bf02aa35f7c9b07 100644 (file)
@@ -27,7 +27,7 @@ def loaded_modules() -> list[str]:
 def all_modules(modulesd: Path) -> Iterator[Path]:
     # The glob may match additional paths.
     # Narrow this down to *.ko, *.ko.gz, *.ko.xz, *.ko.zst.
-    return (m for m in modulesd.rglob("*.ko*") if m.name.endswith((".ko", ".ko.gz", ".ko.xz", ".ko.zst")))
+    return (m for m in modulesd.rglob("*.ko*") if m.name.endswith((".ko.zst", ".ko.xz", ".ko.gz", ".ko")))
 
 
 def globs_match_filename(name: str, globs: Sequence[str], *, match_default: bool = False) -> bool: