Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d47403733403bec7c050cce6f6ff56dfcf80b8b7
Commit:     d47403733403bec7c050cce6f6ff56dfcf80b8b7
Parent:     7f66c1fd03b64db5ddb24cc2ae150c9aebe30cb4
Author:     Grant Likely <[EMAIL PROTECTED]>
AuthorDate: Tue Oct 23 14:27:36 2007 +1000
Committer:  Josh Boyer <[EMAIL PROTECTED]>
CommitDate: Thu Nov 1 07:11:11 2007 -0500

    [POWERPC] bootwrapper: Bail from script if any command fails
    
    Add the 'set -e' command to the wrapper script so that if any command
    fails then the script will automatically exit
    
    Signed-off-by: Grant Likely <[EMAIL PROTECTED]>
    Acked-by: David Gibson <[EMAIL PROTECTED]>
    Signed-off-by: Josh Boyer <[EMAIL PROTECTED]>
---
 arch/powerpc/boot/wrapper |   27 ++++++++++-----------------
 1 files changed, 10 insertions(+), 17 deletions(-)

diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper
index 347639c..5ae48f4 100755
--- a/arch/powerpc/boot/wrapper
+++ b/arch/powerpc/boot/wrapper
@@ -21,6 +21,9 @@
 #              (default ./arch/powerpc/boot)
 # -W dir       specify working directory for temporary files (default .)
 
+# Stop execution if any command fails
+set -e
+
 # Allow for verbose output
 if [ "$V" = 1 ]; then
     set -x
@@ -116,7 +119,7 @@ if [ -n "$dts" ]; then
     if [ -z "$dtb" ]; then
        dtb="$platform.dtb"
     fi
-    dtc -O dtb -o "$dtb" -b 0 -V 16 "$dts" || exit 1
+    dtc -O dtb -o "$dtb" -b 0 -V 16 "$dts"
 fi
 
 if [ -z "$kernel" ]; then
@@ -287,23 +290,13 @@ ps3)
 
     rm -f "$object/otheros.bld"
 
-    msg=$(dd if="$ofile.bin" of="$ofile.bin" conv=notrunc \
-        skip=$overlay_dest seek=$system_reset_kernel      \
-        count=$overlay_size bs=1 2>&1)
-
-    if [ $? -ne "0" ]; then
-       echo $msg
-       exit 1
-    fi
+    dd if="$ofile.bin" of="$ofile.bin" conv=notrunc   \
+        skip=$overlay_dest seek=$system_reset_kernel  \
+        count=$overlay_size bs=1
 
-    msg=$(dd if="$ofile.bin" of="$ofile.bin" conv=notrunc \
-        skip=$system_reset_overlay seek=$overlay_dest     \
-        count=$overlay_size bs=1 2>&1)
-
-    if [ $? -ne "0" ]; then
-       echo $msg
-       exit 2
-    fi
+    dd if="$ofile.bin" of="$ofile.bin" conv=notrunc   \
+        skip=$system_reset_overlay seek=$overlay_dest \
+        count=$overlay_size bs=1
 
     gzip --force -9 --stdout "$ofile.bin" > "$object/otheros.bld"
     ;;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to