diff options
author | Awais Belal <Awais_Belal@mentor.com> | 2022-08-16 18:58:55 +0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-08-31 16:54:17 +0100 |
commit | 371147d7c08d8f0e16bea0379f085200d852201c (patch) | |
tree | 1922742b729c9d231505416a63751c0377ce7c94 | |
parent | bb8d474166f43835393a7d1bc2a3aca4363b61ae (diff) | |
download | poky-371147d7c08d8f0e16bea0379f085200d852201c.tar.gz |
kernel-fitimage.bbclass: only package unique DTBs
The KERNEL_DEVICETREE and related variables could potentially have a device
tree listed multiple times and this works okay for most scenarios. However,
when we create FIT entries for these we get duplicate nodes and uboot-mkimage
fails with
fit-image-initramfs-image.its:219.58-229.19: ERROR (duplicate_node_names): /images/fdt-freescale_imx8mp-evk-ecspi-slave.dtb: Duplicate node name
fit-image-initramfs-image.its:307.50-317.19: ERROR (duplicate_node_names): /images/fdt-freescale_imx8mp-evk-ndm.dtb: Duplicate node name
fit-image-initramfs-image.its:362.54-372.19: ERROR (duplicate_node_names): /images/fdt-freescale_imx8mp-evk-rm67199.dtb: Duplicate node name
fit-image-initramfs-image.its:417.56-427.19: ERROR (duplicate_node_names): /images/fdt-freescale_imx8mp-evk-usdhc1-m2.dtb: Duplicate node name
fit-image-initramfs-image.its:648.59-658.19: ERROR (duplicate_node_names): /configurations/conf-freescale_imx8mp-evk-ecspi-slave.dtb: Duplicate node name
fit-image-initramfs-image.its:744.51-754.19: ERROR (duplicate_node_names): /configurations/conf-freescale_imx8mp-evk-ndm.dtb: Duplicate node name
fit-image-initramfs-image.its:804.55-814.19: ERROR (duplicate_node_names): /configurations/conf-freescale_imx8mp-evk-rm67199.dtb: Duplicate node name
fit-image-initramfs-image.its:864.57-874.19: ERROR (duplicate_node_names): /configurations/conf-freescale_imx8mp-evk-usdhc1-m2.dtb: Duplicate node name
ERROR: Input tree has errors, aborting (use -f to force output)
uboot-mkimage: Can't open arch/arm64/boot/fitImage.tmp: No such file or directory
We fix this by tracking the DTBs we're compiling in the FIT and only picking
up unique ones.
(From OE-Core rev: c8a24ad8648e0e93342efa35fae35df30be3091f)
Signed-off-by: Awais Belal <awais_belal@mentor.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 98acfea1e82a90c920bdd636033f930ac034b318)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/kernel-fitimage.bbclass | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/meta/classes/kernel-fitimage.bbclass b/meta/classes/kernel-fitimage.bbclass index 7e09b075ff..56d71ba8fa 100644 --- a/meta/classes/kernel-fitimage.bbclass +++ b/meta/classes/kernel-fitimage.bbclass | |||
@@ -527,6 +527,10 @@ fitimage_assemble() { | |||
527 | fi | 527 | fi |
528 | 528 | ||
529 | DTB=$(echo "$DTB" | tr '/' '_') | 529 | DTB=$(echo "$DTB" | tr '/' '_') |
530 | |||
531 | # Skip DTB if we've picked it up previously | ||
532 | echo "$DTBS" | tr ' ' '\n' | grep -xq "$DTB" && continue | ||
533 | |||
530 | DTBS="$DTBS $DTB" | 534 | DTBS="$DTBS $DTB" |
531 | fitimage_emit_section_dtb $1 $DTB $DTB_PATH | 535 | fitimage_emit_section_dtb $1 $DTB $DTB_PATH |
532 | done | 536 | done |
@@ -536,6 +540,10 @@ fitimage_assemble() { | |||
536 | dtbcount=1 | 540 | dtbcount=1 |
537 | for DTB in $(find "${EXTERNAL_KERNEL_DEVICETREE}" \( -name '*.dtb' -o -name '*.dtbo' \) -printf '%P\n' | sort); do | 541 | for DTB in $(find "${EXTERNAL_KERNEL_DEVICETREE}" \( -name '*.dtb' -o -name '*.dtbo' \) -printf '%P\n' | sort); do |
538 | DTB=$(echo "$DTB" | tr '/' '_') | 542 | DTB=$(echo "$DTB" | tr '/' '_') |
543 | |||
544 | # Skip DTB if we've picked it up previously | ||
545 | echo "$DTBS" | tr ' ' '\n' | grep -xq "$DTB" && continue | ||
546 | |||
539 | DTBS="$DTBS $DTB" | 547 | DTBS="$DTBS $DTB" |
540 | fitimage_emit_section_dtb $1 $DTB "${EXTERNAL_KERNEL_DEVICETREE}/$DTB" | 548 | fitimage_emit_section_dtb $1 $DTB "${EXTERNAL_KERNEL_DEVICETREE}/$DTB" |
541 | done | 549 | done |