diff options
| author | Florian Amstutz <florian.amstutz@scs.ch> | 2024-07-16 14:19:56 +0000 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2024-07-24 07:51:58 -0700 |
| commit | 322d4df8cb51b531a998de92298914a6710d7677 (patch) | |
| tree | fa7de352013fb0dfc49d72f5c7967ade50b98cce | |
| parent | b1b94b434da2f507a9354607ae8c3a466fd65cdc (diff) | |
| download | poky-322d4df8cb51b531a998de92298914a6710d7677.tar.gz | |
uboot-sign: Fix index error in concat_dtb_helper() with multiple configs
Commit 60774248a5570899a66f9f88e597cc4f723d6278 solves issues when i or j
have been set in other shell functions.
Since j is not unset after the inner loop, the image will only be copied
for the first configuration.
Unsetting i and j after the loops also prevents index issues in other functions.
(From OE-Core rev: f6de96c9fa8d0b6c81c32016f342ad93c8940d9e)
Signed-off-by: Florian Amstutz <florian.amstutz@scs.ch>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
| -rw-r--r-- | meta/classes/uboot-sign.bbclass | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/meta/classes/uboot-sign.bbclass b/meta/classes/uboot-sign.bbclass index 6bb4ddc600..f3bbd8980e 100644 --- a/meta/classes/uboot-sign.bbclass +++ b/meta/classes/uboot-sign.bbclass | |||
| @@ -137,8 +137,7 @@ concat_dtb_helper() { | |||
| 137 | 137 | ||
| 138 | if [ -n "${UBOOT_CONFIG}" ] | 138 | if [ -n "${UBOOT_CONFIG}" ] |
| 139 | then | 139 | then |
| 140 | i=0 | 140 | unset i j |
| 141 | j=0 | ||
| 142 | for config in ${UBOOT_MACHINE}; do | 141 | for config in ${UBOOT_MACHINE}; do |
| 143 | i=$(expr $i + 1); | 142 | i=$(expr $i + 1); |
| 144 | for type in ${UBOOT_CONFIG}; do | 143 | for type in ${UBOOT_CONFIG}; do |
| @@ -146,9 +145,12 @@ concat_dtb_helper() { | |||
| 146 | if [ $j -eq $i ] | 145 | if [ $j -eq $i ] |
| 147 | then | 146 | then |
| 148 | cp ${UBOOT_IMAGE} ${B}/${CONFIG_B_PATH}/u-boot-$type.${UBOOT_SUFFIX} | 147 | cp ${UBOOT_IMAGE} ${B}/${CONFIG_B_PATH}/u-boot-$type.${UBOOT_SUFFIX} |
| 148 | break | ||
| 149 | fi | 149 | fi |
| 150 | done | 150 | done |
| 151 | unset j | ||
| 151 | done | 152 | done |
| 153 | unset i | ||
| 152 | fi | 154 | fi |
| 153 | else | 155 | else |
| 154 | bbwarn "Failure while adding public key to u-boot binary. Verified boot won't be available." | 156 | bbwarn "Failure while adding public key to u-boot binary. Verified boot won't be available." |
