public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scripts: decodecode: use /bin/bash
@ 2010-06-03 16:14 Rabin Vincent
  2010-06-03 16:24 ` Randy Dunlap
  0 siblings, 1 reply; 7+ messages in thread
From: Rabin Vincent @ 2010-06-03 16:14 UTC (permalink / raw)
  To: mmarek; +Cc: linux-kernel, Rabin Vincent

5358db ("scripts: add ARM support to decodecode") added a few bashims to
the decodecode script, so explicitly ask for bash.

Signed-off-by: Rabin Vincent <rabin@rab.in>
---
Alternatively, I have a patch to remove the bashisms, if that's preferred.

 scripts/decodecode |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/scripts/decodecode b/scripts/decodecode
index 8b30cc3..405cfac 100755
--- a/scripts/decodecode
+++ b/scripts/decodecode
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 # Disassemble the Code: line in Linux oopses
 # usage: decodecode < oops.file
 #
-- 
1.7.1


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

* Re: [PATCH] scripts: decodecode: use /bin/bash
  2010-06-03 16:14 [PATCH] scripts: decodecode: use /bin/bash Rabin Vincent
@ 2010-06-03 16:24 ` Randy Dunlap
  2010-06-03 16:59   ` Rabin Vincent
  2010-06-03 17:18   ` Rabin Vincent
  0 siblings, 2 replies; 7+ messages in thread
From: Randy Dunlap @ 2010-06-03 16:24 UTC (permalink / raw)
  To: Rabin Vincent; +Cc: mmarek, linux-kernel

On Thu,  3 Jun 2010 21:44:46 +0530 Rabin Vincent wrote:

> 5358db ("scripts: add ARM support to decodecode") added a few bashims to
> the decodecode script, so explicitly ask for bash.
> 
> Signed-off-by: Rabin Vincent <rabin@rab.in>
> ---
> Alternatively, I have a patch to remove the bashisms, if that's preferred.

Yes, that's what we usually prefer to do.
Please post it.


>  scripts/decodecode |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/scripts/decodecode b/scripts/decodecode
> index 8b30cc3..405cfac 100755
> --- a/scripts/decodecode
> +++ b/scripts/decodecode
> @@ -1,4 +1,4 @@
> -#!/bin/sh
> +#!/bin/bash
>  # Disassemble the Code: line in Linux oopses
>  # usage: decodecode < oops.file
>  #
> -- 


---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

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

* Re: [PATCH] scripts: decodecode: use /bin/bash
  2010-06-03 16:24 ` Randy Dunlap
@ 2010-06-03 16:59   ` Rabin Vincent
  2010-06-04  4:53     ` Américo Wang
  2010-06-03 17:18   ` Rabin Vincent
  1 sibling, 1 reply; 7+ messages in thread
From: Rabin Vincent @ 2010-06-03 16:59 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: mmarek, linux-kernel

On Thu, Jun 03, 2010 at 09:24:58AM -0700, Randy Dunlap wrote:
> On Thu,  3 Jun 2010 21:44:46 +0530 Rabin Vincent wrote:
> 
> > 5358db ("scripts: add ARM support to decodecode") added a few bashims to
> > the decodecode script, so explicitly ask for bash.
> > 
> > Signed-off-by: Rabin Vincent <rabin@rab.in>
> > ---
> > Alternatively, I have a patch to remove the bashisms, if that's preferred.
> 
> Yes, that's what we usually prefer to do.
> Please post it.

Here it is:

>From f729122bcd237f32c9f667e5644c6114ddc795af Mon Sep 17 00:00:00 2001
From: Rabin Vincent <rabin@rab.in>
Date: Thu, 3 Jun 2010 21:33:46 +0530
Subject: [PATCH] scripts: decodecode: remove bashisms

Remove bashisms to make scripts/decodecode work with other shells.

Signed-off-by: Rabin Vincent <rabin@rab.in>
---
 scripts/decodecode |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/scripts/decodecode b/scripts/decodecode
index 8b30cc3..18ba881 100755
--- a/scripts/decodecode
+++ b/scripts/decodecode
@@ -40,7 +40,7 @@ echo $code
 code=`echo $code | sed -e 's/.*Code: //'`
 
 width=`expr index "$code" ' '`
-width=$[($width-1)/2]
+width=$((($width-1)/2))
 case $width in
 1) type=byte ;;
 2) type=2byte ;;
@@ -48,10 +48,10 @@ case $width in
 esac
 
 disas() {
-	${CROSS_COMPILE}as $AFLAGS -o $1.o $1.s &> /dev/null
+	${CROSS_COMPILE}as $AFLAGS -o $1.o $1.s > /dev/null 2>&1
 
-	if [ "$ARCH" == "arm" ]; then
-		if [ $width == 2 ]; then
+	if [ "$ARCH" = "arm" ]; then
+		if [ $width -eq 2 ]; then
 			OBJDUMPFLAGS="-M force-thumb"
 		fi
 
@@ -59,7 +59,7 @@ disas() {
 	fi
 
 	${CROSS_COMPILE}objdump $OBJDUMPFLAGS -S $1.o | \
-		grep -v "/tmp\|Disassembly\|\.text\|^$" &> $1.dis
+		grep -v "/tmp\|Disassembly\|\.text\|^$" > $1.dis 2>&1
 }
 
 marker=`expr index "$code" "\<"`
-- 
1.7.1


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

* Re: [PATCH] scripts: decodecode: use /bin/bash
  2010-06-03 16:24 ` Randy Dunlap
  2010-06-03 16:59   ` Rabin Vincent
@ 2010-06-03 17:18   ` Rabin Vincent
  2010-06-03 18:25     ` Randy Dunlap
  2010-06-04  8:32     ` Michal Marek
  1 sibling, 2 replies; 7+ messages in thread
From: Rabin Vincent @ 2010-06-03 17:18 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: mmarek, linux-kernel

On Thu, Jun 03, 2010 at 09:24:58AM -0700, Randy Dunlap wrote:
> On Thu,  3 Jun 2010 21:44:46 +0530 Rabin Vincent wrote:
> 
> > 5358db ("scripts: add ARM support to decodecode") added a few bashims to
> > the decodecode script, so explicitly ask for bash.
> > 
> > Signed-off-by: Rabin Vincent <rabin@rab.in>
> > ---
> > Alternatively, I have a patch to remove the bashisms, if that's preferred.
> 
> Yes, that's what we usually prefer to do.
> Please post it.

Here it is:

>From f729122bcd237f32c9f667e5644c6114ddc795af Mon Sep 17 00:00:00 2001
From: Rabin Vincent <rabin@rab.in>
Date: Thu, 3 Jun 2010 21:33:46 +0530
Subject: [PATCH] scripts: decodecode: remove bashisms

Remove bashisms to make scripts/decodecode work with other shells.

Signed-off-by: Rabin Vincent <rabin@rab.in>
---
 scripts/decodecode |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/scripts/decodecode b/scripts/decodecode
index 8b30cc3..18ba881 100755
--- a/scripts/decodecode
+++ b/scripts/decodecode
@@ -40,7 +40,7 @@ echo $code
 code=`echo $code | sed -e 's/.*Code: //'`
 
 width=`expr index "$code" ' '`
-width=$[($width-1)/2]
+width=$((($width-1)/2))
 case $width in
 1) type=byte ;;
 2) type=2byte ;;
@@ -48,10 +48,10 @@ case $width in
 esac
 
 disas() {
-	${CROSS_COMPILE}as $AFLAGS -o $1.o $1.s &> /dev/null
+	${CROSS_COMPILE}as $AFLAGS -o $1.o $1.s > /dev/null 2>&1
 
-	if [ "$ARCH" == "arm" ]; then
-		if [ $width == 2 ]; then
+	if [ "$ARCH" = "arm" ]; then
+		if [ $width -eq 2 ]; then
 			OBJDUMPFLAGS="-M force-thumb"
 		fi
 
@@ -59,7 +59,7 @@ disas() {
 	fi
 
 	${CROSS_COMPILE}objdump $OBJDUMPFLAGS -S $1.o | \
-		grep -v "/tmp\|Disassembly\|\.text\|^$" &> $1.dis
+		grep -v "/tmp\|Disassembly\|\.text\|^$" > $1.dis 2>&1
 }
 
 marker=`expr index "$code" "\<"`
-- 
1.7.1


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

* Re: [PATCH] scripts: decodecode: use /bin/bash
  2010-06-03 17:18   ` Rabin Vincent
@ 2010-06-03 18:25     ` Randy Dunlap
  2010-06-04  8:32     ` Michal Marek
  1 sibling, 0 replies; 7+ messages in thread
From: Randy Dunlap @ 2010-06-03 18:25 UTC (permalink / raw)
  To: Rabin Vincent; +Cc: mmarek, linux-kernel

On Thu, 3 Jun 2010 22:48:12 +0530 Rabin Vincent wrote:

> On Thu, Jun 03, 2010 at 09:24:58AM -0700, Randy Dunlap wrote:
> > On Thu,  3 Jun 2010 21:44:46 +0530 Rabin Vincent wrote:
> > 
> > > 5358db ("scripts: add ARM support to decodecode") added a few bashims to
> > > the decodecode script, so explicitly ask for bash.
> > > 
> > > Signed-off-by: Rabin Vincent <rabin@rab.in>
> > > ---
> > > Alternatively, I have a patch to remove the bashisms, if that's preferred.
> > 
> > Yes, that's what we usually prefer to do.
> > Please post it.
> 
> Here it is:

Works for me.  Thanks.


> From f729122bcd237f32c9f667e5644c6114ddc795af Mon Sep 17 00:00:00 2001
> From: Rabin Vincent <rabin@rab.in>
> Date: Thu, 3 Jun 2010 21:33:46 +0530
> Subject: [PATCH] scripts: decodecode: remove bashisms
> 
> Remove bashisms to make scripts/decodecode work with other shells.
> 
> Signed-off-by: Rabin Vincent <rabin@rab.in>
> ---
>  scripts/decodecode |   10 +++++-----
>  1 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/scripts/decodecode b/scripts/decodecode
> index 8b30cc3..18ba881 100755
> --- a/scripts/decodecode
> +++ b/scripts/decodecode
> @@ -40,7 +40,7 @@ echo $code
>  code=`echo $code | sed -e 's/.*Code: //'`
>  
>  width=`expr index "$code" ' '`
> -width=$[($width-1)/2]
> +width=$((($width-1)/2))
>  case $width in
>  1) type=byte ;;
>  2) type=2byte ;;
> @@ -48,10 +48,10 @@ case $width in
>  esac
>  
>  disas() {
> -	${CROSS_COMPILE}as $AFLAGS -o $1.o $1.s &> /dev/null
> +	${CROSS_COMPILE}as $AFLAGS -o $1.o $1.s > /dev/null 2>&1
>  
> -	if [ "$ARCH" == "arm" ]; then
> -		if [ $width == 2 ]; then
> +	if [ "$ARCH" = "arm" ]; then
> +		if [ $width -eq 2 ]; then
>  			OBJDUMPFLAGS="-M force-thumb"
>  		fi
>  
> @@ -59,7 +59,7 @@ disas() {
>  	fi
>  
>  	${CROSS_COMPILE}objdump $OBJDUMPFLAGS -S $1.o | \
> -		grep -v "/tmp\|Disassembly\|\.text\|^$" &> $1.dis
> +		grep -v "/tmp\|Disassembly\|\.text\|^$" > $1.dis 2>&1
>  }
>  
>  marker=`expr index "$code" "\<"`
> -- 
> 1.7.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/


---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

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

* Re: [PATCH] scripts: decodecode: use /bin/bash
  2010-06-03 16:59   ` Rabin Vincent
@ 2010-06-04  4:53     ` Américo Wang
  0 siblings, 0 replies; 7+ messages in thread
From: Américo Wang @ 2010-06-04  4:53 UTC (permalink / raw)
  To: Rabin Vincent; +Cc: Randy Dunlap, mmarek, linux-kernel

On Thu, Jun 03, 2010 at 10:29:03PM +0530, Rabin Vincent wrote:
>On Thu, Jun 03, 2010 at 09:24:58AM -0700, Randy Dunlap wrote:
>> On Thu,  3 Jun 2010 21:44:46 +0530 Rabin Vincent wrote:
>> 
>> > 5358db ("scripts: add ARM support to decodecode") added a few bashims to
>> > the decodecode script, so explicitly ask for bash.
>> > 
>> > Signed-off-by: Rabin Vincent <rabin@rab.in>
>> > ---
>> > Alternatively, I have a patch to remove the bashisms, if that's preferred.
>> 
>> Yes, that's what we usually prefer to do.
>> Please post it.
>
>Here it is:
>
>From f729122bcd237f32c9f667e5644c6114ddc795af Mon Sep 17 00:00:00 2001
>From: Rabin Vincent <rabin@rab.in>
>Date: Thu, 3 Jun 2010 21:33:46 +0530
>Subject: [PATCH] scripts: decodecode: remove bashisms
>
>Remove bashisms to make scripts/decodecode work with other shells.
>
>Signed-off-by: Rabin Vincent <rabin@rab.in>
>---
> scripts/decodecode |   10 +++++-----
> 1 files changed, 5 insertions(+), 5 deletions(-)
>
>diff --git a/scripts/decodecode b/scripts/decodecode
>index 8b30cc3..18ba881 100755
>--- a/scripts/decodecode
>+++ b/scripts/decodecode
>@@ -40,7 +40,7 @@ echo $code
> code=`echo $code | sed -e 's/.*Code: //'`
> 
> width=`expr index "$code" ' '`
>-width=$[($width-1)/2]
>+width=$((($width-1)/2))
> case $width in
> 1) type=byte ;;
> 2) type=2byte ;;
>@@ -48,10 +48,10 @@ case $width in
> esac
> 
> disas() {
>-	${CROSS_COMPILE}as $AFLAGS -o $1.o $1.s &> /dev/null
>+	${CROSS_COMPILE}as $AFLAGS -o $1.o $1.s > /dev/null 2>&1


I am a bit surprised to see this is bash specific.

Anyway, this patch looks good for me.

Reviewed-by: WANG Cong <xiyou.wangcong@gmail.com>

Thanks!

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

* Re: [PATCH] scripts: decodecode: use /bin/bash
  2010-06-03 17:18   ` Rabin Vincent
  2010-06-03 18:25     ` Randy Dunlap
@ 2010-06-04  8:32     ` Michal Marek
  1 sibling, 0 replies; 7+ messages in thread
From: Michal Marek @ 2010-06-04  8:32 UTC (permalink / raw)
  To: Rabin Vincent; +Cc: Randy Dunlap, linux-kernel, Américo Wang

On 3.6.2010 19:18, Rabin Vincent wrote:
> From f729122bcd237f32c9f667e5644c6114ddc795af Mon Sep 17 00:00:00 2001
> From: Rabin Vincent <rabin@rab.in>
> Date: Thu, 3 Jun 2010 21:33:46 +0530
> Subject: [PATCH] scripts: decodecode: remove bashisms
> 
> Remove bashisms to make scripts/decodecode work with other shells.
> 
> Signed-off-by: Rabin Vincent <rabin@rab.in>

Thanks, applied.

Michal

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

end of thread, other threads:[~2010-06-04  8:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-03 16:14 [PATCH] scripts: decodecode: use /bin/bash Rabin Vincent
2010-06-03 16:24 ` Randy Dunlap
2010-06-03 16:59   ` Rabin Vincent
2010-06-04  4:53     ` Américo Wang
2010-06-03 17:18   ` Rabin Vincent
2010-06-03 18:25     ` Randy Dunlap
2010-06-04  8:32     ` Michal Marek

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