[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>
This commit is contained in:
Grant Likely 2007-10-23 14:27:36 +10:00 committed by Josh Boyer
parent 7f66c1fd03
commit d474037334

View file

@ -21,6 +21,9 @@
# (default ./arch/powerpc/boot) # (default ./arch/powerpc/boot)
# -W dir specify working directory for temporary files (default .) # -W dir specify working directory for temporary files (default .)
# Stop execution if any command fails
set -e
# Allow for verbose output # Allow for verbose output
if [ "$V" = 1 ]; then if [ "$V" = 1 ]; then
set -x set -x
@ -116,7 +119,7 @@ if [ -n "$dts" ]; then
if [ -z "$dtb" ]; then if [ -z "$dtb" ]; then
dtb="$platform.dtb" dtb="$platform.dtb"
fi fi
dtc -O dtb -o "$dtb" -b 0 -V 16 "$dts" || exit 1 dtc -O dtb -o "$dtb" -b 0 -V 16 "$dts"
fi fi
if [ -z "$kernel" ]; then if [ -z "$kernel" ]; then
@ -287,23 +290,13 @@ ps3)
rm -f "$object/otheros.bld" rm -f "$object/otheros.bld"
msg=$(dd if="$ofile.bin" of="$ofile.bin" conv=notrunc \ dd if="$ofile.bin" of="$ofile.bin" conv=notrunc \
skip=$overlay_dest seek=$system_reset_kernel \ skip=$overlay_dest seek=$system_reset_kernel \
count=$overlay_size bs=1 2>&1) count=$overlay_size bs=1
if [ $? -ne "0" ]; then dd if="$ofile.bin" of="$ofile.bin" conv=notrunc \
echo $msg skip=$system_reset_overlay seek=$overlay_dest \
exit 1 count=$overlay_size bs=1
fi
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
gzip --force -9 --stdout "$ofile.bin" > "$object/otheros.bld" gzip --force -9 --stdout "$ofile.bin" > "$object/otheros.bld"
;; ;;