public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH] linux-mod.eclass: Fix MODULESD_* for hyphenated modules (bug #889752)
@ 2023-01-05  0:06 Patrick McLean
  2023-01-06 13:03 ` Mike Pagano
  0 siblings, 1 reply; 3+ messages in thread
From: Patrick McLean @ 2023-01-05  0:06 UTC (permalink / raw
  To: gentoo-dev; +Cc: kernel, Steven Stallion

From: Steven Stallion <steven.stallion@sony.com>

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
---
 eclass/linux-mod.eclass | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/eclass/linux-mod.eclass b/eclass/linux-mod.eclass
index d14bbf7d9ea..6cf9969b19a 100644
--- a/eclass/linux-mod.eclass
+++ b/eclass/linux-mod.eclass
@@ -408,7 +408,7 @@ generate_modulesd() {
 
 			for((t=0; t<${module_aliases}; t++))
 			do
-				echo "alias $(eval echo \${MODULESD_${currm}_ALIASES[$t]})" \
+				echo "alias $(eval echo \${MODULESD_${currm_t}_ALIASES[$t]})" \
 					>> "${module_config}"
 			done
 			echo '' >> "${module_config}"
@@ -434,7 +434,7 @@ generate_modulesd() {
 		fi
 
 		#-----------------------------------------------------------------------
-		if [[ $(eval echo \${MODULESD_${currm}_ALIASES[0]}) == guess ]]; then
+		if [[ $(eval echo \${MODULESD_${currm_t}_ALIASES[0]}) == guess ]]; then
 			# So, let's do some guesswork, eh?
 			if [[ -n ${module_opts} ]]; then
 				echo "# For Example..." >> "${module_config}"
@@ -449,7 +449,7 @@ generate_modulesd() {
 			echo "# For Example..." >> "${module_config}"
 			echo "# --------------" >> "${module_config}"
 			for ((t=0; t<${module_examples}; t++)); do
-				echo "options $(eval echo \${MODULESD_${currm}_EXAMPLES[$t]})" \
+				echo "options $(eval echo \${MODULESD_${currm_t}_EXAMPLES[$t]})" \
 					>> "${module_config}"
 			done
 			echo '' >> "${module_config}"
@@ -458,7 +458,7 @@ generate_modulesd() {
 		#-----------------------------------------------------------------------
 		if [[ ${module_additions} -gt 0 ]]; then
 			for ((t=0; t<${module_additions}; t++)); do
-				echo "$(eval echo \${MODULESD_${currm}_ADDITIONS[$t]})" \
+				echo "$(eval echo \${MODULESD_${currm_t}_ADDITIONS[$t]})" \
 					>> "${module_config}"
 			done
 			echo '' >> "${module_config}"
-- 
2.39.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [gentoo-dev] [PATCH] linux-mod.eclass: Fix MODULESD_* for hyphenated modules (bug #889752)
  2023-01-05  0:06 [gentoo-dev] [PATCH] linux-mod.eclass: Fix MODULESD_* for hyphenated modules (bug #889752) Patrick McLean
@ 2023-01-06 13:03 ` Mike Pagano
  2023-01-12  6:51   ` alicef_gentoo
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Pagano @ 2023-01-06 13:03 UTC (permalink / raw
  To: gentoo-dev; +Cc: steven.stallion

On 1/4/23 19:06, Patrick McLean wrote:
> From: Steven Stallion <steven.stallion@sony.com>
> 
> 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
> ---
>   eclass/linux-mod.eclass | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/eclass/linux-mod.eclass b/eclass/linux-mod.eclass
> index d14bbf7d9ea..6cf9969b19a 100644
> --- a/eclass/linux-mod.eclass
> +++ b/eclass/linux-mod.eclass
> @@ -408,7 +408,7 @@ generate_modulesd() {
>   
>   			for((t=0; t<${module_aliases}; t++))
>   			do
> -				echo "alias $(eval echo \${MODULESD_${currm}_ALIASES[$t]})" \
> +				echo "alias $(eval echo \${MODULESD_${currm_t}_ALIASES[$t]})" \
>   					>> "${module_config}"
>   			done
>   			echo '' >> "${module_config}"
> @@ -434,7 +434,7 @@ generate_modulesd() {
>   		fi
>   
>   		#-----------------------------------------------------------------------
> -		if [[ $(eval echo \${MODULESD_${currm}_ALIASES[0]}) == guess ]]; then
> +		if [[ $(eval echo \${MODULESD_${currm_t}_ALIASES[0]}) == guess ]]; then
>   			# So, let's do some guesswork, eh?
>   			if [[ -n ${module_opts} ]]; then
>   				echo "# For Example..." >> "${module_config}"
> @@ -449,7 +449,7 @@ generate_modulesd() {
>   			echo "# For Example..." >> "${module_config}"
>   			echo "# --------------" >> "${module_config}"
>   			for ((t=0; t<${module_examples}; t++)); do
> -				echo "options $(eval echo \${MODULESD_${currm}_EXAMPLES[$t]})" \
> +				echo "options $(eval echo \${MODULESD_${currm_t}_EXAMPLES[$t]})" \
>   					>> "${module_config}"
>   			done
>   			echo '' >> "${module_config}"
> @@ -458,7 +458,7 @@ generate_modulesd() {
>   		#-----------------------------------------------------------------------
>   		if [[ ${module_additions} -gt 0 ]]; then
>   			for ((t=0; t<${module_additions}; t++)); do
> -				echo "$(eval echo \${MODULESD_${currm}_ADDITIONS[$t]})" \
> +				echo "$(eval echo \${MODULESD_${currm_t}_ADDITIONS[$t]})" \
>   					>> "${module_config}"
>   			done
>   			echo '' >> "${module_config}"


Ack

-- 
Mike Pagano
Gentoo Developer - Kernel Project
E-Mail     : mpagano@gentoo.org
GnuPG FP   : 52CC A0B0 F631 0B17 0142 F83F 92A6 DBEC 81F2 B137
Public Key : http://pgp.mit.edu/pks/lookup?search=0x92A6DBEC81F2B137&op=index



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-dev] [PATCH] linux-mod.eclass: Fix MODULESD_* for hyphenated modules (bug #889752)
  2023-01-06 13:03 ` Mike Pagano
@ 2023-01-12  6:51   ` alicef_gentoo
  0 siblings, 0 replies; 3+ messages in thread
From: alicef_gentoo @ 2023-01-12  6:51 UTC (permalink / raw
  To: gentoo-dev; +Cc: steven.stallion

On Fri, Jan 06, 2023 at 08:03:51AM -0500, Mike Pagano wrote:
> On 1/4/23 19:06, Patrick McLean wrote:
> > From: Steven Stallion <steven.stallion@sony.com>
> > 
> > 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
> > ---
> >   eclass/linux-mod.eclass | 8 ++++----
> >   1 file changed, 4 insertions(+), 4 deletions(-)
> > 
> > diff --git a/eclass/linux-mod.eclass b/eclass/linux-mod.eclass
> > index d14bbf7d9ea..6cf9969b19a 100644
> > --- a/eclass/linux-mod.eclass
> > +++ b/eclass/linux-mod.eclass
> > @@ -408,7 +408,7 @@ generate_modulesd() {
> >   			for((t=0; t<${module_aliases}; t++))
> >   			do
> > -				echo "alias $(eval echo \${MODULESD_${currm}_ALIASES[$t]})" \
> > +				echo "alias $(eval echo \${MODULESD_${currm_t}_ALIASES[$t]})" \
> >   					>> "${module_config}"
> >   			done
> >   			echo '' >> "${module_config}"
> > @@ -434,7 +434,7 @@ generate_modulesd() {
> >   		fi
> >   		#-----------------------------------------------------------------------
> > -		if [[ $(eval echo \${MODULESD_${currm}_ALIASES[0]}) == guess ]]; then
> > +		if [[ $(eval echo \${MODULESD_${currm_t}_ALIASES[0]}) == guess ]]; then
> >   			# So, let's do some guesswork, eh?
> >   			if [[ -n ${module_opts} ]]; then
> >   				echo "# For Example..." >> "${module_config}"
> > @@ -449,7 +449,7 @@ generate_modulesd() {
> >   			echo "# For Example..." >> "${module_config}"
> >   			echo "# --------------" >> "${module_config}"
> >   			for ((t=0; t<${module_examples}; t++)); do
> > -				echo "options $(eval echo \${MODULESD_${currm}_EXAMPLES[$t]})" \
> > +				echo "options $(eval echo \${MODULESD_${currm_t}_EXAMPLES[$t]})" \
> >   					>> "${module_config}"
> >   			done
> >   			echo '' >> "${module_config}"
> > @@ -458,7 +458,7 @@ generate_modulesd() {
> >   		#-----------------------------------------------------------------------
> >   		if [[ ${module_additions} -gt 0 ]]; then
> >   			for ((t=0; t<${module_additions}; t++)); do
> > -				echo "$(eval echo \${MODULESD_${currm}_ADDITIONS[$t]})" \
> > +				echo "$(eval echo \${MODULESD_${currm_t}_ADDITIONS[$t]})" \
> >   					>> "${module_config}"
> >   			done
> >   			echo '' >> "${module_config}"
> 
> 
> Ack
> 

Ack

Thanks,
Alicef


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-01-12  6:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-05  0:06 [gentoo-dev] [PATCH] linux-mod.eclass: Fix MODULESD_* for hyphenated modules (bug #889752) Patrick McLean
2023-01-06 13:03 ` Mike Pagano
2023-01-12  6:51   ` alicef_gentoo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox