]> code.ossystems Code Review - meta-freescale.git/commitdiff
imx-boot,u-boot-imx: Add bootloader image size to SD card image
authorTom Hochstein <tom.hochstein@nxp.com>
Thu, 13 Jan 2022 23:56:08 +0000 (17:56 -0600)
committerTom Hochstein <tom.hochstein@nxp.com>
Wed, 19 Jan 2022 21:50:12 +0000 (15:50 -0600)
Append a tag to the bootloader image used in the SD card image. The tag
contains the size of the bootloader image so UUU can easily find the end of
the bootloader in the SD card image.

Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
classes/uuu_bootloader_tag.bbclass [new file with mode: 0644]
recipes-bsp/imx-mkimage/imx-boot_1.0.bb
recipes-bsp/u-boot/u-boot-imx-mfgtool_2021.04.bb
recipes-bsp/u-boot/u-boot-imx_2021.04.bb

diff --git a/classes/uuu_bootloader_tag.bbclass b/classes/uuu_bootloader_tag.bbclass
new file mode 100644 (file)
index 0000000..fb6acd7
--- /dev/null
@@ -0,0 +1,11 @@
+# Append a tag to the bootloader image used in the SD card image. The tag
+# contains the size of the bootloader image so UUU can easily find the end of
+# the bootloader in the SD card image.
+do_deploy:append() {
+    if [ "${UUU_BOOTLOADER}" != "" ]; then
+        cp ${DEPLOYDIR}/${UUU_BOOTLOADER}   ${DEPLOYDIR}/${UUU_BOOTLOADER_TAGGED}
+        ln -sf ${UUU_BOOTLOADER_TAGGED}     ${DEPLOYDIR}/${UUU_BOOTLOADER}
+        stat -L -cUUUBURNXXOEUZX7+A-XY5601QQWWZ%sEND ${DEPLOYDIR}/${UUU_BOOTLOADER} \
+                                         >> ${DEPLOYDIR}/${UUU_BOOTLOADER}
+    fi
+}
index f8ebb7308bfa63aa50f45a95478a07fa6d1799f9..b332e0799f726387fc5bd61954e5092338c07007 100644 (file)
@@ -24,7 +24,10 @@ DEPENDS:append:mx8m = " u-boot-mkimage-native dtc-native"
 BOOT_NAME = "imx-boot"
 PROVIDES = "${BOOT_NAME}"
 
-inherit deploy
+inherit deploy uuu_bootloader_tag
+
+UUU_BOOTLOADER        = "${BOOT_NAME}"
+UUU_BOOTLOADER_TAGGED = "${BOOT_NAME}-tagged"
 
 # Add CFLAGS with native INCDIR & LIBDIR for imx-mkimage build
 CFLAGS = "-O2 -Wall -std=c99 -I ${STAGING_INCDIR_NATIVE} -L ${STAGING_LIBDIR_NATIVE}"
@@ -190,9 +193,8 @@ do_deploy() {
         fi
         install -m 0644 ${S}/${BOOT_CONFIG_MACHINE}-${target} ${DEPLOYDIR}
     done
-    cd ${DEPLOYDIR}
-    ln -sf ${BOOT_CONFIG_MACHINE}-${IMAGE_IMXBOOT_TARGET} ${BOOT_NAME}
-    cd -
+
+    ln -sf ${BOOT_CONFIG_MACHINE}-${IMAGE_IMXBOOT_TARGET}    ${DEPLOYDIR}/${BOOT_NAME}
 }
 addtask deploy before do_build after do_compile
 
index af5028896a34baf271eb035262a176600e0feb56..5443ceacfa14198d2a6b3ae938867250598171c3 100644 (file)
@@ -6,3 +6,7 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/u-boot-imx:"
 
 require u-boot-imx_${PV}.bb
 require u-boot-mfgtool.inc
+
+UUU_BOOTLOADER_TAGGED     = ""
+UUU_BOOTLOADER_TAGGED:mx6 = "u-boot-mfgtool-tagged.${UBOOT_SUFFIX}"
+UUU_BOOTLOADER_TAGGED:mx7 = "u-boot-mfgtool-tagged.${UBOOT_SUFFIX}"
index bb5809e2a179894473ce4e8b92ac02742d2a31d6..96552eef9325f47c2ea45095e29d33b8bf037954 100644 (file)
@@ -7,6 +7,15 @@ require u-boot-imx-common_${PV}.inc
 
 PROVIDES += "u-boot"
 
+inherit uuu_bootloader_tag
+
+UUU_BOOTLOADER            = ""
+UUU_BOOTLOADER:mx6        = "${UBOOT_BINARY}"
+UUU_BOOTLOADER:mx7        = "${UBOOT_BINARY}"
+UUU_BOOTLOADER_TAGGED     = ""
+UUU_BOOTLOADER_TAGGED:mx6 = "u-boot-tagged.${UBOOT_SUFFIX}"
+UUU_BOOTLOADER_TAGGED:mx7 = "u-boot-tagged.${UBOOT_SUFFIX}"
+
 do_deploy:append:mx8m() {
     # Deploy u-boot-nodtb.bin and fsl-imx8m*-XX.dtb for mkimage to generate boot binary
     if [ -n "${UBOOT_CONFIG}" ]