Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
* [ltt-dev] [PATCH] ltt-sessiond: use short options for modprobe in order to support Busybox
@ 2011-11-03 11:51 Thomas Petazzoni
  2011-11-03 12:03 ` Mathieu Desnoyers
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Petazzoni @ 2011-11-03 11:51 UTC (permalink / raw)


Many embedded systems are based on Busybox, and therefore use the
Busybox implementation of modprobe. This implementation does not
support long options such as --remove and --quiet, only short options
such as -r and -q are supported.

This patches changes ltt-sessiond to use the short options, which are
more widely available, and allows lttng to work easily on a
Busybox-based system.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
---
 ltt-sessiond/main.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/ltt-sessiond/main.c b/ltt-sessiond/main.c
index 334af53..2c2fe44 100644
--- a/ltt-sessiond/main.c
+++ b/ltt-sessiond/main.c
@@ -211,16 +211,16 @@ static int modprobe_remove_kernel_modules(void)
 
 	for (i = ARRAY_SIZE(kernel_modules_list) - 1; i >= 0; i--) {
 		ret = snprintf(modprobe, sizeof(modprobe),
-				"/sbin/modprobe --remove --quiet %s",
+				"/sbin/modprobe -r -q %s",
 				kernel_modules_list[i].name);
 		if (ret < 0) {
-			perror("snprintf modprobe --remove");
+			perror("snprintf modprobe -r");
 			goto error;
 		}
 		modprobe[sizeof(modprobe) - 1] = '\0';
 		ret = system(modprobe);
 		if (ret == -1) {
-			ERR("Unable to launch modprobe --remove for module %s",
+			ERR("Unable to launch modprobe -r for module %s",
 					kernel_modules_list[i].name);
 		} else if (kernel_modules_list[i].required
 				&& WEXITSTATUS(ret) != 0) {
@@ -1490,7 +1490,7 @@ static int modprobe_kernel_modules(void)
 	for (i = 0; i < ARRAY_SIZE(kernel_modules_list); i++) {
 		ret = snprintf(modprobe, sizeof(modprobe),
 			"/sbin/modprobe %s%s",
-			kernel_modules_list[i].required ? "" : "--quiet ",
+			kernel_modules_list[i].required ? "" : "-q ",
 			kernel_modules_list[i].name);
 		if (ret < 0) {
 			perror("snprintf modprobe");
-- 
1.7.4.1





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

* [ltt-dev] [PATCH] ltt-sessiond: use short options for modprobe in order to support Busybox
  2011-11-03 11:51 [ltt-dev] [PATCH] ltt-sessiond: use short options for modprobe in order to support Busybox Thomas Petazzoni
@ 2011-11-03 12:03 ` Mathieu Desnoyers
  2011-11-03 13:50   ` David Goulet
  0 siblings, 1 reply; 4+ messages in thread
From: Mathieu Desnoyers @ 2011-11-03 12:03 UTC (permalink / raw)


* Thomas Petazzoni (thomas.petazzoni at free-electrons.com) wrote:
> Many embedded systems are based on Busybox, and therefore use the
> Busybox implementation of modprobe. This implementation does not
> support long options such as --remove and --quiet, only short options
> such as -r and -q are supported.
> 
> This patches changes ltt-sessiond to use the short options, which are
> more widely available, and allows lttng to work easily on a
> Busybox-based system.

Merged, thanks!

Mathieu

> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
> ---
>  ltt-sessiond/main.c |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/ltt-sessiond/main.c b/ltt-sessiond/main.c
> index 334af53..2c2fe44 100644
> --- a/ltt-sessiond/main.c
> +++ b/ltt-sessiond/main.c
> @@ -211,16 +211,16 @@ static int modprobe_remove_kernel_modules(void)
>  
>  	for (i = ARRAY_SIZE(kernel_modules_list) - 1; i >= 0; i--) {
>  		ret = snprintf(modprobe, sizeof(modprobe),
> -				"/sbin/modprobe --remove --quiet %s",
> +				"/sbin/modprobe -r -q %s",
>  				kernel_modules_list[i].name);
>  		if (ret < 0) {
> -			perror("snprintf modprobe --remove");
> +			perror("snprintf modprobe -r");
>  			goto error;
>  		}
>  		modprobe[sizeof(modprobe) - 1] = '\0';
>  		ret = system(modprobe);
>  		if (ret == -1) {
> -			ERR("Unable to launch modprobe --remove for module %s",
> +			ERR("Unable to launch modprobe -r for module %s",
>  					kernel_modules_list[i].name);
>  		} else if (kernel_modules_list[i].required
>  				&& WEXITSTATUS(ret) != 0) {
> @@ -1490,7 +1490,7 @@ static int modprobe_kernel_modules(void)
>  	for (i = 0; i < ARRAY_SIZE(kernel_modules_list); i++) {
>  		ret = snprintf(modprobe, sizeof(modprobe),
>  			"/sbin/modprobe %s%s",
> -			kernel_modules_list[i].required ? "" : "--quiet ",
> +			kernel_modules_list[i].required ? "" : "-q ",
>  			kernel_modules_list[i].name);
>  		if (ret < 0) {
>  			perror("snprintf modprobe");
> -- 
> 1.7.4.1
> 
> 
> _______________________________________________
> ltt-dev mailing list
> ltt-dev at lists.casi.polymtl.ca
> http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev
> 

-- 
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com



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

* [ltt-dev] [PATCH] ltt-sessiond: use short options for modprobe in order to support Busybox
  2011-11-03 12:03 ` Mathieu Desnoyers
@ 2011-11-03 13:50   ` David Goulet
  2011-11-03 14:49     ` Mathieu Desnoyers
  0 siblings, 1 reply; 4+ messages in thread
From: David Goulet @ 2011-11-03 13:50 UTC (permalink / raw)


Thanks Thomas!

Mathieu did merged but not upstream. It's done now :)

Cheers
David

On 11-11-03 08:03 AM, Mathieu Desnoyers wrote:
> * Thomas Petazzoni (thomas.petazzoni at free-electrons.com) wrote:
>> Many embedded systems are based on Busybox, and therefore use the
>> Busybox implementation of modprobe. This implementation does not
>> support long options such as --remove and --quiet, only short options
>> such as -r and -q are supported.
>>
>> This patches changes ltt-sessiond to use the short options, which are
>> more widely available, and allows lttng to work easily on a
>> Busybox-based system.
> 
> Merged, thanks!
> 
> Mathieu
> 
>>
>> Signed-off-by: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
>> ---
>>  ltt-sessiond/main.c |    8 ++++----
>>  1 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/ltt-sessiond/main.c b/ltt-sessiond/main.c
>> index 334af53..2c2fe44 100644
>> --- a/ltt-sessiond/main.c
>> +++ b/ltt-sessiond/main.c
>> @@ -211,16 +211,16 @@ static int modprobe_remove_kernel_modules(void)
>>  
>>  	for (i = ARRAY_SIZE(kernel_modules_list) - 1; i >= 0; i--) {
>>  		ret = snprintf(modprobe, sizeof(modprobe),
>> -				"/sbin/modprobe --remove --quiet %s",
>> +				"/sbin/modprobe -r -q %s",
>>  				kernel_modules_list[i].name);
>>  		if (ret < 0) {
>> -			perror("snprintf modprobe --remove");
>> +			perror("snprintf modprobe -r");
>>  			goto error;
>>  		}
>>  		modprobe[sizeof(modprobe) - 1] = '\0';
>>  		ret = system(modprobe);
>>  		if (ret == -1) {
>> -			ERR("Unable to launch modprobe --remove for module %s",
>> +			ERR("Unable to launch modprobe -r for module %s",
>>  					kernel_modules_list[i].name);
>>  		} else if (kernel_modules_list[i].required
>>  				&& WEXITSTATUS(ret) != 0) {
>> @@ -1490,7 +1490,7 @@ static int modprobe_kernel_modules(void)
>>  	for (i = 0; i < ARRAY_SIZE(kernel_modules_list); i++) {
>>  		ret = snprintf(modprobe, sizeof(modprobe),
>>  			"/sbin/modprobe %s%s",
>> -			kernel_modules_list[i].required ? "" : "--quiet ",
>> +			kernel_modules_list[i].required ? "" : "-q ",
>>  			kernel_modules_list[i].name);
>>  		if (ret < 0) {
>>  			perror("snprintf modprobe");
>> -- 
>> 1.7.4.1
>>
>>
>> _______________________________________________
>> ltt-dev mailing list
>> ltt-dev at lists.casi.polymtl.ca
>> http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev
>>
> 



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

* [ltt-dev] [PATCH] ltt-sessiond: use short options for modprobe in order to support Busybox
  2011-11-03 13:50   ` David Goulet
@ 2011-11-03 14:49     ` Mathieu Desnoyers
  0 siblings, 0 replies; 4+ messages in thread
From: Mathieu Desnoyers @ 2011-11-03 14:49 UTC (permalink / raw)


* David Goulet (david.goulet at polymtl.ca) wrote:
> Thanks Thomas!
> 
> Mathieu did merged but not upstream. It's done now :)

Ah, right, the push did not work. I've reset my local merge, pulled from
head and all is fine now.

Thanks!

Mathieu

> 
> Cheers
> David
> 
> On 11-11-03 08:03 AM, Mathieu Desnoyers wrote:
> > * Thomas Petazzoni (thomas.petazzoni at free-electrons.com) wrote:
> >> Many embedded systems are based on Busybox, and therefore use the
> >> Busybox implementation of modprobe. This implementation does not
> >> support long options such as --remove and --quiet, only short options
> >> such as -r and -q are supported.
> >>
> >> This patches changes ltt-sessiond to use the short options, which are
> >> more widely available, and allows lttng to work easily on a
> >> Busybox-based system.
> > 
> > Merged, thanks!
> > 
> > Mathieu
> > 
> >>
> >> Signed-off-by: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
> >> ---
> >>  ltt-sessiond/main.c |    8 ++++----
> >>  1 files changed, 4 insertions(+), 4 deletions(-)
> >>
> >> diff --git a/ltt-sessiond/main.c b/ltt-sessiond/main.c
> >> index 334af53..2c2fe44 100644
> >> --- a/ltt-sessiond/main.c
> >> +++ b/ltt-sessiond/main.c
> >> @@ -211,16 +211,16 @@ static int modprobe_remove_kernel_modules(void)
> >>  
> >>  	for (i = ARRAY_SIZE(kernel_modules_list) - 1; i >= 0; i--) {
> >>  		ret = snprintf(modprobe, sizeof(modprobe),
> >> -				"/sbin/modprobe --remove --quiet %s",
> >> +				"/sbin/modprobe -r -q %s",
> >>  				kernel_modules_list[i].name);
> >>  		if (ret < 0) {
> >> -			perror("snprintf modprobe --remove");
> >> +			perror("snprintf modprobe -r");
> >>  			goto error;
> >>  		}
> >>  		modprobe[sizeof(modprobe) - 1] = '\0';
> >>  		ret = system(modprobe);
> >>  		if (ret == -1) {
> >> -			ERR("Unable to launch modprobe --remove for module %s",
> >> +			ERR("Unable to launch modprobe -r for module %s",
> >>  					kernel_modules_list[i].name);
> >>  		} else if (kernel_modules_list[i].required
> >>  				&& WEXITSTATUS(ret) != 0) {
> >> @@ -1490,7 +1490,7 @@ static int modprobe_kernel_modules(void)
> >>  	for (i = 0; i < ARRAY_SIZE(kernel_modules_list); i++) {
> >>  		ret = snprintf(modprobe, sizeof(modprobe),
> >>  			"/sbin/modprobe %s%s",
> >> -			kernel_modules_list[i].required ? "" : "--quiet ",
> >> +			kernel_modules_list[i].required ? "" : "-q ",
> >>  			kernel_modules_list[i].name);
> >>  		if (ret < 0) {
> >>  			perror("snprintf modprobe");
> >> -- 
> >> 1.7.4.1
> >>
> >>
> >> _______________________________________________
> >> ltt-dev mailing list
> >> ltt-dev at lists.casi.polymtl.ca
> >> http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev
> >>
> > 
> 

-- 
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com



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

end of thread, other threads:[~2011-11-03 14:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-03 11:51 [ltt-dev] [PATCH] ltt-sessiond: use short options for modprobe in order to support Busybox Thomas Petazzoni
2011-11-03 12:03 ` Mathieu Desnoyers
2011-11-03 13:50   ` David Goulet
2011-11-03 14:49     ` Mathieu Desnoyers

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