From 0b388cabd3e3a831740c1b556d840b4839a0bb0b Mon Sep 17 00:00:00 2001 From: Michael Olbrich Date: Tue, 22 Jul 2014 15:46:05 +0200 Subject: ptxd_make_dts_dtb: support older kernel The dtc from older kernel versions does not support the '-i' option. In this case the temporary dts file must remain in the kernel source tree. Otherwise includes are not found. Signed-off-by: Michael Olbrich --- scripts/lib/ptxd_make_dts_dtc.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/scripts/lib/ptxd_make_dts_dtc.sh b/scripts/lib/ptxd_make_dts_dtc.sh index 2af8405e1..d5e8c59c4 100644 --- a/scripts/lib/ptxd_make_dts_dtc.sh +++ b/scripts/lib/ptxd_make_dts_dtc.sh @@ -25,7 +25,14 @@ ptxd_make_dts_dtb() { dts="${ptxd_reply}" ;; esac - tmp_dts="${ptx_state_dir}/$(basename "${dts}").tmp" + + 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" + tmp_dts="${ptx_state_dir}/$(basename "${dts}").tmp" + else + tmp_dts="${dts}.tmp" + fi && + deps="${ptx_state_dir}/dtc.$(basename "${dts}").deps" tmp_deps="${PTXDIST_TEMPDIR}/dts.deps" @@ -47,10 +54,6 @@ ptxd_make_dts_dtb() { sed -e "s;^${tmp_dts}:;${dts_dtb}:;" \ -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}")" && dtc \ $(ptxd_get_ptxconf PTXCONF_DTC_EXTRA_ARGS) \ -- cgit v1.2.3