mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Alexander Aring <alex.aring@gmail.com>
To: ptxdist@pengutronix.de
Cc: Alexander Aring <alex.aring@gmail.com>, mkl@pengutronix.de
Subject: [ptxdist] [PATCH] ptxd_make_dts_dtc: handle error if dtc failed
Date: Tue,  8 Jul 2014 16:33:45 +0200	[thread overview]
Message-ID: <1404830025-22351-1-git-send-email-alex.aring@gmail.com> (raw)

This patch adds error handling for the ptxd_make_dts_dtb function.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
---
 scripts/lib/ptxd_make_dts_dtc.sh | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/scripts/lib/ptxd_make_dts_dtc.sh b/scripts/lib/ptxd_make_dts_dtc.sh
index 24c5604..46eaa9d 100644
--- a/scripts/lib/ptxd_make_dts_dtc.sh
+++ b/scripts/lib/ptxd_make_dts_dtc.sh
@@ -29,7 +29,7 @@ ptxd_make_dts_dtb() {
     deps="${ptx_state_dir}/dtc.$(basename "${dts}").deps"
     tmp_deps="${PTXDIST_TEMPDIR}/dts.deps"
 
-    echo "CPP $(ptxd_print_path "${tmp_dts}")"
+    echo "CPP $(ptxd_print_path "${tmp_dts}")" &&
     cpp \
 	-Wp,-MD,${tmp_deps} \
 	-Wp,-MT,${tmp_dts} \
@@ -42,22 +42,22 @@ ptxd_make_dts_dtb() {
 	-I${dts_kernel_dir}/include \
 	-undef -D__DTS__ -x assembler-with-cpp \
 	-o ${tmp_dts} \
-	${dts}
+	${dts} &&
 
     sed -e "s;^${tmp_dts}:;${dts_dtb}:;" \
-	-e 's;^ \([^ ]*\); $(wildcard \1);' "${tmp_deps}" > "${deps}"
+	-e 's;^ \([^ ]*\); $(wildcard \1);' "${tmp_deps}" > "${deps}" &&
 
     if dtc -h 2>&1 | grep -q '^[[:space:]]\+-i\(,.*\)\?$'; then
 	dtc_include="-i $(dirname "${dts}") -i ${dts_kernel_dir}/arch/${dts_kernel_arch}/boot/dts"
     fi
 
-    echo "DTC $(ptxd_print_path "${dts_dtb}")"
+    echo "DTC $(ptxd_print_path "${dts_dtb}")" &&
     dtc \
 	$(ptxd_get_ptxconf PTXCONF_DTC_EXTRA_ARGS) \
 	${dtc_include} \
 	-d "${tmp_deps}" \
 	-I dts -O dtb -b 0 \
-	-o "${dts_dtb}" "${tmp_dts}"
+	-o "${dts_dtb}" "${tmp_dts}" &&
 
     awk '{ \
 	    printf "%s", $1 ;  \
@@ -65,6 +65,8 @@ ptxd_make_dts_dtb() {
 		printf " $(wildcard %s)", $i; \
 	    }; \
 	    print "" \
-	}' "${tmp_deps}" >> "${deps}"
+	}' "${tmp_deps}" >> "${deps}" ||
+
+    ptxd_bailout "Unable to generate dtb file."
 }
 export -f ptxd_make_dts_dtb
-- 
2.0.1


-- 
ptxdist mailing list
ptxdist@pengutronix.de

             reply	other threads:[~2014-07-08 14:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-08 14:33 Alexander Aring [this message]
2014-07-08 14:44 ` Marc Kleine-Budde
2014-07-09  7:20   ` Alexander Aring
2014-07-09  7:32     ` Marc Kleine-Budde
2014-07-09  8:03       ` Alexander Aring
2014-07-09  8:05         ` Marc Kleine-Budde
2014-07-09  8:11           ` Alexander Aring

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=1404830025-22351-1-git-send-email-alex.aring@gmail.com \
    --to=alex.aring@gmail.com \
    --cc=mkl@pengutronix.de \
    --cc=ptxdist@pengutronix.de \
    /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