-
Notifications
You must be signed in to change notification settings - Fork 327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modules and firmware includes #3312
base: main
Are you sure you want to change the base?
Conversation
5e6af61
to
0177fd9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems unnecessarily complicated, why not loop over required
, calls resolve()
on each entry and add all resolved paths to required
as well?
The kernel module include/exclude logic matches against paths below any folder in /usr/lib/modules/$(uname -r)/*/, and not just the `kernel` folder. Mention other common folder such as `extra` and `updates` in the documentation too, to avoid confused users.
0177fd9
to
aadac1d
Compare
Okay, spent some time to get to know |
Also removed the unconditional include of modules / firmwares below an |
aadac1d
to
623881c
Compare
623881c
to
6cc4454
Compare
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.
6cc4454
to
21b9a1a
Compare
relative to the `/usr/lib/modules/<kver>/kernel` directory (note that they match against modules in the | ||
`updates` and `extra` sibling directories too). mkosi checks for a match anywhere in the module path (e.g. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this would be clearer:
relative to the `/usr/lib/modules/<kver>/kernel` directory (note that they match against modules in the | |
`updates` and `extra` sibling directories too). mkosi checks for a match anywhere in the module path (e.g. | |
relative to the `/usr/lib/modules/<kver>` directory. mkosi checks for a match anywhere in the module path (e.g. |
mentioning the updates
and extra
directories explicitly only obscures that, we look relative to that.
# results in dangling symlinks in the final image. | ||
for fw in firmware.copy(): | ||
if (root / fw).is_symlink(): | ||
target = Path(chase(root, fw)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
target = Path(chase(root, fw)) | |
target = Path(chase(os.fspath(root), os.fspath(fw))) |
is needed here to appease mypy.
In order to include out-of-tree modules (and their required firmware) installed in an
updates
subfolder, a special case is added when a file is found below that folder.Furthermore, a firmware file required by a module might be a symbolic link to the real firmware file. Add handling of this case too.