summaryrefslogtreecommitdiffstats
path: root/meta/classes/kernel-devicetree.bbclass
diff options
context:
space:
mode:
authorRandolph Sapp <rs@ti.com>2023-05-26 18:36:13 -0500
committerSteve Sakoman <steve@sakoman.com>2023-06-01 16:24:07 -1000
commitab21fd0ec11adb6f6f30c3f4c4a38cdaa1ea4903 (patch)
treeba6ecefcd083f9dd255a15b275c3785bfd3f85cd /meta/classes/kernel-devicetree.bbclass
parent08252caaee810c0d70ab8a7571db99f24dbafa36 (diff)
downloadpoky-ab21fd0ec11adb6f6f30c3f4c4a38cdaa1ea4903.tar.gz
kernel-devicetree: allow specification of dtb directory
Fedora/Redhat and Arch are somewhat standardized on their dtb directory structure. Let's add some flags to configure yocto to mimic that behavior. Add the following variables to the kernel class: - KERNEL_DTBDEST (controls the destination directory for dtbs) - KERNEL_DTBVENDORED (controls if vendor subdirectories are to be respected) Currently KERNEL_DTBDEST is expected to be a subdir of KERNEL_IMAGEDEST and KERNEL_DTBVENDORED is expected to be "true"/"false". This only applies to the package directory structure. The deploydir structure is purposely left untouched for compatibility with existing recipes. By default this is configured to behave the same as the current recipe and produce a flat dtb directory at KERNEL_IMAGEDEST. (From OE-Core rev: 77d6118e20751f68ad7104edec8f14dbb5ba6ec1) Signed-off-by: Randolph Sapp <rs@ti.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/classes/kernel-devicetree.bbclass')
-rw-r--r--meta/classes/kernel-devicetree.bbclass22
1 files changed, 17 insertions, 5 deletions
diff --git a/meta/classes/kernel-devicetree.bbclass b/meta/classes/kernel-devicetree.bbclass
index b4338da1b1..11b57adc92 100644
--- a/meta/classes/kernel-devicetree.bbclass
+++ b/meta/classes/kernel-devicetree.bbclass
@@ -6,7 +6,12 @@ python () {
6 d.appendVar("PACKAGES", " ${KERNEL_PACKAGE_NAME}-image-zimage-bundle") 6 d.appendVar("PACKAGES", " ${KERNEL_PACKAGE_NAME}-image-zimage-bundle")
7} 7}
8 8
9FILES:${KERNEL_PACKAGE_NAME}-devicetree = "/${KERNEL_IMAGEDEST}/*.dtb /${KERNEL_IMAGEDEST}/*.dtbo" 9FILES:${KERNEL_PACKAGE_NAME}-devicetree = " \
10 /${KERNEL_DTBDEST}/*.dtb \
11 /${KERNEL_DTBDEST}/*.dtbo \
12 /${KERNEL_DTBDEST}/*/*.dtb \
13 /${KERNEL_DTBDEST}/*/*.dtbo \
14"
10FILES:${KERNEL_PACKAGE_NAME}-image-zimage-bundle = "/${KERNEL_IMAGEDEST}/zImage-*.dtb.bin" 15FILES:${KERNEL_PACKAGE_NAME}-image-zimage-bundle = "/${KERNEL_IMAGEDEST}/zImage-*.dtb.bin"
11 16
12# Generate kernel+devicetree bundle 17# Generate kernel+devicetree bundle
@@ -67,12 +72,16 @@ do_compile:append() {
67} 72}
68 73
69do_install:append() { 74do_install:append() {
75 install -d ${D}/${KERNEL_DTBDEST}
70 for dtbf in ${KERNEL_DEVICETREE}; do 76 for dtbf in ${KERNEL_DEVICETREE}; do
71 dtb=`normalize_dtb "$dtbf"` 77 dtb=`normalize_dtb "$dtbf"`
72 dtb_ext=${dtb##*.}
73 dtb_base_name=`basename $dtb .$dtb_ext`
74 dtb_path=`get_real_dtb_path_in_kernel "$dtb"` 78 dtb_path=`get_real_dtb_path_in_kernel "$dtb"`
75 install -m 0644 $dtb_path ${D}/${KERNEL_IMAGEDEST}/$dtb_base_name.$dtb_ext 79 if [ ${KERNEL_DTBVENDORED} == "false" ]; then
80 dtb_ext=${dtb##*.}
81 dtb_base_name=`basename $dtb .$dtb_ext`
82 dtb=$dtb_base_name.$dtb_ext
83 fi
84 install -Dm 0644 $dtb_path ${D}/${KERNEL_DTBDEST}/$dtb
76 done 85 done
77} 86}
78 87
@@ -82,7 +91,10 @@ do_deploy:append() {
82 dtb_ext=${dtb##*.} 91 dtb_ext=${dtb##*.}
83 dtb_base_name=`basename $dtb .$dtb_ext` 92 dtb_base_name=`basename $dtb .$dtb_ext`
84 install -d $deployDir 93 install -d $deployDir
85 install -m 0644 ${D}/${KERNEL_IMAGEDEST}/$dtb_base_name.$dtb_ext $deployDir/$dtb_base_name-${KERNEL_DTB_NAME}.$dtb_ext 94 if [ ${KERNEL_DTBVENDORED} == "false" ]; then
95 dtb=$dtb_base_name.$dtb_ext
96 fi
97 install -m 0644 ${D}/${KERNEL_DTBDEST}/$dtb $deployDir/$dtb_base_name-${KERNEL_DTB_NAME}.$dtb_ext
86 if [ "${KERNEL_IMAGETYPE_SYMLINK}" = "1" ] ; then 98 if [ "${KERNEL_IMAGETYPE_SYMLINK}" = "1" ] ; then
87 ln -sf $dtb_base_name-${KERNEL_DTB_NAME}.$dtb_ext $deployDir/$dtb_base_name.$dtb_ext 99 ln -sf $dtb_base_name-${KERNEL_DTB_NAME}.$dtb_ext $deployDir/$dtb_base_name.$dtb_ext
88 fi 100 fi