aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeoff Levand <geoff@infradead.org>2015-10-19 13:53:26 -0400
committerMichael Ellerman <mpe@ellerman.id.au>2015-10-21 05:06:56 -0400
commit879c26d4f6a2b573d75cc235946019b6208ed6bc (patch)
treefd58d2eb819eebaebf452c01dfce7410116ac073
parent1856f50c66dff0afb4a6a3e22497ae153aec9411 (diff)
powerpc/ps3: Quieten boot wrapper output with run_cmd
Add a boot wrapper script function run_cmd which will run a shell command quietly and only print the output if either V=1 or an error occurs. Also, run the ps3 dd commands with run_cmd to clean up the build output. Signed-off-by: Geoff Levand <geoff@infradead.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-rwxr-xr-xarch/powerpc/boot/wrapper25
1 files changed, 21 insertions, 4 deletions
diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper
index 3f50c27ed8f8..ceaa75d5a684 100755
--- a/arch/powerpc/boot/wrapper
+++ b/arch/powerpc/boot/wrapper
@@ -63,6 +63,23 @@ usage() {
63 exit 1 63 exit 1
64} 64}
65 65
66run_cmd() {
67 if [ "$V" = 1 ]; then
68 $* 2>&1
69 else
70 local msg
71
72 set +e
73 msg=$($* 2>&1)
74
75 if [ $? -ne "0" ]; then
76 echo $msg
77 exit 1
78 fi
79 set -e
80 fi
81}
82
66while [ "$#" -gt 0 ]; do 83while [ "$#" -gt 0 ]; do
67 case "$1" in 84 case "$1" in
68 -o) 85 -o)
@@ -456,12 +473,12 @@ ps3)
456 473
457 ${CROSS}objcopy -O binary "$ofile" "$ofile.bin" 474 ${CROSS}objcopy -O binary "$ofile" "$ofile.bin"
458 475
459 dd if="$ofile.bin" of="$ofile.bin" conv=notrunc \ 476 run_cmd dd if="$ofile.bin" of="$ofile.bin" conv=notrunc \
460 skip=$overlay_dest seek=$system_reset_kernel \ 477 skip=$overlay_dest seek=$system_reset_kernel \
461 count=$overlay_size bs=1 478 count=$overlay_size bs=1
462 479
463 dd if="$ofile.bin" of="$ofile.bin" conv=notrunc \ 480 run_cmd dd if="$ofile.bin" of="$ofile.bin" conv=notrunc \
464 skip=$system_reset_overlay seek=$overlay_dest \ 481 skip=$system_reset_overlay seek=$overlay_dest \
465 count=$overlay_size bs=1 482 count=$overlay_size bs=1
466 483
467 odir="$(dirname "$ofile.bin")" 484 odir="$(dirname "$ofile.bin")"