aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2007-10-23 00:27:36 -0400
committerJosh Boyer <jwboyer@linux.vnet.ibm.com>2007-11-01 08:11:11 -0400
commitd47403733403bec7c050cce6f6ff56dfcf80b8b7 (patch)
tree63bc5d6939ed5df4cbf18478f7c5b93d2bf97228 /arch/powerpc
parent7f66c1fd03b64db5ddb24cc2ae150c9aebe30cb4 (diff)
[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 <grant.likely@secretlab.ca> Acked-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Diffstat (limited to 'arch/powerpc')
-rwxr-xr-xarch/powerpc/boot/wrapper27
1 files changed, 10 insertions, 17 deletions
diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper
index 347639c63936..5ae48f474dfa 100755
--- a/arch/powerpc/boot/wrapper
+++ b/arch/powerpc/boot/wrapper
@@ -21,6 +21,9 @@
21# (default ./arch/powerpc/boot) 21# (default ./arch/powerpc/boot)
22# -W dir specify working directory for temporary files (default .) 22# -W dir specify working directory for temporary files (default .)
23 23
24# Stop execution if any command fails
25set -e
26
24# Allow for verbose output 27# Allow for verbose output
25if [ "$V" = 1 ]; then 28if [ "$V" = 1 ]; then
26 set -x 29 set -x
@@ -116,7 +119,7 @@ if [ -n "$dts" ]; then
116 if [ -z "$dtb" ]; then 119 if [ -z "$dtb" ]; then
117 dtb="$platform.dtb" 120 dtb="$platform.dtb"
118 fi 121 fi
119 dtc -O dtb -o "$dtb" -b 0 -V 16 "$dts" || exit 1 122 dtc -O dtb -o "$dtb" -b 0 -V 16 "$dts"
120fi 123fi
121 124
122if [ -z "$kernel" ]; then 125if [ -z "$kernel" ]; then
@@ -287,23 +290,13 @@ ps3)
287 290
288 rm -f "$object/otheros.bld" 291 rm -f "$object/otheros.bld"
289 292
290 msg=$(dd if="$ofile.bin" of="$ofile.bin" conv=notrunc \ 293 dd if="$ofile.bin" of="$ofile.bin" conv=notrunc \
291 skip=$overlay_dest seek=$system_reset_kernel \ 294 skip=$overlay_dest seek=$system_reset_kernel \
292 count=$overlay_size bs=1 2>&1) 295 count=$overlay_size bs=1
293
294 if [ $? -ne "0" ]; then
295 echo $msg
296 exit 1
297 fi
298 296
299 msg=$(dd if="$ofile.bin" of="$ofile.bin" conv=notrunc \ 297 dd if="$ofile.bin" of="$ofile.bin" conv=notrunc \
300 skip=$system_reset_overlay seek=$overlay_dest \ 298 skip=$system_reset_overlay seek=$overlay_dest \
301 count=$overlay_size bs=1 2>&1) 299 count=$overlay_size bs=1
302
303 if [ $? -ne "0" ]; then
304 echo $msg
305 exit 2
306 fi
307 300
308 gzip --force -9 --stdout "$ofile.bin" > "$object/otheros.bld" 301 gzip --force -9 --stdout "$ofile.bin" > "$object/otheros.bld"
309 ;; 302 ;;