-
Notifications
You must be signed in to change notification settings - Fork 402
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
dracut: add support for one only module groups #2309
base: master
Are you sure you want to change the base?
Conversation
…se one. This adds a tag that will go into the module info, only one firmware from the group given needs to be available for this driver to work. This allows dracut to avoid adding in firmware that aren't needed. This just brackets a module list in the modinfo, the modules in the list will get entries in reversed order so the last module in the list is the preferred one. The corresponding dracut code it at: dracutdevs/dracut#2309 Cc: Luis Chamberlain <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Dave Airlie <[email protected]>
The kernel patch is: |
Given that some firmwares may come with bug/security fixes, shouldn't the order of module firmwares inside a group be specified to mean something? As in, the first firmware specified would be the least wanted/oldest, and the newest one would be the preferred? |
It is defined by how the module info section is populated. It just happens that it's populated in reverse, so the last firmware you specify in the kernel is the first one dracut tries. I can't think of anyway to define it better that would be backwards compatible. |
I think the code and the logic is sound. Sure, the interface is quirky, but what matters is that you document in what order the fw should be listed in the kernel drivers' source code, and the expected result in the module info section. As for dracut, please add a comment about the expected ordering from the module info, so that the interface is clear. This should make it easier on both kernel and initramfs developers to know what's the expectation, reducing the chances of screwups on either sides that would silently lead to differences between drivers and distros. WDYT? |
4357772
to
3be5c40
Compare
Thanks @airlied! |
I also assume the procedure would be to get sign off on the kernel side first before landing this. |
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 also assume the procedure would be to get sign off on the kernel side first before landing this.
Yes, thanks for your patch.
Meanwhile, you can fix your commit message (https://github.com/dracutdevs/dracut/actions/runs/4740463846/jobs/8440368788?pr=2309) and some formatting issues (https://github.com/dracutdevs/dracut/actions/runs/4740463843/jobs/8440368768?pr=2309)
…se one. This adds a tag that will go into the module info, only one firmware from the group given needs to be available for this driver to work. This allows dracut to avoid adding in firmware that aren't needed. This just brackets a module list in the modinfo, the modules in the list will get entries in reversed order so the last module in the list is the preferred one. The corresponding dracut code it at: dracutdevs/dracut#2309 Cc: Luis Chamberlain <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Dave Airlie <[email protected]>
This issue is being marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. If this is still an issue in the latest release of Dracut and you would like to keep it open please comment on this issue within the next 7 days. Thank you for your contributions. |
This supports the case where only a single module from a group will be put into the initramfs to keep initramfs sizes down where firmware files are getting large. The kernel will denote a group like this: MODULE_FIRMWARE_GROUP_ONLY_ONE("ga106-gsp"); MODULE_FIRMWARE_GROUP_LIST("nvidia/ga106/gsp/gsp-5303002.bin,nvidia/ga106/gsp/gsp-5258902.bin") MODULE_FIRMWARE("nvidia/ga106/gsp/gsp-5258902.bin"); MODULE_FIRMWARE("nvidia/ga106/gsp/gsp-5303002.bin"); MODULE_FIRMWARE_GROUP_ONLY_ONE("ga106-gsp"); dracut will see the group boundaries, and only install the first found firmware from the group list. There is no simple way to keep this forwards/backwards compatible that doesn't list the firmwares twice. Old dracut should ignore the new directives, so will install all the firmwares, new dracut will ignore MODULE_FIRMWARE's found between GROUP brackets. This also avoids the problem of modinfo section ordering which it turns out isn't consistent in direction. Signed-off-by: Dave Airlie <[email protected]>
3be5c40
to
6294eec
Compare
I've updated this, and new kernel patches are https://lore.kernel.org/linux-modules/[email protected]/T/#t |
…se one. This adds two tags that will go into the module info. The first denotes a group of firmwares, when that tag is present all MODULE_FIRMWARE lines between the tags will be ignored by new versions of dracut. The second makes an explicitly ordered group of firmwares to search for inside a group setting. New dracut will pick the first available firmware from this to put in the initramfs. Old dracut will just ignore these tags and fallback to installing all the firmwares. The corresponding dracut code it at: dracutdevs/dracut#2309 Cc: Luis Chamberlain <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Dave Airlie <[email protected]>
This supports the case where only a single module from a group will be put into the initramfs to keep initramfs sizes down where firmware files are getting large.
The kernel will denote a group like this:
dracut will then scan for these group tags. It will use the group list inside the group only tags to and ignore the legacy firmware lines (which will be left in place for old dracut). It will search for the first fw in the group list and work it's way down.
The kernel driver will then handle whatever it ends up finding.
This pull request changes...
Changes
Checklist
Fixes #