diff options
| author | Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com> | 2019-02-20 10:29:06 -0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-02-26 23:04:31 +0000 |
| commit | a55784451eaddcbe77c61a04f2f7f527ea75834b (patch) | |
| tree | 57bd913c9f9ed11b392d7e4ea4a8cae02d455794 | |
| parent | dda95279a7c428934a67dc2db03b8c3e5d72b914 (diff) | |
| download | poky-a55784451eaddcbe77c61a04f2f7f527ea75834b.tar.gz | |
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
(From OE-Core rev: 084f4de4dbaf9821516fc0254d35f4fb04311d27)
Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/classes/kernel-fitimage.bbclass | 20 |
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 () { | |||
| 30 | if image: | 30 | if image: |
| 31 | d.appendVarFlag('do_assemble_fitimage_initramfs', 'depends', ' ${INITRAMFS_IMAGE}:do_image_complete') | 31 | d.appendVarFlag('do_assemble_fitimage_initramfs', 'depends', ' ${INITRAMFS_IMAGE}:do_image_complete') |
| 32 | 32 | ||
| 33 | #check if there are any dtb providers | ||
| 34 | providerdtb = d.getVar("PREFERRED_PROVIDER_virtual/dtb") | ||
| 35 | if providerdtb: | ||
| 36 | d.appendVarFlag('do_assemble_fitimage', 'depends', ' virtual/dtb:do_populate_sysroot') | ||
| 37 | d.appendVarFlag('do_assemble_fitimage_initramfs', 'depends', ' virtual/dtb:do_populate_sysroot') | ||
| 38 | d.setVar('EXTERNAL_KERNEL_DEVICETREE', "${RECIPE_SYSROOT}/boot/devicetree") | ||
| 39 | |||
| 33 | # Verified boot will sign the fitImage and append the public key to | 40 | # Verified boot will sign the fitImage and append the public key to |
| 34 | # U-Boot dtb. We ensure the U-Boot dtb is deployed before assembling | 41 | # U-Boot dtb. We ensure the U-Boot dtb is deployed before assembling |
| 35 | # the fitImage: | 42 | # the fitImage: |
| @@ -373,7 +380,8 @@ fitimage_assemble() { | |||
| 373 | # | 380 | # |
| 374 | # Step 2: Prepare a DTB image section | 381 | # Step 2: Prepare a DTB image section |
| 375 | # | 382 | # |
| 376 | if [ -n "${KERNEL_DEVICETREE}" ]; then | 383 | |
| 384 | if [ -z "${EXTERNAL_KERNEL_DEVICETREE}" ] && [ -n "${KERNEL_DEVICETREE}" ]; then | ||
| 377 | dtbcount=1 | 385 | dtbcount=1 |
| 378 | for DTB in ${KERNEL_DEVICETREE}; do | 386 | for DTB in ${KERNEL_DEVICETREE}; do |
| 379 | if echo ${DTB} | grep -q '/dts/'; then | 387 | if echo ${DTB} | grep -q '/dts/'; then |
| @@ -391,6 +399,16 @@ fitimage_assemble() { | |||
| 391 | done | 399 | done |
| 392 | fi | 400 | fi |
| 393 | 401 | ||
| 402 | if [ -n "${EXTERNAL_KERNEL_DEVICETREE}" ]; then | ||
| 403 | dtbcount=1 | ||
| 404 | for DTBFILE in ${EXTERNAL_KERNEL_DEVICETREE}/*.dtb; do | ||
| 405 | DTB=`basename ${DTBFILE}` | ||
| 406 | DTB=$(echo "${DTB}" | tr '/' '_') | ||
| 407 | DTBS="${DTBS} ${DTB}" | ||
| 408 | fitimage_emit_section_dtb ${1} ${DTB} ${DTBFILE} | ||
| 409 | done | ||
| 410 | fi | ||
| 411 | |||
| 394 | # | 412 | # |
| 395 | # Step 3: Prepare a setup section. (For x86) | 413 | # Step 3: Prepare a setup section. (For x86) |
| 396 | # | 414 | # |
