linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: <linuxppc-dev@ozlabs.org>
Cc: geoff@infradead.org
Subject: [PATCH] powerpc/ps3: Quieten the build when building ps3
Date: Mon, 19 Oct 2015 15:53:22 +1100	[thread overview]
Message-ID: <1445230402-18087-1-git-send-email-mpe@ellerman.id.au> (raw)

The boot wrapper uses dd when building for ps3, which annoyingly tells
us in great detail what it's doing, eg:

  512+0 records in
  512+0 records out
  512 bytes (512 B) copied, 0.000802129 s, 638 kB/s
  512+0 records in
  512+0 records out
  512 bytes (512 B) copied, 0.000745101 s, 687 kB/s

Also annoyingly, there is no "quiet" flag to dd, so our only option is
to grab all the output from dd, and iff there is an error print it out.

As it turns out we used to do this, so this is actually a partial revert
of commit d47403733403 ("[POWERPC] bootwrapper: Bail from script if any
command fails").

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 arch/powerpc/boot/wrapper | 26 ++++++++++++++++++++------
 1 file changed, 20 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper
index 3f50c27ed8f8..b7d353b88029 100755
--- a/arch/powerpc/boot/wrapper
+++ b/arch/powerpc/boot/wrapper
@@ -456,13 +456,27 @@ ps3)
 
     ${CROSS}objcopy -O binary "$ofile" "$ofile.bin"
 
-    dd if="$ofile.bin" of="$ofile.bin" conv=notrunc   \
-        skip=$overlay_dest seek=$system_reset_kernel  \
-        count=$overlay_size bs=1
+    set +e
 
-    dd if="$ofile.bin" of="$ofile.bin" conv=notrunc   \
-        skip=$system_reset_overlay seek=$overlay_dest \
-        count=$overlay_size bs=1
+    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
+
+    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
+
+    set -e
 
     odir="$(dirname "$ofile.bin")"
     rm -f "$odir/otheros.bld"
-- 
2.5.0

             reply	other threads:[~2015-10-19  4:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-19  4:53 Michael Ellerman [this message]
2015-10-19 17:53 ` [PATCH] powerpc: Add run_cmd function to boot wrapper Geoff Levand
2015-10-20  0:44   ` Michael Ellerman
2015-10-21 11:41   ` Michael Ellerman
2015-10-21 16:47 ` [PATCH] powerpc/ps3: Quieten the build when building ps3 Segher Boessenkool
2015-10-21 23:32   ` Michael Ellerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1445230402-18087-1-git-send-email-mpe@ellerman.id.au \
    --to=mpe@ellerman.id.au \
    --cc=geoff@infradead.org \
    --cc=linuxppc-dev@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).