Skip to content

Commit

Permalink
Include linked firmware files
Browse files Browse the repository at this point in the history
Some modules reference a firmware file that is just a link to a "real"
file. Make sure those files are also included when needed by resolving
those referenced symlinks and including their target files in the set of
required firmware files.
  • Loading branch information
hundeboll committed Jan 3, 2025
1 parent ab5731f commit aadac1d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mkosi/kmod.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,11 @@ def gen_required_kernel_modules(
mods = set(modulesd.rglob("*.ko*"))
firmware = set()

links = {
p.resolve().relative_to(root)
for p in filter(lambda fw: fw.is_symlink() and fw.exists(), map(lambda fw: root / fw, firmware))
}

yield from sorted(
itertools.chain(
{
Expand All @@ -189,6 +194,7 @@ def gen_required_kernel_modules(
},
mods,
firmware,
links,
(p.relative_to(root) for p in (root / modulesd).glob("modules*")),
)
)
Expand Down

0 comments on commit aadac1d

Please sign in to comment.