summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorManjukumar Matha <manjukumar.harthikote-matha@xilinx.com>2019-02-20 10:29:06 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-02-26 23:04:09 +0000
commit084f4de4dbaf9821516fc0254d35f4fb04311d27 (patch)
treecf91b693bc3f1e0c3debb4d19fde99c3e648586a /meta/classes
parenta705c0782c863ee960d65b5109168a4587a0a7b7 (diff)
downloadopenembedded-core-084f4de4dbaf9821516fc0254d35f4fb04311d27.tar.gz
openembedded-core-084f4de4dbaf9821516fc0254d35f4fb04311d27.tar.bz2
openembedded-core-084f4de4dbaf9821516fc0254d35f4fb04311d27.zip
kernel-fitimage.bbclass: Introduce a way to provide external dtb
Currently kernel-fitimage gets the dtb from KERNEL_DEVICETREE, however there are instances when the DTB file can be generated using other recipes, provide a way to include the DTB instead of inkernel device tree. Add support for external device tree during the creation of fitimage. If virtual/dtb is set using PREFERRED_PROVIDER_virtual/dtb = "devicetree", which inherits the devicetree.bbclass then use the path provided in EXTERNAL_KERNEL_DEVICETREE else use KERNEL_DEVICETREE during fitimage process Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/kernel-fitimage.bbclass20
1 files changed, 19 insertions, 1 deletions
diff --git a/meta/classes/kernel-fitimage.bbclass b/meta/classes/kernel-fitimage.bbclass
index 8ebd3ddd1e..3adb1c94db 100644
--- a/meta/classes/kernel-fitimage.bbclass
+++ b/meta/classes/kernel-fitimage.bbclass
@@ -30,6 +30,13 @@ python __anonymous () {
if image:
d.appendVarFlag('do_assemble_fitimage_initramfs', 'depends', ' ${INITRAMFS_IMAGE}:do_image_complete')
+ #check if there are any dtb providers
+ providerdtb = d.getVar("PREFERRED_PROVIDER_virtual/dtb")
+ if providerdtb:
+ d.appendVarFlag('do_assemble_fitimage', 'depends', ' virtual/dtb:do_populate_sysroot')
+ d.appendVarFlag('do_assemble_fitimage_initramfs', 'depends', ' virtual/dtb:do_populate_sysroot')
+ d.setVar('EXTERNAL_KERNEL_DEVICETREE', "${RECIPE_SYSROOT}/boot/devicetree")
+
# Verified boot will sign the fitImage and append the public key to
# U-Boot dtb. We ensure the U-Boot dtb is deployed before assembling
# the fitImage:
@@ -373,7 +380,8 @@ fitimage_assemble() {
#
# Step 2: Prepare a DTB image section
#
- if [ -n "${KERNEL_DEVICETREE}" ]; then
+
+ if [ -z "${EXTERNAL_KERNEL_DEVICETREE}" ] && [ -n "${KERNEL_DEVICETREE}" ]; then
dtbcount=1
for DTB in ${KERNEL_DEVICETREE}; do
if echo ${DTB} | grep -q '/dts/'; then
@@ -391,6 +399,16 @@ fitimage_assemble() {
done
fi
+ if [ -n "${EXTERNAL_KERNEL_DEVICETREE}" ]; then
+ dtbcount=1
+ for DTBFILE in ${EXTERNAL_KERNEL_DEVICETREE}/*.dtb; do
+ DTB=`basename ${DTBFILE}`
+ DTB=$(echo "${DTB}" | tr '/' '_')
+ DTBS="${DTBS} ${DTB}"
+ fitimage_emit_section_dtb ${1} ${DTB} ${DTBFILE}
+ done
+ fi
+
#
# Step 3: Prepare a setup section. (For x86)
#