From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: From: Alexander Aring Date: Wed, 9 Jul 2014 10:25:31 +0200 Message-Id: <1404894331-22105-1-git-send-email-alex.aring@gmail.com> Subject: [ptxdist] [PATCH v2] ptxd_make_dts_dtc: handle error if dtc failed Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de Cc: Alexander Aring , mkl@pengutronix.de This patch adds error handling for the ptxd_make_dts_dtb function. Signed-off-by: Alexander Aring --- scripts/lib/ptxd_make_dts_dtc.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/scripts/lib/ptxd_make_dts_dtc.sh b/scripts/lib/ptxd_make_dts_dtc.sh index 24c5604..2af8405 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 + 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