From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1888BC32771 for ; Wed, 17 Aug 2022 16:09:56 +0000 (UTC) Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com [68.232.137.252]) by mx.groups.io with SMTP id smtpd.web08.30784.1660752594427369297 for ; Wed, 17 Aug 2022 09:09:54 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: mentor.com, ip: 68.232.137.252, mailfrom: awais_belal@mentor.com) X-IronPort-AV: E=Sophos;i="5.93,243,1654588800"; d="scan'208,217";a="81462248" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa4.mentor.iphmx.com with ESMTP; 17 Aug 2022 08:09:51 -0800 IronPort-SDR: 3+rk5fEKUmHhXhJsH9+MJKlW88M5lj5jWNgG5ukSl0BVSbnsFX0uZnSzyTVbDiaVnohVuDqdZx yFVzJsqZB6sKbQQhvf0qZVjiBcD59sOtFbDOTooaeRY1iK3c22fmDnniEg30FEb39hdH63hHxI Bp4/FqbJ+4wFmKDNBYPRJUrCBMxN8SuBH4MKpV8gDte5G4Ry0+C4qfXjcUAwM4W3khnRbPLlDr OADveo+dYLp7Jw/lJW3Vv+z2eMER1bLSYjMK8O1Iew9SMVBqMoV3jjgMxGDeIoZXDCWcvrMgCu DIk= From: "Belal, Awais" To: "openembedded-core@lists.openembedded.org" Subject: Re: [OE-core] [[PATCH v2] kernel-fitimage.bbclass: only package unique DTBs Thread-Topic: [OE-core] [[PATCH v2] kernel-fitimage.bbclass: only package unique DTBs Thread-Index: AQHYsXhnul1RB+dXikan6IT62T7lLq2zRHv/ Date: Wed, 17 Aug 2022 16:09:46 +0000 Message-ID: References: <170BD7FB076CA188.19212@lists.openembedded.org> In-Reply-To: <170BD7FB076CA188.19212@lists.openembedded.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [137.202.0.90] Content-Type: multipart/alternative; boundary="_000_e840813aa69c4b968e839da161d735c8mentorcom_" MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 17 Aug 2022 16:09:56 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/169493 --_000_e840813aa69c4b968e839da161d735c8mentorcom_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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=3Dm= aster-next&id=3Df5c128008365e141082c129417eb72d2751e8045 ? BR, Awais ________________________________ From: 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-mkima= ge 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 n= ame 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 nam= e 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 dir= ectory We fix this by tracking the DTBs we're compiling in the FIT and only pickin= g up unique ones. Signed-off-by: Awais Belal --- meta/classes/kernel-fitimage.bbclass | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/meta/classes/kernel-fitimage.bbclass b/meta/classes/kernel-fit= image.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=3D$(echo "$DTB" | tr '/' '_') + + # Skip DTB if we've picked it up previously + echo "$DTBS" | tr ' ' '\n' | grep -xq "$DTB" && con= tinue + DTBS=3D"$DTBS $DTB" fitimage_emit_section_dtb $1 $DTB $DTB_PATH done @@ -536,6 +540,10 @@ fitimage_assemble() { dtbcount=3D1 for DTB in $(find "${EXTERNAL_KERNEL_DEVICETREE}" \( -name= '*.dtb' -o -name '*.dtbo' \) -printf '%P\n' | sort); do DTB=3D$(echo "$DTB" | tr '/' '_') + + # Skip DTB if we've picked it up previously + echo "$DTBS" | tr ' ' '\n' | grep -xq "$DTB" && con= tinue + DTBS=3D"$DTBS $DTB" fitimage_emit_section_dtb $1 $DTB "${EXTERNAL_KERN= EL_DEVICETREE}/$DTB" done -- 2.25.1 --_000_e840813aa69c4b968e839da161d735c8mentorcom_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

From: openembedded-core@l= ists.openembedded.org <openembedded-core@lists.openembedded.org> on b= ehalf 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-mkima= ge
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 n= ame
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<= br> fit-image-initramfs-image.its:864.57-874.19: ERROR (duplicate_node_names): = /configurations/conf-freescale_imx8mp-evk-usdhc1-m2.dtb: Duplicate node nam= e
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 dir= ectory

We fix this by tracking the DTBs we're compiling in the FIT and only pickin= g
up unique ones.

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

diff --git a/meta/classes/kernel-fitimage.bbclass b/meta/classes/kernel-fit= image.bbclass
index 7e09b075ff..56d71ba8fa 100644
--- a/meta/classes/kernel-fitimage.bbclass
+++ b/meta/classes/kernel-fitimage.bbclass
@@ -527,6 +527,10 @@ fitimage_assemble() {
            &nb= sp;            fi  
            &nb= sp;            DTB= =3D$(echo "$DTB" | tr '/' '_')
+
+           &nbs= p;           # Skip DTB i= f we've picked it up previously
+           &nbs= p;           echo "$= DTBS" | tr ' ' '\n' | grep -xq "$DTB" && continue +
            &nb= sp;            DTBS= =3D"$DTBS $DTB"
            &nb= sp;            fitim= age_emit_section_dtb $1 $DTB $DTB_PATH
            &nb= sp;    done
@@ -536,6 +540,10 @@ fitimage_assemble() {
            &nb= sp;    dtbcount=3D1
            &nb= sp;    for DTB in $(find "${EXTERNAL_KERNEL_DEVICETREE}= " \( -name '*.dtb' -o -name '*.dtbo' \) -printf '%P\n' | sort); do
            &nb= sp;            DTB= =3D$(echo "$DTB" | tr '/' '_')
+
+           &nbs= p;           # Skip DTB i= f we've picked it up previously
+           &nbs= p;           echo "$= DTBS" | tr ' ' '\n' | grep -xq "$DTB" && continue +
            &nb= sp;            DTBS= =3D"$DTBS $DTB"
            &nb= sp;            fitim= age_emit_section_dtb $1 $DTB "${EXTERNAL_KERNEL_DEVICETREE}/$DTB"=
            &nb= sp;    done
--
2.25.1

--_000_e840813aa69c4b968e839da161d735c8mentorcom_--