Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 889752

Summary: linux-mod.eclass: MODULESD_* broken for hyphenated modules
Product: Gentoo Linux Reporter: Steven Stallion <sstallion>
Component: EclassesAssignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers <kernel>
Status: RESOLVED FIXED    
Severity: normal CC: chutzpah
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Proposed fix

Description Steven Stallion 2023-01-04 20:13:41 UTC
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.
Comment 1 Steven Stallion 2023-01-04 20:14:11 UTC
Created attachment 847254 [details, diff]
Proposed fix
Comment 2 Larry the Git Cow gentoo-dev 2023-01-11 14:09:02 UTC
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(-)