]> code.ossystems Code Review - meta-freescale.git/commitdiff
imx-boot-container.bbclass: support having more than one UBOOT_CONFIG 870/head
authorRasmus Villemoes <rasmus.villemoes@prevas.dk>
Fri, 17 Sep 2021 12:40:44 +0000 (14:40 +0200)
committerRasmus Villemoes <rasmus.villemoes@prevas.dk>
Mon, 20 Sep 2021 09:27:27 +0000 (11:27 +0200)
The whole purpose of the UBOOT_CONFIG machinery is to allow one to
build multiple versions of U-Boot within the same recipe, e.g. one for
writing to an eMMC boot partition, and one for use with an SD card for
bootstrapping/recovery. But the current code here assumes UBOOT_CONFIG
consists of just a single word (and normally leading whitespace in that
variable would be harmless).

So use the variable ${type} which gets set in turn to each individual
word in UBOOT_CONFIG, which was probably the original intention
anyway. Add a comment about what the u-boot.itb and flash.bin symlinks
will end up pointing at.

When UBOOT_CONFIG does indeed consist of a single word only, this
changes nothing. But this unbreaks the build and makes the different
artifacts available for the UBOOT_CONFIG = "sd emmc ..." case that may
be used by custom boards.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
classes/imx-boot-container.bbclass

index 41fe9cca739a7b2de99e261564f0e8856469fe27..3f788900836e8d036078a5b623d43bf34bb5bad6 100644 (file)
@@ -85,10 +85,17 @@ do_deploy_append() {
                 j=$(expr $j + 1);
                 if [ $j -eq $i ]
                 then
-                    install -m 0644 ${B}/${config}/u-boot.itb  ${DEPLOYDIR}/u-boot.itb-${MACHINE}-${UBOOT_CONFIG}
-                    install -m 0644 ${B}/${config}/flash.bin  ${DEPLOYDIR}/flash.bin-${MACHINE}-${UBOOT_CONFIG}
-                    ln -sf u-boot.itb-${MACHINE}-${UBOOT_CONFIG} u-boot.itb
-                    ln -sf flash.bin-${MACHINE}-${UBOOT_CONFIG} flash.bin
+                    install -m 0644 ${B}/${config}/u-boot.itb  ${DEPLOYDIR}/u-boot.itb-${MACHINE}-${type}
+                    install -m 0644 ${B}/${config}/flash.bin  ${DEPLOYDIR}/flash.bin-${MACHINE}-${type}
+                    # When there's more than one word in UBOOT_CONFIG,
+                    # this will overwrite the links created in
+                    # previous loop iterations, effectively making
+                    # u-boot.itb and flash.bin correspond to the _last_
+                    # word in UBOOT_CONFIG. This is also how all other
+                    # artifacts handled by oe-core's u-boot.inc are
+                    # treated.
+                    ln -sf u-boot.itb-${MACHINE}-${type} u-boot.itb
+                    ln -sf flash.bin-${MACHINE}-${type} flash.bin
                 fi
             done
             unset  j