diff mbox series

[meta-oe] ast2600:emmc: unsigned rot image align block size (512bytes)

Message ID 20231103052919.3649613-2-jamin_lin@aspeedtech.com
State New
Headers show
Series [meta-oe] ast2600:emmc: unsigned rot image align block size (512bytes) | expand

Commit Message

Jamin Lin Nov. 3, 2023, 5:29 a.m. UTC
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Change-Id: I9b82f11cdf3e8524b99f8dfe6a102fedf2b87e5f
---
 .../recipes-aspeed/images/aspeed-image-gen-secureboot.bb  | 8 ++++++++
 .../recipes-aspeed/images/aspeed-image-emmcboot.bb        | 5 +++++
 2 files changed, 13 insertions(+)
diff mbox series

Patch

diff --git a/meta-aspeed-sdk/meta-ast2600-sdk/recipes-aspeed/images/aspeed-image-gen-secureboot.bb b/meta-aspeed-sdk/meta-ast2600-sdk/recipes-aspeed/images/aspeed-image-gen-secureboot.bb
index 7a6ae1fa0b..f0d046ae58 100644
--- a/meta-aspeed-sdk/meta-ast2600-sdk/recipes-aspeed/images/aspeed-image-gen-secureboot.bb
+++ b/meta-aspeed-sdk/meta-ast2600-sdk/recipes-aspeed/images/aspeed-image-gen-secureboot.bb
@@ -193,6 +193,12 @@  make_recovery_image() {
     python3 ${STAGING_BINDIR_NATIVE}/gen_uart_booting_image.py ${S}/${GEN_IMAGE_MODE}/${SPL_IMAGE_NAME} ${S}/${GEN_IMAGE_MODE}/recovery_${SPL_IMAGE_NAME}
 }
 
+make_emmc_unsigned_rot_image() {
+    if [ -f ${S}/${GEN_IMAGE_MODE}/${SPL_IMAGE_NAME}.unsigned ]; then
+        python3 ${STAGING_BINDIR_NATIVE}/gen_emmc_boot_image.py ${S}/${GEN_IMAGE_MODE}/${SPL_IMAGE_NAME}.unsigned ${S}/${GEN_IMAGE_MODE}/emmc_${SPL_IMAGE_NAME}.unsigned
+    fi
+}
+
 make_boot_partition_ext4() {
     # Generate a compressed ext4 filesystem with the fitImage file in it to be
     # flashed to the user data area at boot partition of the eMMC
@@ -617,6 +623,8 @@  python do_deploy() {
         bb.build.exec_func("make_recovery_image", d)
 
         if aspeed_boot_emmc == "yes":
+            print("Make emmc unsigned rot image")
+            bb.build.exec_func("make_emmc_unsigned_rot_image", d)
             print("Deploy mmc image...")
             deploy_mmc_image(d)
         else:
diff --git a/meta-aspeed-sdk/recipes-aspeed/images/aspeed-image-emmcboot.bb b/meta-aspeed-sdk/recipes-aspeed/images/aspeed-image-emmcboot.bb
index 4faf0d032c..9eb91e8b00 100644
--- a/meta-aspeed-sdk/recipes-aspeed/images/aspeed-image-emmcboot.bb
+++ b/meta-aspeed-sdk/recipes-aspeed/images/aspeed-image-emmcboot.bb
@@ -61,6 +61,11 @@  do_mk_emmc_boot_image_g6() {
         install -m 0644 ${SOURCE_IMAGE_DIR}/${ASPEED_EMMC_IMAGE_UBOOT_SPL_IMAGE}.${UBOOT_SUFFIX} ${OUTPUT_IMAGE_DIR}
     else
         install -m 0644 ${DEPLOY_DIR_IMAGE}/${ASPEED_IMAGE_UBOOT_SPL_IMAGE}.${UBOOT_SUFFIX} ${SOURCE_IMAGE_DIR}/${ASPEED_EMMC_IMAGE_UBOOT_SPL_IMAGE}.${UBOOT_SUFFIX}
+        if [ -f ${DEPLOY_DIR_IMAGE}/${ASPEED_IMAGE_UBOOT_SPL_IMAGE}.${UBOOT_SUFFIX}.unsigned ]; then
+            install -m 0644 ${DEPLOY_DIR_IMAGE}/${ASPEED_IMAGE_UBOOT_SPL_IMAGE}.${UBOOT_SUFFIX}.unsigned ${SOURCE_IMAGE_DIR}
+            python3 ${STAGING_BINDIR_NATIVE}/gen_emmc_boot_image.py ${SOURCE_IMAGE_DIR}/${ASPEED_IMAGE_UBOOT_SPL_IMAGE}.${UBOOT_SUFFIX}.unsigned ${SOURCE_IMAGE_DIR}/${ASPEED_EMMC_IMAGE_UBOOT_SPL_IMAGE}.${UBOOT_SUFFIX}.unsigned
+            install -m 0644 ${SOURCE_IMAGE_DIR}/${ASPEED_EMMC_IMAGE_UBOOT_SPL_IMAGE}.${UBOOT_SUFFIX}.unsigned ${OUTPUT_IMAGE_DIR}
+        fi
     fi
 }