diff options
author | Randolph Sapp <rs@ti.com> | 2023-05-02 11:56:12 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-05-05 11:07:26 +0100 |
commit | 0fea26cb9a8d70e26a1f09828b6e6d61b24cd7d6 (patch) | |
tree | 50e70bdd76d931f853298f881dbdecf3bb0f7cdf | |
parent | b2797c3fbb9486851b8a705ae9152311bda9556c (diff) | |
download | poky-0fea26cb9a8d70e26a1f09828b6e6d61b24cd7d6.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: 04ab57d20009d85eb566e83ae6fe1dcea4db7300)
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>
-rw-r--r-- | meta/classes-recipe/kernel-devicetree.bbclass | 22 | ||||
-rw-r--r-- | meta/classes-recipe/kernel.bbclass | 2 |
2 files changed, 19 insertions, 5 deletions
diff --git a/meta/classes-recipe/kernel-devicetree.bbclass b/meta/classes-recipe/kernel-devicetree.bbclass index 4d0ecb1032..a6c6c5f227 100644 --- a/meta/classes-recipe/kernel-devicetree.bbclass +++ b/meta/classes-recipe/kernel-devicetree.bbclass | |||
@@ -12,7 +12,12 @@ python () { | |||
12 | d.appendVar("PACKAGES", " ${KERNEL_PACKAGE_NAME}-image-zimage-bundle") | 12 | d.appendVar("PACKAGES", " ${KERNEL_PACKAGE_NAME}-image-zimage-bundle") |
13 | } | 13 | } |
14 | 14 | ||
15 | FILES:${KERNEL_PACKAGE_NAME}-devicetree = "/${KERNEL_IMAGEDEST}/*.dtb /${KERNEL_IMAGEDEST}/*.dtbo" | 15 | FILES:${KERNEL_PACKAGE_NAME}-devicetree = " \ |
16 | /${KERNEL_DTBDEST}/*.dtb \ | ||
17 | /${KERNEL_DTBDEST}/*.dtbo \ | ||
18 | /${KERNEL_DTBDEST}/*/*.dtb \ | ||
19 | /${KERNEL_DTBDEST}/*/*.dtbo \ | ||
20 | " | ||
16 | FILES:${KERNEL_PACKAGE_NAME}-image-zimage-bundle = "/${KERNEL_IMAGEDEST}/zImage-*.dtb.bin" | 21 | FILES:${KERNEL_PACKAGE_NAME}-image-zimage-bundle = "/${KERNEL_IMAGEDEST}/zImage-*.dtb.bin" |
17 | 22 | ||
18 | # Generate kernel+devicetree bundle | 23 | # Generate kernel+devicetree bundle |
@@ -73,12 +78,16 @@ do_compile:append() { | |||
73 | } | 78 | } |
74 | 79 | ||
75 | do_install:append() { | 80 | do_install:append() { |
81 | install -d ${D}/${KERNEL_DTBDEST} | ||
76 | for dtbf in ${KERNEL_DEVICETREE}; do | 82 | for dtbf in ${KERNEL_DEVICETREE}; do |
77 | dtb=`normalize_dtb "$dtbf"` | 83 | dtb=`normalize_dtb "$dtbf"` |
78 | dtb_ext=${dtb##*.} | ||
79 | dtb_base_name=`basename $dtb .$dtb_ext` | ||
80 | dtb_path=`get_real_dtb_path_in_kernel "$dtb"` | 84 | dtb_path=`get_real_dtb_path_in_kernel "$dtb"` |
81 | install -m 0644 $dtb_path ${D}/${KERNEL_IMAGEDEST}/$dtb_base_name.$dtb_ext | 85 | if [ ${KERNEL_DTBVENDORED} == "false" ]; then |
86 | dtb_ext=${dtb##*.} | ||
87 | dtb_base_name=`basename $dtb .$dtb_ext` | ||
88 | dtb=$dtb_base_name.$dtb_ext | ||
89 | fi | ||
90 | install -Dm 0644 $dtb_path ${D}/${KERNEL_DTBDEST}/$dtb | ||
82 | done | 91 | done |
83 | } | 92 | } |
84 | 93 | ||
@@ -88,7 +97,10 @@ do_deploy:append() { | |||
88 | dtb_ext=${dtb##*.} | 97 | dtb_ext=${dtb##*.} |
89 | dtb_base_name=`basename $dtb .$dtb_ext` | 98 | dtb_base_name=`basename $dtb .$dtb_ext` |
90 | install -d $deployDir | 99 | install -d $deployDir |
91 | install -m 0644 ${D}/${KERNEL_IMAGEDEST}/$dtb_base_name.$dtb_ext $deployDir/$dtb_base_name-${KERNEL_DTB_NAME}.$dtb_ext | 100 | if [ ${KERNEL_DTBVENDORED} == "false" ]; then |
101 | dtb=$dtb_base_name.$dtb_ext | ||
102 | fi | ||
103 | install -m 0644 ${D}/${KERNEL_DTBDEST}/$dtb $deployDir/$dtb_base_name-${KERNEL_DTB_NAME}.$dtb_ext | ||
92 | if [ "${KERNEL_IMAGETYPE_SYMLINK}" = "1" ] ; then | 104 | if [ "${KERNEL_IMAGETYPE_SYMLINK}" = "1" ] ; then |
93 | ln -sf $dtb_base_name-${KERNEL_DTB_NAME}.$dtb_ext $deployDir/$dtb_base_name.$dtb_ext | 105 | ln -sf $dtb_base_name-${KERNEL_DTB_NAME}.$dtb_ext $deployDir/$dtb_base_name.$dtb_ext |
94 | fi | 106 | fi |
diff --git a/meta/classes-recipe/kernel.bbclass b/meta/classes-recipe/kernel.bbclass index e634eabd49..8f022b234d 100644 --- a/meta/classes-recipe/kernel.bbclass +++ b/meta/classes-recipe/kernel.bbclass | |||
@@ -215,6 +215,8 @@ KERNEL_RELEASE ?= "${KERNEL_VERSION}" | |||
215 | # The directory where built kernel lies in the kernel tree | 215 | # The directory where built kernel lies in the kernel tree |
216 | KERNEL_OUTPUT_DIR ?= "arch/${ARCH}/boot" | 216 | KERNEL_OUTPUT_DIR ?= "arch/${ARCH}/boot" |
217 | KERNEL_IMAGEDEST ?= "boot" | 217 | KERNEL_IMAGEDEST ?= "boot" |
218 | KERNEL_DTBDEST ?= "${KERNEL_IMAGEDEST}" | ||
219 | KERNEL_DTBVENDORED ?= "false" | ||
218 | 220 | ||
219 | # | 221 | # |
220 | # configuration | 222 | # configuration |