firmware: copy only the necessary firmware(s) into initramfs - #40
firmware: copy only the necessary firmware(s) into initramfs#40reagentoo wants to merge 1 commit into
Conversation
|
This is a great idea, but why hijack the original setting and make a new setting for the original way? How about a new MINFIRMWARE or something like that? |
Because similar to |
|
Changing (especially long term) behavior in such an incompatible way makes for a terrible user experience. I can't imagine that I am the only one who builds kernels and distributes them to multiple systems, but also there probably are not a lot of us either.... |
|
Compatibility preserved. |
60ae245 to
e5d0945
Compare
|
@FlyingWaffleDev, can you please check this patch on your configuration? In particular this: (Or set your drm-module in In my case, the savings were ~300M for the last kernel (5.15.44), compared to what was mentioned in #29 (comment): |
|
@reagentoo Looks good! It works with my plymouth patch and saved me ~93M. |
|
|
||
| modlist+=( "${mymod/#${modules_srcdir}\//}" ) | ||
| done 3< <( ( | ||
| modinfo -b "${KERNEL_MODULES_PREFIX%/}" -k "${KV}" -F filename ${GK_INITRAMFS_KMODULES} 2>/dev/null |
There was a problem hiding this comment.
does this work in the cross-compile kernels?
There was a problem hiding this comment.
I tried to copy /lib/modules/*-gentoo-dist dir into /mnt/prefix, and modinfo -b ... -k ... worked.
There was a problem hiding this comment.
I plan to make improvements to this place in the future. Something like:
modinfo ... || echo - handle bad status from modinfo in the while.
But for this I will need to make some changes to the gen_moddeps.sh. This will increase the predictability of the script. I think it would be better to make it a separate commit. Currently, everything should work reliably, unexpected errors will be logged and filtered in determine_initramfs_kmodules().
|
I left a bunch of singleton comments. I like the savings, but i'm also worried about the overall risk of unbootable systems. There IS something useful that did stand out to me: can you double-check if the existing code captures dependency modules at all? e.g. |
This question about how |
e5d0945 to
b3d996a
Compare
b3d996a to
c5e9459
Compare
|
|
c5e9459 to
fdf7867
Compare
fdf7867 to
e32b3c8
Compare
|
@robbat2 Hi. What method of gen module deps do you prefer ( It looks like the same module has 2 names and one ko-file. (alias?) In the latest commit I've simplified the UPD: |
e32b3c8 to
32f5292
Compare
|
@robbat2 Tested for several weeks. Looking forward for new comments on the new |
32f5292 to
455d213
Compare
455d213 to
ebd1fa3
Compare
|
@robbat2 Hi. Any chance to promote this commit? |
ebd1fa3 to
6345267
Compare
6345267 to
fa287f0
Compare
1b3ffd9 to
d779d1c
Compare
FIRMWARE=yes behavior is changed: Only the minimum number of firmware files will be copied. The list is generated using the `modinfo -F firmware [modules]...` command. The ability to copy all firmware(s) is also available with a new ALLFIRMWARE setting (see the modified genkernel.conf for more details). As for changes in the source code: gen_moddeps.sh: Significantly redesigned module list generation. To get a list of modules, use the `mod_dep_list()` function instead of `gen_dep_list()`. Modules that are not in the kernel (=n or invalid) will be filtered out. Aliases will be replaced with real names (including dependencies). Signed-off-by: Dmitry Baranov <reagentoo@gmail.com>
d779d1c to
8c03bbf
Compare
|
Hello, I'd like to up this PR in hope to get more recognition. Can we hopefully get this merged? |
@timkenhan Hi. Have you tried to apply and test it? |
ZeroChaos-
left a comment
There was a problem hiding this comment.
I don't work on genkernel much lately, but this all looks good to me.
|
@reagentoo here's the result:
Last but not least, |
@timkenhan Have you got HD picture in Plymouth? Maybe you don't have enough modules/firmwares. /etc/genkernel.conf: |
|
Not sure what HD picture should be like, but the boot splash does improve after applying your suggestion After putting Also can you document this AMODULES_MISC option? At least put it on the genkernel.conf. Might help other users as well. Here's the list of files under initramfs lib/firmware with AMODULES_MISC and here's one without |
This can be done in separate PR-s. |
|
Thanks for your patience and thanks all for testing too. Could you do the (unrelated) docs in a followup please? |
Thanks. Please assign me in bugzilla if we will have any related issues.
I'll prepare few commits for the new PR. |
FIRMWARE=yes behavior is changed:
Only the minimum number of firmware files will be copied.
The list is generated using the
modinfo -F firmware [modules]...command.The ability to copy all firmware(s) is also available with a new
ALLFIRMWARE setting (see the modified genkernel.conf for more details).
As for changes in the source code:
gen_moddeps.sh: Significantly redesigned module list generation.
To get a list of modules, use the
mod_dep_list()function insteadof
gen_dep_list(). Modules that are not in the kernel (=n or invalid)will be filtered out. Aliases will be replaced with real names
(including dependencies).