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 30D86C3064D for ; Tue, 2 Jul 2024 08:14:48 +0000 (UTC) Subject: [kirkstone][PATCH] uboot-sign: Fix index error in concat_dtb_helper() with multiple configs To: openembedded-core@lists.openembedded.org From: "Florian Amstutz" X-Originating-Location: Malters, Lucerne, CH (178.197.211.131) X-Originating-Platform: Windows Chrome 126 User-Agent: GROUPS.IO Web Poster MIME-Version: 1.0 Date: Tue, 02 Jul 2024 01:14:40 -0700 Message-ID: Content-Type: multipart/alternative; boundary="qlThGS7C5KF3VoLYZLkB" 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 ; Tue, 02 Jul 2024 08:14:48 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/201414 --qlThGS7C5KF3VoLYZLkB Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Since j is not unset after the inner loop, the image will only be copied for the first configuration. Signed-off-by: Florian Amstutz --- meta/classes/uboot-sign.bbclass | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/meta/classes/uboot-sign.bbclass b/meta/classes/uboot-sign.bbcl= ass index 6bb4ddc600..5b75c8a3b0 100644 --- a/meta/classes/uboot-sign.bbclass +++ b/meta/classes/uboot-sign.bbclass @@ -137,8 +137,7 @@ concat_dtb_helper() { if [ -n "${UBOOT_CONFIG}" ] then - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 i=3D0 - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 j=3D0 + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 unset i j for config in ${UBOOT_MACHINE}; do i=3D$(expr $i + 1); for type in ${UBOOT_CONFIG}; do @@ -148,7 +147,9 @@ concat_dtb_helper() { cp ${UBOOT_IMAGE} ${B}/${CONFIG_B_PATH}/u-boot-$type.${UBOOT_SUFFIX} fi done + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 unset j done + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 unset i fi else bbwarn "Failure while adding public key to u-boot binary. Verified boot won= 't be available." -- 2.34.1 --qlThGS7C5KF3VoLYZLkB Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Since j is not unset after the inner loop, the image will only be copiedfor the first configuration.


Signed-off-by: Florian Ams= tutz <florian.amstutz@scs.ch>
---
 meta/classes/uboot-= sign.bbclass | 5 +++--
 1 file changed, 3 insertions(+), 2 deleti= ons(-)

diff --git a/meta/classes/uboot-sign.bbclass b/meta/class= es/uboot-sign.bbclass
index 6bb4ddc600..5b75c8a3b0 100644
--- a/m= eta/classes/uboot-sign.bbclass
+++ b/meta/classes/uboot-sign.bbclass@@ -137,8 +137,7 @@ concat_dtb_helper() {

    &nbs= p;                   if [ -n "= ${UBOOT_CONFIG}" ]
              &n= bsp;         then
-         &n= bsp;                     = i=3D0
-                  =             j=3D0
+      = ;                     &nb= sp;   unset i j
              =                   for config i= n ${UBOOT_MACHINE}; do
             = ;                     &nb= sp;     i=3D$(expr $i + 1);
        &nbs= p;                     &n= bsp;         for type in ${UBOOT_CONFIG}; do
@@ -1= 48,7 +147,9 @@ concat_dtb_helper() {
         = ;                     &nb= sp;                     &= nbsp;   cp ${UBOOT_IMAGE} ${B}/${CONFIG_B_PATH}/u-boot-$type.${UBOOT_S= UFFIX}
                  =                      = ;         fi
          &n= bsp;                     =         done
+           =                      = ;       unset j
          &nbs= p;                     do= ne
+                   &n= bsp;           unset i
      &= nbsp;                 fi
 = ;               else
    =                     bbwar= n "Failure while adding public key to u-boot binary. Verified boot won't be= available."
--
2.34.1 --qlThGS7C5KF3VoLYZLkB--