From: DaanDeMeyer Date: Thu, 25 Dec 2025 20:41:11 +0000 (+0100) Subject: kmod: Reorder ko extension list X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1b970de3e32fa2ebad1dd38b30913bdad2162e67;p=thirdparty%2Fmkosi.git kmod: Reorder ko extension list 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. --- diff --git a/mkosi/kmod.py b/mkosi/kmod.py index 590f96cc3..ae296cb45 100644 --- a/mkosi/kmod.py +++ b/mkosi/kmod.py @@ -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: