Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 779424 - sys-kernel/genkernel-4.2.1-r1 break FIRMWARE_FILES in /etc/genkernel.conf
Summary: sys-kernel/genkernel-4.2.1-r1 break FIRMWARE_FILES in /etc/genkernel.conf
Status: UNCONFIRMED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: genkernel (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-30 20:02 UTC by Bogdan
Modified: 2021-10-15 12:54 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bogdan 2021-03-30 20:02:59 UTC
In sys-kernel/genkernel-4.1.2-r3, "genkernel all" finished successfull with next config:

# grep FIRMWARE_FILES /etc/genkernel.conf
FIRMWARE_FILES+=" amd-ucode/microcode_amd_fam17h.bin amd/amd_sev_fam17h_model0xh.sbin"
FIRMWARE_FILES+=" regulatory.db regulatory.db.p7s"
FIRMWARE_FILES+=" rtw88/rtw8822c_wow_fw.bin  rtw88/rtw8822c_fw.bin"
FIRMWARE_FILES+=" rtl_bt/rtl8822cu_fw.bin rtl_bt/rtl8822cu_config.bin"
FIRMWARE_FILES+=" mt7601u.bin"
FIRMWARE_FILES+=" amdgpu/renoir_asd.bin amdgpu/renoir_ce.bin amdgpu/renoir_dmcub.bin amdgpu/renoir_gpu_info.bin amdgpu/renoir_me.bin amdgpu/renoir_mec.bin amdgpu/renoir_mec2.bin amdgpu/renoir_pfp.bin amdgpu/renoir_rlc.bin amdgpu/renoir_sdma.bin amdgpu/renoir_vcn.bin"

In sys-kernel/genkernel-4.2.1-r1, "genkernel all" finished with an error:

# genkernel all
* Gentoo Linux Genkernel; Version 4.2.1
* Using genkernel configuration from '/etc/genkernel.conf' ...
* Running with options: all
* ERROR: --firmware-files contains value ' amd-ucode/microcode_amd_fam17h.bin amd/amd_sev_fam17h_model0xh.sbin regulatory.db regulatory.db.p7s rtw88/rtw8822c_wow_fw.bin rtw88/rtw8822c_fw.bin rtl_bt/rtl8822cu_fw.bin rtl_bt/rtl8822cu_config
.bin mt7601u.bin amdgpu/renoir_asd.bin amdgpu/renoir_ce.bin amdgpu/renoir_dmcub.bin amdgpu/renoir_gpu_info.bin amdgpu/renoir_me.bin amdgpu/renoir_mec.bin amdgpu/renoir_mec2.bin amdgpu/renoir_pfp.bin amdgpu/renoir_rlc.bin amdgpu/renoir_sdm
a.bin amdgpu/renoir_vcn.bin' which was not found in '/lib/firmware'!
* Please consult '/var/log/genkernel.log' for more information and any
* errors that were reported above.
*
* Report any genkernel bugs to bugs.gentoo.org and
* assign your bug to genkernel@gentoo.org. Please include
* as much information as you can in your bug report; attaching
* '/var/log/genkernel.log' so that your issue can be dealt with effectively.
*
* Please do *not* report kernel compilation failures as genkernel bugs!
*

If I reorganize all FIRMWARE_FILES+="*" variables into one signle variable, than genkernel finished successfull:

# grep FIRMWARE_FILES /etc/genkernel.conf -A5
FIRMWARE_FILES="amd-ucode/microcode_amd_fam17h.bin amd/amd_sev_fam17h_model0xh.sbin
  regulatory.db regulatory.db.p7s
  rtw88/rtw8822c_wow_fw.bin  rtw88/rtw8822c_fw.bin
  rtl_bt/rtl8822cu_fw.bin rtl_bt/rtl8822cu_config.bin
  mt7601u.bin
  amdgpu/renoir_asd.bin amdgpu/renoir_ce.bin amdgpu/renoir_dmcub.bin amdgpu/renoir_gpu_info.bin amdgpu/renoir_me.bin amdgpu/renoir_mec.bin amdgpu/renoir_mec2.bin amdgpu/renoir_pfp.bin amdgpu/renoir_rlc.bin amdgpu/renoir_sdma.bin"

Please, revert old behavior, where I can changing single variable in multiple places of a config file.
Comment 1 Thomas Deutschmann (RETIRED) gentoo-dev 2021-04-02 13:41:25 UTC
No, this was actually a bugfix, see https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=9722fb1b99011c720459fa5f11e9b78929b060ac for more details.

tl;dr
Use comma-separated instead of space-separated list.
This will work with your existing configuration, you just have to update it.
Comment 2 Bogdan 2021-04-02 21:35:46 UTC
Please, improve normalization of FIRMWARE_FILES value before parsing:
1) remove spaces at start of line and at end of line:
Normalize line from:
  FIRMWARE_FILES=" amd-ucode/microcode_amd_fam17h.bin,amd/amd_sev_fam17h_model0xh.sbin "
Normalize line to:
  FIRMWARE_FILES=" amd-ucode/microcode_amd_fam17h.bin,amd/amd_sev_fam17h_model0xh.sbin"
2) remove spaces beetwen comma (symbol ',') and next non-space character:
Normalize line from:
  FIRMWARE_FILES="amd-ucode/microcode_amd_fam17h.bin, amd/amd_sev_fam17h_model0xh.sbin"
Normalize line to:
  FIRMWARE_FILES="amd-ucode/microcode_amd_fam17h.bin,amd/amd_sev_fam17h_model0xh.sbin"

With those 2 rules, line:
  FIRMWARE_FILES=" amd-ucode/microcode_amd_fam17h.bin, amd/amd_sev_fam17h_model0xh.sbin"
will be normalized to:
  FIRMWARE_FILES="amd-ucode/microcode_amd_fam17h.bin,amd/amd_sev_fam17h_model0xh.sbin"
and parsed correctly.
Comment 3 Thomas Deutschmann (RETIRED) gentoo-dev 2021-04-02 23:10:41 UTC
I doubt that this will happen. It's written in Bash and something like trimming isn't that easy. And why should we spend time on this when all you have to do is fixing your config?

It isn't that hard to change

> FIRMWARE_FILES="amd-ucode/microcode_amd_fam17h.bin amd/amd_sev_fam17h_model0xh.sbin"
> FIRMWARE_FILES+=" regulatory.db regulatory.db.p7s"
> FIRMWARE_FILES+=" rtw88/rtw8822c_wow_fw.bin  rtw88/rtw8822c_fw.bin"
> FIRMWARE_FILES+=" rtl_bt/rtl8822cu_fw.bin rtl_bt/rtl8822cu_config.bin"
> FIRMWARE_FILES+=" mt7601u.bin"
> FIRMWARE_FILES+=" amdgpu/renoir_asd.bin amdgpu/renoir_ce.bin amdgpu/renoir_dmcub.bin"

to something like

> FIRMWARE_FILES="amd-ucode/microcode_amd_fam17h.bin,amd/amd_sev_fam17h_model0xh.sbin"
> FIRMWARE_FILES+=",regulatory.db,regulatory.db.p7s"
> FIRMWARE_FILES+=",rtw88/rtw8822c_wow_fw.bin,rtw88/rtw8822c_fw.bin"
> FIRMWARE_FILES+=",rtl_bt/rtl8822cu_fw.bin,rtl_bt/rtl8822cu_config.bin"
> FIRMWARE_FILES+=",mt7601u.bin"
> FIRMWARE_FILES+=",amdgpu/renoir_asd.bin,amdgpu/renoir_ce.bin,amdgpu/renoir_dmcub.bin"
Comment 4 Boris Carvajal 2021-08-02 10:44:21 UTC
Sadly, this broke my setup:

FIRMWARE_FILES="i915/kbl*"

I was using Bash globbing, it wasn't documented at all but it was working pretty well.