Openembedded Core Discussions
 help / color / mirror / Atom feed
* Re: [OE-core] [[PATCH v2] kernel-fitimage.bbclass: only package unique DTBs
       [not found] <170BD7FB076CA188.19212@lists.openembedded.org>
@ 2022-08-17 16:09 ` Belal, Awais
  2022-08-17 17:43   ` Alexandre Belloni
  0 siblings, 1 reply; 2+ messages in thread
From: Belal, Awais @ 2022-08-17 16:09 UTC (permalink / raw)
  To: openembedded-core@lists.openembedded.org

[-- Attachment #1: Type: text/plain, Size: 3603 bytes --]

Do I need to send an update here to align with https://git.openembedded.org/openembedded-core/commit/meta/classes-recipe/kernel-fitimage.bbclass?h=master-next&id=f5c128008365e141082c129417eb72d2751e8045 ?


BR,
Awais
________________________________
From: openembedded-core@lists.openembedded.org <openembedded-core@lists.openembedded.org> on behalf of Belal, Awais
Sent: Tuesday, August 16, 2022 6:58:55 PM
To: openembedded-core@lists.openembedded.org
Subject: [OE-core] [[PATCH v2] 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.

Signed-off-by: Awais Belal <awais_belal@mentor.com>
---
 meta/classes/kernel-fitimage.bbclass | 8 ++++++++
 1 file changed, 8 insertions(+)

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() {
                         fi

                         DTB=$(echo "$DTB" | tr '/' '_')
+
+                       # Skip DTB if we've picked it up previously
+                       echo "$DTBS" | tr ' ' '\n' | grep -xq "$DTB" && continue
+
                         DTBS="$DTBS $DTB"
                         fitimage_emit_section_dtb $1 $DTB $DTB_PATH
                 done
@@ -536,6 +540,10 @@ fitimage_assemble() {
                 dtbcount=1
                 for DTB in $(find "${EXTERNAL_KERNEL_DEVICETREE}" \( -name '*.dtb' -o -name '*.dtbo' \) -printf '%P\n' | sort); do
                         DTB=$(echo "$DTB" | tr '/' '_')
+
+                       # Skip DTB if we've picked it up previously
+                       echo "$DTBS" | tr ' ' '\n' | grep -xq "$DTB" && continue
+
                         DTBS="$DTBS $DTB"
                         fitimage_emit_section_dtb $1 $DTB "${EXTERNAL_KERNEL_DEVICETREE}/$DTB"
                 done
--
2.25.1


[-- Attachment #2: Type: text/html, Size: 7128 bytes --]

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [OE-core] [[PATCH v2] kernel-fitimage.bbclass: only package unique DTBs
  2022-08-17 16:09 ` [OE-core] [[PATCH v2] kernel-fitimage.bbclass: only package unique DTBs Belal, Awais
@ 2022-08-17 17:43   ` Alexandre Belloni
  0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Belloni @ 2022-08-17 17:43 UTC (permalink / raw)
  To: Awais Belal; +Cc: openembedded-core@lists.openembedded.org

Hi,

On 17/08/2022 16:09:46+0000, Awais Belal wrote:
> Do I need to send an update here to align with https://git.openembedded.org/openembedded-core/commit/meta/classes-recipe/kernel-fitimage.bbclass?h=master-next&id=f5c128008365e141082c129417eb72d2751e8045 ?
> 

I have the patch in my master-next and I believe the merge was correct.
This is under testing right now.

> 
> BR,
> Awais
> ________________________________
> From: openembedded-core@lists.openembedded.org <openembedded-core@lists.openembedded.org> on behalf of Belal, Awais
> Sent: Tuesday, August 16, 2022 6:58:55 PM
> To: openembedded-core@lists.openembedded.org
> Subject: [OE-core] [[PATCH v2] 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.
> 
> Signed-off-by: Awais Belal <awais_belal@mentor.com>
> ---
>  meta/classes/kernel-fitimage.bbclass | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> 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() {
>                          fi
> 
>                          DTB=$(echo "$DTB" | tr '/' '_')
> +
> +                       # Skip DTB if we've picked it up previously
> +                       echo "$DTBS" | tr ' ' '\n' | grep -xq "$DTB" && continue
> +
>                          DTBS="$DTBS $DTB"
>                          fitimage_emit_section_dtb $1 $DTB $DTB_PATH
>                  done
> @@ -536,6 +540,10 @@ fitimage_assemble() {
>                  dtbcount=1
>                  for DTB in $(find "${EXTERNAL_KERNEL_DEVICETREE}" \( -name '*.dtb' -o -name '*.dtbo' \) -printf '%P\n' | sort); do
>                          DTB=$(echo "$DTB" | tr '/' '_')
> +
> +                       # Skip DTB if we've picked it up previously
> +                       echo "$DTBS" | tr ' ' '\n' | grep -xq "$DTB" && continue
> +
>                          DTBS="$DTBS $DTB"
>                          fitimage_emit_section_dtb $1 $DTB "${EXTERNAL_KERNEL_DEVICETREE}/$DTB"
>                  done
> --
> 2.25.1
> 

> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#169493): https://lists.openembedded.org/g/openembedded-core/message/169493
> Mute This Topic: https://lists.openembedded.org/mt/93059092/3617179
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alexandre.belloni@bootlin.com]
> -=-=-=-=-=-=-=-=-=-=-=-
> 


-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-08-17 17:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <170BD7FB076CA188.19212@lists.openembedded.org>
2022-08-17 16:09 ` [OE-core] [[PATCH v2] kernel-fitimage.bbclass: only package unique DTBs Belal, Awais
2022-08-17 17:43   ` Alexandre Belloni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox