summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-kernel')
-rw-r--r--meta/recipes-kernel/linux/linux-dtb.inc78
1 files changed, 36 insertions, 42 deletions
diff --git a/meta/recipes-kernel/linux/linux-dtb.inc b/meta/recipes-kernel/linux/linux-dtb.inc
index 173e945ef6..2b8b11f084 100644
--- a/meta/recipes-kernel/linux/linux-dtb.inc
+++ b/meta/recipes-kernel/linux/linux-dtb.inc
@@ -6,54 +6,48 @@ python __anonymous () {
6} 6}
7 7
8do_compile_append() { 8do_compile_append() {
9 if test -n "${KERNEL_DEVICETREE}"; then 9 for DTB in ${KERNEL_DEVICETREE}; do
10 for DTB in ${KERNEL_DEVICETREE}; do 10 if echo ${DTB} | grep -q '/dts/'; then
11 if echo ${DTB} | grep -q '/dts/'; then 11 bbwarn "${DTB} contains the full path to the the dts file, but only the dtb name should be used."
12 bbwarn "${DTB} contains the full path to the the dts file, but only the dtb name should be used." 12 DTB=`basename ${DTB} | sed 's,\.dts$,.dtb,g'`
13 DTB=`basename ${DTB} | sed 's,\.dts$,.dtb,g'` 13 fi
14 fi 14 oe_runmake ${DTB}
15 oe_runmake ${DTB} 15 done
16 done
17 fi
18} 16}
19 17
20do_install_append() { 18do_install_append() {
21 if test -n "${KERNEL_DEVICETREE}"; then 19 for DTB in ${KERNEL_DEVICETREE}; do
22 for DTB in ${KERNEL_DEVICETREE}; do 20 if echo ${DTB} | grep -q '/dts/'; then
23 if echo ${DTB} | grep -q '/dts/'; then 21 bbwarn "${DTB} contains the full path to the the dts file, but only the dtb name should be used."
24 bbwarn "${DTB} contains the full path to the the dts file, but only the dtb name should be used." 22 DTB=`basename ${DTB} | sed 's,\.dts$,.dtb,g'`
25 DTB=`basename ${DTB} | sed 's,\.dts$,.dtb,g'` 23 fi
26 fi 24 DTB_BASE_NAME=`basename ${DTB} .dtb`
27 DTB_BASE_NAME=`basename ${DTB} .dtb` 25 DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
28 DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"` 26 DTB_PATH="${B}/arch/${ARCH}/boot/dts/${DTB}"
29 DTB_PATH="${B}/arch/${ARCH}/boot/dts/${DTB}" 27 if [ ! -e "${DTB_PATH}" ]; then
30 if [ ! -e "${DTB_PATH}" ]; then 28 DTB_PATH="${B}/arch/${ARCH}/boot/${DTB}"
31 DTB_PATH="${B}/arch/${ARCH}/boot/${DTB}" 29 fi
32 fi 30 install -m 0644 ${DTB_PATH} ${D}/${KERNEL_IMAGEDEST}/devicetree-${DTB_SYMLINK_NAME}.dtb
33 install -m 0644 ${DTB_PATH} ${D}/${KERNEL_IMAGEDEST}/devicetree-${DTB_SYMLINK_NAME}.dtb 31 done
34 done
35 fi
36} 32}
37 33
38do_deploy_append() { 34do_deploy_append() {
39 if test -n "${KERNEL_DEVICETREE}"; then 35 for DTB in ${KERNEL_DEVICETREE}; do
40 for DTB in ${KERNEL_DEVICETREE}; do 36 if echo ${DTB} | grep -q '/dts/'; then
41 if echo ${DTB} | grep -q '/dts/'; then 37 bbwarn "${DTB} contains the full path to the the dts file, but only the dtb name should be used."
42 bbwarn "${DTB} contains the full path to the the dts file, but only the dtb name should be used." 38 DTB=`basename ${DTB} | sed 's,\.dts$,.dtb,g'`
43 DTB=`basename ${DTB} | sed 's,\.dts$,.dtb,g'` 39 fi
44 fi 40 DTB_BASE_NAME=`basename ${DTB} .dtb`
45 DTB_BASE_NAME=`basename ${DTB} .dtb` 41 DTB_NAME=`echo ${KERNEL_IMAGE_BASE_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
46 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"`
47 DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"` 43 DTB_PATH="${B}/arch/${ARCH}/boot/dts/${DTB}"
48 DTB_PATH="${B}/arch/${ARCH}/boot/dts/${DTB}" 44 if [ ! -e "${DTB_PATH}" ]; then
49 if [ ! -e "${DTB_PATH}" ]; then 45 DTB_PATH="${B}/arch/${ARCH}/boot/${DTB}"
50 DTB_PATH="${B}/arch/${ARCH}/boot/${DTB}" 46 fi
51 fi 47 install -d ${DEPLOYDIR}
52 install -d ${DEPLOYDIR} 48 install -m 0644 ${DTB_PATH} ${DEPLOYDIR}/${DTB_NAME}.dtb
53 install -m 0644 ${DTB_PATH} ${DEPLOYDIR}/${DTB_NAME}.dtb 49 ln -sf ${DTB_NAME}.dtb ${DEPLOYDIR}/${DTB_SYMLINK_NAME}.dtb
54 ln -sf ${DTB_NAME}.dtb ${DEPLOYDIR}/${DTB_SYMLINK_NAME}.dtb 50 done
55 done
56 fi
57} 51}
58 52
59pkg_postinst_kernel-devicetree () { 53pkg_postinst_kernel-devicetree () {