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.