Use of the MODULESD_<modulename>_{ADDITIONS,ALIASES,EXAMPLES} variables do not currently work with external modules that are hyphenated. The current behavior results in an invalid modprobe.d file containing partially evaluated content. This appears to be due to use of ${currm} rather than ${currm_t} when referencing variables. A patch has been attached that will correct this issue. Reproducible: Always Steps to Reproduce: 1. Create an ebuild that uses the linux-mod eclass for an external kernel module that contains a hyphen in the name (eg. foo-bar). 2. Define MODULESD_FOO_BAR_ADDITIONS=("quux addition") 3. Build and inspect ${D}/etc/modprobe.d/foo-bar.conf Actual Results: ${D}/etc/modprobe.d/foo-bar.conf contains: BAR_ADDITIONS[0] Expected Results: ${D}/etc/modprobe.d/foo-bar.conf contains: quux addition This appears to have flown under the radar for some time; most out-of-tree kernel modules are not hyphenated and MODULESD_<modulename>_ADDITIONS does not appear to be used in the portage tree.
Created attachment 847254 [details, diff] Proposed fix
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2bd0e2bb9236fe31224a6d8984ce85a38add6849 commit 2bd0e2bb9236fe31224a6d8984ce85a38add6849 Author: Mike Pagano <mpagano@gentoo.org> AuthorDate: 2023-01-11 14:07:55 +0000 Commit: Mike Pagano <mpagano@gentoo.org> CommitDate: 2023-01-11 14:07:55 +0000 linux-mod.eclass: Fix MODULESD_* for hyphenated modules Use of the MODULESD_<modulename>_{ADDITIONS,ALIASES,EXAMPLES} variables do not currently work with external modules that are hyphenated. The current behavior results in an invalid modprobe.d file containing partially evaluated content. This appears to be due to use of ${currm} rather than ${currm_t} when Referencing variables. This changes the use of ${currm} to ${currm_t} when referencing variables to resolve this issue. Closes: https://bugs.gentoo.org/889752 Author: Steven Stallion <steven.stallion@sony.com> Signed-off-by: Mike Pagano <mpagano@gentoo.org> eclass/linux-mod.eclass | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)