aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel
diff options
context:
space:
mode:
authorStefan Christ <s.christ@phytec.de>2015-10-26 09:20:36 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-11-16 11:39:31 +0000
commitaf9c7a4c577c9638f25919ed4fe7dd3323826bd7 (patch)
treef72c431c88d9f21c7ceeff50579238420c04efe3 /meta/recipes-kernel
parent7eecb81b6d788fe630e2378b0136cd46dadae7dd (diff)
downloadopenembedded-core-contrib-af9c7a4c577c9638f25919ed4fe7dd3323826bd7.tar.gz
linux-dtb.inc: refactor common code to function normalize_dtb
(From OE-Core rev: 5dfa10978ef540a7a8cd89766c40625ccfeffda2) 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/recipes-kernel')
-rw-r--r--meta/recipes-kernel/linux/linux-dtb.inc24
1 files changed, 12 insertions, 12 deletions
diff --git a/meta/recipes-kernel/linux/linux-dtb.inc b/meta/recipes-kernel/linux/linux-dtb.inc
index 2b8b11f084..22801b72b8 100644
--- a/meta/recipes-kernel/linux/linux-dtb.inc
+++ b/meta/recipes-kernel/linux/linux-dtb.inc
@@ -5,22 +5,25 @@ python __anonymous () {
d.appendVar("PACKAGES", " kernel-devicetree")
}
+normalize_dtb () {
+ DTB="$1"
+ if echo ${DTB} | grep -q '/dts/'; then
+ bbwarn "${DTB} contains the full path to the the dts file, but only the dtb name should be used."
+ DTB=`basename ${DTB} | sed 's,\.dts$,.dtb,g'`
+ fi
+ echo "${DTB}"
+}
+
do_compile_append() {
for DTB in ${KERNEL_DEVICETREE}; do
- if echo ${DTB} | grep -q '/dts/'; then
- bbwarn "${DTB} contains the full path to the the dts file, but only the dtb name should be used."
- DTB=`basename ${DTB} | sed 's,\.dts$,.dtb,g'`
- fi
+ DTB=`normalize_dtb "${DTB}"`
oe_runmake ${DTB}
done
}
do_install_append() {
for DTB in ${KERNEL_DEVICETREE}; do
- if echo ${DTB} | grep -q '/dts/'; then
- bbwarn "${DTB} contains the full path to the the dts file, but only the dtb name should be used."
- DTB=`basename ${DTB} | sed 's,\.dts$,.dtb,g'`
- fi
+ 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}"
@@ -33,10 +36,7 @@ do_install_append() {
do_deploy_append() {
for DTB in ${KERNEL_DEVICETREE}; do
- if echo ${DTB} | grep -q '/dts/'; then
- bbwarn "${DTB} contains the full path to the the dts file, but only the dtb name should be used."
- DTB=`basename ${DTB} | sed 's,\.dts$,.dtb,g'`
- fi
+ DTB=`normalize_dtb "${DTB}"`
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"`