From: DaanDeMeyer Date: Mon, 25 Aug 2025 19:55:38 +0000 (+0200) Subject: kmod: Narrow glob used to select firmware X-Git-Tag: v26~137^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9f84678d458410b2c96e6e4c7950e262a2818b32;p=thirdparty%2Fmkosi.git kmod: Narrow glob used to select firmware We want to select the firmware regardless of which compression extension it has, but let's insist on having at least a '.' which indicates what follows is an extension in the first place. --- diff --git a/mkosi/kmod.py b/mkosi/kmod.py index cb23d80a5..799bb6a2d 100644 --- a/mkosi/kmod.py +++ b/mkosi/kmod.py @@ -276,9 +276,13 @@ def resolve_module_dependencies( depends.update(normalize_module_name(d) for d in value.split() if not d.endswith(":")) elif key == "firmware": - glob = "" if value.endswith("*") else "*" - fw = [f for f in Path("usr/lib/firmware").glob(f"{value}{glob}")] - firmware.update(fw) + if (Path("usr/lib/firmware") / value).exists(): + firmware.add(Path("usr/lib/firmware") / value) + + glob = "" if value.endswith("*") else ".*" + + for fw in Path("usr/lib/firmware").glob(f"{value}{glob}"): + firmware.add(fw) elif key == "name": # The file names use dashes, but the module names use underscores. We track the names in