summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorStefan Christ <s.christ@phytec.de>2015-10-26 09:20:37 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-11-16 11:39:31 +0000
commitdcc446fee088987ffc59c0fb3ceac4880b0c0529 (patch)
tree0c7400ebfe5f2ed376a091f40d48f1bea9384e9f /meta
parentaf9c7a4c577c9638f25919ed4fe7dd3323826bd7 (diff)
downloadpoky-dcc446fee088987ffc59c0fb3ceac4880b0c0529.tar.gz
linux-dtb.inc: refactor common code to function get_real_dtb_path_in_kernel
(From OE-Core rev: 04ed298520d38e0b078723b1b45368b7037cf6e0) Signed-off-by: Stefan Christ <s.christ@phytec.de> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-kernel/linux/linux-dtb.inc19
1 files changed, 11 insertions, 8 deletions
diff --git a/meta/recipes-kernel/linux/linux-dtb.inc b/meta/recipes-kernel/linux/linux-dtb.inc
index 22801b72b8..772adcbced 100644
--- a/meta/recipes-kernel/linux/linux-dtb.inc
+++ b/meta/recipes-kernel/linux/linux-dtb.inc
@@ -14,6 +14,15 @@ normalize_dtb () {
14 echo "${DTB}" 14 echo "${DTB}"
15} 15}
16 16
17get_real_dtb_path_in_kernel () {
18 DTB="$1"
19 DTB_PATH="${B}/arch/${ARCH}/boot/dts/${DTB}"
20 if [ ! -e "${DTB_PATH}" ]; then
21 DTB_PATH="${B}/arch/${ARCH}/boot/${DTB}"
22 fi
23 echo "${DTB_PATH}"
24}
25
17do_compile_append() { 26do_compile_append() {
18 for DTB in ${KERNEL_DEVICETREE}; do 27 for DTB in ${KERNEL_DEVICETREE}; do
19 DTB=`normalize_dtb "${DTB}"` 28 DTB=`normalize_dtb "${DTB}"`
@@ -26,10 +35,7 @@ do_install_append() {
26 DTB=`normalize_dtb "${DTB}"` 35 DTB=`normalize_dtb "${DTB}"`
27 DTB_BASE_NAME=`basename ${DTB} .dtb` 36 DTB_BASE_NAME=`basename ${DTB} .dtb`
28 DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"` 37 DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
29 DTB_PATH="${B}/arch/${ARCH}/boot/dts/${DTB}" 38 DTB_PATH=`get_real_dtb_path_in_kernel "${DTB}"`
30 if [ ! -e "${DTB_PATH}" ]; then
31 DTB_PATH="${B}/arch/${ARCH}/boot/${DTB}"
32 fi
33 install -m 0644 ${DTB_PATH} ${D}/${KERNEL_IMAGEDEST}/devicetree-${DTB_SYMLINK_NAME}.dtb 39 install -m 0644 ${DTB_PATH} ${D}/${KERNEL_IMAGEDEST}/devicetree-${DTB_SYMLINK_NAME}.dtb
34 done 40 done
35} 41}
@@ -40,10 +46,7 @@ do_deploy_append() {
40 DTB_BASE_NAME=`basename ${DTB} .dtb` 46 DTB_BASE_NAME=`basename ${DTB} .dtb`
41 DTB_NAME=`echo ${KERNEL_IMAGE_BASE_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"` 47 DTB_NAME=`echo ${KERNEL_IMAGE_BASE_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
42 DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"` 48 DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
43 DTB_PATH="${B}/arch/${ARCH}/boot/dts/${DTB}" 49 DTB_PATH=`get_real_dtb_path_in_kernel "${DTB}"`
44 if [ ! -e "${DTB_PATH}" ]; then
45 DTB_PATH="${B}/arch/${ARCH}/boot/${DTB}"
46 fi
47 install -d ${DEPLOYDIR} 50 install -d ${DEPLOYDIR}
48 install -m 0644 ${DTB_PATH} ${DEPLOYDIR}/${DTB_NAME}.dtb 51 install -m 0644 ${DTB_PATH} ${DEPLOYDIR}/${DTB_NAME}.dtb
49 ln -sf ${DTB_NAME}.dtb ${DEPLOYDIR}/${DTB_SYMLINK_NAME}.dtb 52 ln -sf ${DTB_NAME}.dtb ${DEPLOYDIR}/${DTB_SYMLINK_NAME}.dtb