summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel
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:28:38 +0000
commit04ed298520d38e0b078723b1b45368b7037cf6e0 (patch)
tree3de01a7786b39fc390ab5b2f9db50fb114aa1193 /meta/recipes-kernel
parent5dfa10978ef540a7a8cd89766c40625ccfeffda2 (diff)
downloadopenembedded-core-contrib-04ed298520d38e0b078723b1b45368b7037cf6e0.tar.gz
openembedded-core-contrib-04ed298520d38e0b078723b1b45368b7037cf6e0.tar.bz2
openembedded-core-contrib-04ed298520d38e0b078723b1b45368b7037cf6e0.zip
linux-dtb.inc: refactor common code to function get_real_dtb_path_in_kernel
Signed-off-by: Stefan Christ <s.christ@phytec.de> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/recipes-kernel')
-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 () {
echo "${DTB}"
}
+get_real_dtb_path_in_kernel () {
+ DTB="$1"
+ DTB_PATH="${B}/arch/${ARCH}/boot/dts/${DTB}"
+ if [ ! -e "${DTB_PATH}" ]; then
+ DTB_PATH="${B}/arch/${ARCH}/boot/${DTB}"
+ fi
+ echo "${DTB_PATH}"
+}
+
do_compile_append() {
for DTB in ${KERNEL_DEVICETREE}; do
DTB=`normalize_dtb "${DTB}"`
@@ -26,10 +35,7 @@ do_install_append() {
DTB=`normalize_dtb "${DTB}"`
DTB_BASE_NAME=`basename ${DTB} .dtb`
DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
- DTB_PATH="${B}/arch/${ARCH}/boot/dts/${DTB}"
- if [ ! -e "${DTB_PATH}" ]; then
- DTB_PATH="${B}/arch/${ARCH}/boot/${DTB}"
- fi
+ DTB_PATH=`get_real_dtb_path_in_kernel "${DTB}"`
install -m 0644 ${DTB_PATH} ${D}/${KERNEL_IMAGEDEST}/devicetree-${DTB_SYMLINK_NAME}.dtb
done
}
@@ -40,10 +46,7 @@ do_deploy_append() {
DTB_BASE_NAME=`basename ${DTB} .dtb`
DTB_NAME=`echo ${KERNEL_IMAGE_BASE_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
- DTB_PATH="${B}/arch/${ARCH}/boot/dts/${DTB}"
- if [ ! -e "${DTB_PATH}" ]; then
- DTB_PATH="${B}/arch/${ARCH}/boot/${DTB}"
- fi
+ DTB_PATH=`get_real_dtb_path_in_kernel "${DTB}"`
install -d ${DEPLOYDIR}
install -m 0644 ${DTB_PATH} ${DEPLOYDIR}/${DTB_NAME}.dtb
ln -sf ${DTB_NAME}.dtb ${DEPLOYDIR}/${DTB_SYMLINK_NAME}.dtb