diff mbox series

[2/3] package/busybox: convert S10mdev to the canonical init script format

Message ID 20190619164257.183607-3-titouan.christophe@railnova.eu
State Accepted
Headers show
Series Update Busybox to 1.31 and use mdev daemon mode | expand

Commit Message

Titouan Christophe June 19, 2019, 4:42 p.m. UTC
Signed-off-by: Titouan Christophe <titouan.christophe@railnova.eu>
---
 package/busybox/S10mdev | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

Comments

Andy Shevchenko June 20, 2019, 10:10 a.m. UTC | #1
On Wed, Jun 19, 2019 at 06:42:56PM +0200, Titouan Christophe wrote:
> Signed-off-by: Titouan Christophe <titouan.christophe@railnova.eu>

> -	find /sys/ -name modalias -print0 | xargs -0 sort -u | tr '\n' '\0' | \
> -	    xargs -0 modprobe -abq

> +	find /sys/ -name modalias -print0 | \
> +		xargs -0 sort -u | \
> +		tr '\n' '\0' | \
> +		xargs -0 modprobe -abq

How this indentation change related to the topic?
Titouan Christophe June 20, 2019, 10:44 a.m. UTC | #2
Hello Andy,

On 6/20/19 12:10 PM, Andy Shevchenko wrote:
> On Wed, Jun 19, 2019 at 06:42:56PM +0200, Titouan Christophe wrote:
>> Signed-off-by: Titouan Christophe <titouan.christophe@railnova.eu>
> 
>> -	find /sys/ -name modalias -print0 | xargs -0 sort -u | tr '\n' '\0' | \
>> -	    xargs -0 modprobe -abq
> 
>> +	find /sys/ -name modalias -print0 | \
>> +		xargs -0 sort -u | \
>> +		tr '\n' '\0' | \
>> +		xargs -0 modprobe -abq
> 
> How this indentation change related to the topic?
> 

This is a preparatory patch to convert this script to the canonical init 
script format, as suggested by Arnout (see 
http://lists.busybox.net/pipermail/buildroot/2019-May/251199.html)

Regards,

Titouan
Titouan Christophe June 20, 2019, 11:39 a.m. UTC | #3
Hi again,

On 6/20/19 12:44 PM, Titouan Christophe wrote:
> Hello Andy,
> 
> On 6/20/19 12:10 PM, Andy Shevchenko wrote:
>> On Wed, Jun 19, 2019 at 06:42:56PM +0200, Titouan Christophe wrote:
>>> Signed-off-by: Titouan Christophe <titouan.christophe@railnova.eu>
>>
>>> -    find /sys/ -name modalias -print0 | xargs -0 sort -u | tr '\n' 
>>> '\0' | \
>>> -        xargs -0 modprobe -abq
>>
>>> +    find /sys/ -name modalias -print0 | \
>>> +        xargs -0 sort -u | \
>>> +        tr '\n' '\0' | \
>>> +        xargs -0 modprobe -abq
>>
>> How this indentation change related to the topic?
>>
> 
> This is a preparatory patch to convert this script to the canonical init 
> script format, as suggested by Arnout (see 
> http://lists.busybox.net/pipermail/buildroot/2019-May/251199.html)


sorry I did not pay attention to the fact that you were only commenting 
on this particular hunk. I did reindent this command chain for better 
readability (in my opinion); I can rework that part to better suit the 
codestyle, if any.

Regards,

Titouan
Andy Shevchenko June 20, 2019, 11:52 a.m. UTC | #4
On Thu, Jun 20, 2019 at 01:39:32PM +0200, Titouan Christophe wrote:
> On 6/20/19 12:44 PM, Titouan Christophe wrote:
> > Hello Andy,
> > 
> > On 6/20/19 12:10 PM, Andy Shevchenko wrote:
> > > On Wed, Jun 19, 2019 at 06:42:56PM +0200, Titouan Christophe wrote:
> > > > Signed-off-by: Titouan Christophe <titouan.christophe@railnova.eu>
> > > 
> > > > -    find /sys/ -name modalias -print0 | xargs -0 sort -u | tr
> > > > '\n' '\0' | \
> > > > -        xargs -0 modprobe -abq
> > > 
> > > > +    find /sys/ -name modalias -print0 | \
> > > > +        xargs -0 sort -u | \
> > > > +        tr '\n' '\0' | \
> > > > +        xargs -0 modprobe -abq
> > > 
> > > How this indentation change related to the topic?
> > > 
> > 
> > This is a preparatory patch to convert this script to the canonical init
> > script format, as suggested by Arnout (see
> > http://lists.busybox.net/pipermail/buildroot/2019-May/251199.html)
> 
> 
> sorry I did not pay attention to the fact that you were only commenting on
> this particular hunk. I did reindent this command chain for better
> readability (in my opinion); I can rework that part to better suit the
> codestyle, if any.

It should be a separate patch explaining why you are doing that, but not in this one.
diff mbox series

Patch

diff --git a/package/busybox/S10mdev b/package/busybox/S10mdev
index 7075b77016..efef4290ba 100644
--- a/package/busybox/S10mdev
+++ b/package/busybox/S10mdev
@@ -3,21 +3,24 @@ 
 # Start mdev....
 #
 
-case "$1" in
-  start)
+
+start() {
 	echo "Starting mdev..."
 	echo /sbin/mdev >/proc/sys/kernel/hotplug
 	/sbin/mdev -s
 	# coldplug modules
-	find /sys/ -name modalias -print0 | xargs -0 sort -u | tr '\n' '\0' | \
-	    xargs -0 modprobe -abq
-	;;
-  stop)
-	;;
-  restart|reload)
+	find /sys/ -name modalias -print0 | \
+		xargs -0 sort -u | \
+		tr '\n' '\0' | \
+		xargs -0 modprobe -abq
+}
+
+case "$1" in
+  start)
+	"$1"
 	;;
   *)
-	echo "Usage: $0 {start|stop|restart}"
+	echo "Usage: $0 start"
 	exit 1
 esac