Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 889752 - linux-mod.eclass: MODULESD_* broken for hyphenated modules
Summary: linux-mod.eclass: MODULESD_* broken for hyphenated modules
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2023-01-04 20:13 UTC by Steven Stallion
Modified: 2023-01-11 14:09 UTC (History)
1 user (show)

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


Attachments
Proposed fix (linux-mod.eclass.patch,1.63 KB, patch)
2023-01-04 20:14 UTC, Steven Stallion
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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(-)