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-21 22:51:41 +0100 |
| commit | c8570ddf2ef92a3f063004af3fb327918bbe83a5 (patch) | |
| tree | ff09dee3036f0de213f36e3d1801047e88e71c64 /meta/classes-recipe | |
| parent | 44c867d7fbbc6224ca98e07061a24418fab29bf8 (diff) | |
| download | poky-c8570ddf2ef92a3f063004af3fb327918bbe83a5.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: 98acfea1e82a90c920bdd636033f930ac034b318)
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>
Diffstat (limited to 'meta/classes-recipe')
| -rw-r--r-- | meta/classes-recipe/kernel-fitimage.bbclass | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/meta/classes-recipe/kernel-fitimage.bbclass b/meta/classes-recipe/kernel-fitimage.bbclass index 838ce204cb..107914e28c 100644 --- a/meta/classes-recipe/kernel-fitimage.bbclass +++ b/meta/classes-recipe/kernel-fitimage.bbclass | |||
| @@ -535,6 +535,10 @@ fitimage_assemble() { | |||
| 535 | fi | 535 | fi |
| 536 | 536 | ||
| 537 | DTB=$(echo "$DTB" | tr '/' '_') | 537 | DTB=$(echo "$DTB" | tr '/' '_') |
| 538 | |||
| 539 | # Skip DTB if we've picked it up previously | ||
| 540 | echo "$DTBS" | tr ' ' '\n' | grep -xq "$DTB" && continue | ||
| 541 | |||
| 538 | DTBS="$DTBS $DTB" | 542 | DTBS="$DTBS $DTB" |
| 539 | fitimage_emit_section_dtb $1 $DTB $DTB_PATH | 543 | fitimage_emit_section_dtb $1 $DTB $DTB_PATH |
| 540 | done | 544 | done |
| @@ -544,6 +548,10 @@ fitimage_assemble() { | |||
| 544 | dtbcount=1 | 548 | dtbcount=1 |
| 545 | for DTB in $(find "${EXTERNAL_KERNEL_DEVICETREE}" \( -name '*.dtb' -o -name '*.dtbo' \) -printf '%P\n' | sort); do | 549 | for DTB in $(find "${EXTERNAL_KERNEL_DEVICETREE}" \( -name '*.dtb' -o -name '*.dtbo' \) -printf '%P\n' | sort); do |
| 546 | DTB=$(echo "$DTB" | tr '/' '_') | 550 | DTB=$(echo "$DTB" | tr '/' '_') |
| 551 | |||
| 552 | # Skip DTB if we've picked it up previously | ||
| 553 | echo "$DTBS" | tr ' ' '\n' | grep -xq "$DTB" && continue | ||
| 554 | |||
| 547 | DTBS="$DTBS $DTB" | 555 | DTBS="$DTBS $DTB" |
| 548 | fitimage_emit_section_dtb $1 $DTB "${EXTERNAL_KERNEL_DEVICETREE}/$DTB" | 556 | fitimage_emit_section_dtb $1 $DTB "${EXTERNAL_KERNEL_DEVICETREE}/$DTB" |
| 549 | done | 557 | done |
