genkernel 4.3.15 introduced the following globbing mechanism for firmware files to be included: --8<-- snip --8<-- myfw_f=( $(compgen -G "${FIRMWARE_DIR}/${myfw}*") ) if [ ${#myfw_f[@]} -gt 1 ] then gen_die "excessive number of firmwares!" fi --8<-- snap --8<-- This effectively breaks including 'regulatory.db' because the file 'regulatory.db.p7s' exists as well, matching the globbing check. Why on earth is globbing with '*' appended to the firmware files specified being applied?! Related commit: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=cc7d5e1e32a88dc2a4f144ce6ac9a92a2d679b05
Because the modinfo generates firmware list without compression extension. For example: # modinfo -F firmware amdgpu ... amdgpu/navi12_rlc.bin amdgpu/navi12_mec2.bin amdgpu/navi12_mec.bin amdgpu/navi12_me.bin amdgpu/navi12_pfp.bin amdgpu/navi12_ce.bin ... # ls -1 /lib/firmware/amdgpu/navi12_rlc.bin* /lib/firmware/amdgpu/navi12_rlc.bin.xz Looks like we should just get rid "-gt 1" case to reduce the severity level.
(In reply to Dmitriy Baranov from comment #1) > Because the modinfo generates firmware list without compression extension. > [...] Then it still doesn't make sense to glob with just '*' at the end :-) According to the CONFIG_MODULE_COMPRESS_* options I found, the only supported compression algorithms are gzip, xz and zstd, so the extensions to look for are limited accordingly. > Looks like we should just get rid "-gt 1" case to reduce the severity level. Best would be to check the config options with kconfig_get_opt and add a fixed extension to the file accordingly: CONFIG_MODULE_COMPRESS_NONE: no extension CONFIG_MODULE_COMPRESS_GZIP: extension '.gz' CONFIG_MODULE_COMPRESS_XZ: extension '.xz' CONFIG_MODULE_COMPRESS_ZSTD: extension '.zst' (see 'grep CONFIG_MODULE_COMPRESS_ /usr/src/linux/scripts/Makefile.modinst') Should be easy, right? :)
(In reply to Wolfram Schlich from comment #2) > Then it still doesn't make sense to glob with just '*' at the end :-) > > According to the CONFIG_MODULE_COMPRESS_* options I found, the only > supported compression algorithms are gzip, xz and zstd, so the extensions to > look for are limited accordingly. I was aware of CONFIG_MODULE_COMPRESS_* before I made these commits. I consciously chose to use "'*' at the end." > Should be easy, right? :) If you dig deeper, a number of difficulties become apparent: - It is necessary to take into account not only the firmwares but also the modules - Not all firmware files are packed. ('regulatory.db' is not packed for me) - Kernel modules can have different extensions (modules from packages outside the kernel) However, to get rid of '*', you can try to copy files with all possible extensions (including those without). Although, as a temporary solution, I suggest simply removing the "-gt 1" case. PR is welcome.
Created attachment 896429 [details, diff] remove -gt 1 case Workaround (as suggested, remove the '-gt -1' test) for others hitting this issue.
great, stabilizing genkernel 4.3.16 finally brought this stupid bug to a broader audience without being fixed.
(In reply to Wolfram Schlich from comment #5) > great, stabilizing genkernel 4.3.16 finally brought this stupid bug to a > broader audience without being fixed. Please attach a patch and I'll get it out ASAP
Created attachment 911896 [details, diff] patch commenting out -gt 1 case Here you go. It's essentially the same as the patch already attached to this bug since 25 Jun 2024 which just removed the lines instead of commenting them out.
Thanks, you did not comment on the previous patch so I wasn't sure if that was a suitable fix for you.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=21da5b2fe83a113d2ea29919fb472ac29f7057e5 commit 21da5b2fe83a113d2ea29919fb472ac29f7057e5 Author: Ben Kohler <bkohler@gentoo.org> AuthorDate: 2024-11-25 17:04:24 +0000 Commit: Ben Kohler <bkohler@gentoo.org> CommitDate: 2024-11-25 17:31:08 +0000 sys-kernel/genkernel: revbump for several fixes Fixes globbing bug, adds musl patches, and fixes lvm2 build for non-systemd users. Bug: https://bugs.gentoo.org/944499 Bug: https://bugs.gentoo.org/932907 Bug: https://bugs.gentoo.org/934773 Signed-off-by: Ben Kohler <bkohler@gentoo.org> sys-kernel/genkernel/Manifest | 1 + .../genkernel-4.3.16-globbing-workaround.patch | 19 ++ .../genkernel/files/genkernel-4.3.16-musl.patch | 297 +++++++++++++++++++++ .../files/genkernel-4.3.16-posix-shell.patch | 38 +++ .../lvm2-2.03.20-dm_lvm_rules_no_systemd.patch | 11 + sys-kernel/genkernel/genkernel-4.3.16-r1.ebuild | 291 ++++++++++++++++++++ sys-kernel/genkernel/genkernel-9999.ebuild | 13 +- 7 files changed, 668 insertions(+), 2 deletions(-)