Gentoo Archives: gentoo-dev

From: Patrick McLean <chutzpah@g.o>
To: gentoo-dev@l.g.o
Cc: kernel@g.o, Steven Stallion <steven.stallion@××××.com>
Subject: [gentoo-dev] [PATCH] linux-mod.eclass: Fix MODULESD_* for hyphenated modules (bug #889752)
Date: Thu, 05 Jan 2023 00:06:53
Message-Id: 20230105000643.1313451-1-chutzpah@gentoo.org
1 From: Steven Stallion <steven.stallion@××××.com>
2
3 Use of the MODULESD_<modulename>_{ADDITIONS,ALIASES,EXAMPLES} variables do not
4 currently work with external modules that are hyphenated. The current behavior
5 results in an invalid modprobe.d file containing partially evaluated content.
6
7 This appears to be due to use of ${currm} rather than ${currm_t} when
8 Referencing variables. This changes the use of ${currm} to ${currm_t} when
9 referencing variables to resolve this issue.
10
11 Closes: https://bugs.gentoo.org/889752
12 ---
13 eclass/linux-mod.eclass | 8 ++++----
14 1 file changed, 4 insertions(+), 4 deletions(-)
15
16 diff --git a/eclass/linux-mod.eclass b/eclass/linux-mod.eclass
17 index d14bbf7d9ea..6cf9969b19a 100644
18 --- a/eclass/linux-mod.eclass
19 +++ b/eclass/linux-mod.eclass
20 @@ -408,7 +408,7 @@ generate_modulesd() {
21
22 for((t=0; t<${module_aliases}; t++))
23 do
24 - echo "alias $(eval echo \${MODULESD_${currm}_ALIASES[$t]})" \
25 + echo "alias $(eval echo \${MODULESD_${currm_t}_ALIASES[$t]})" \
26 >> "${module_config}"
27 done
28 echo '' >> "${module_config}"
29 @@ -434,7 +434,7 @@ generate_modulesd() {
30 fi
31
32 #-----------------------------------------------------------------------
33 - if [[ $(eval echo \${MODULESD_${currm}_ALIASES[0]}) == guess ]]; then
34 + if [[ $(eval echo \${MODULESD_${currm_t}_ALIASES[0]}) == guess ]]; then
35 # So, let's do some guesswork, eh?
36 if [[ -n ${module_opts} ]]; then
37 echo "# For Example..." >> "${module_config}"
38 @@ -449,7 +449,7 @@ generate_modulesd() {
39 echo "# For Example..." >> "${module_config}"
40 echo "# --------------" >> "${module_config}"
41 for ((t=0; t<${module_examples}; t++)); do
42 - echo "options $(eval echo \${MODULESD_${currm}_EXAMPLES[$t]})" \
43 + echo "options $(eval echo \${MODULESD_${currm_t}_EXAMPLES[$t]})" \
44 >> "${module_config}"
45 done
46 echo '' >> "${module_config}"
47 @@ -458,7 +458,7 @@ generate_modulesd() {
48 #-----------------------------------------------------------------------
49 if [[ ${module_additions} -gt 0 ]]; then
50 for ((t=0; t<${module_additions}; t++)); do
51 - echo "$(eval echo \${MODULESD_${currm}_ADDITIONS[$t]})" \
52 + echo "$(eval echo \${MODULESD_${currm_t}_ADDITIONS[$t]})" \
53 >> "${module_config}"
54 done
55 echo '' >> "${module_config}"
56 --
57 2.39.0

Replies