diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2014-07-22 15:46:05 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2014-07-22 15:47:37 +0200 |
commit | 0b388cabd3e3a831740c1b556d840b4839a0bb0b (patch) | |
tree | e13421e5ad796f5f4d80825f142660e1e2a5792e /scripts/lib/ptxd_make_dts_dtc.sh | |
parent | 9a86aaa20a0df75cda4302a35eb5fefb1fdb5c4c (diff) | |
download | ptxdist-0b388cabd3e3a831740c1b556d840b4839a0bb0b.tar.gz ptxdist-0b388cabd3e3a831740c1b556d840b4839a0bb0b.tar.xz |
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 <m.olbrich@pengutronix.de>
Diffstat (limited to 'scripts/lib/ptxd_make_dts_dtc.sh')
-rw-r--r-- | scripts/lib/ptxd_make_dts_dtc.sh | 13 |
1 files 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) \ |