From 9a9b96e1ca66e3717b406c63e638c13d7322c161 Mon Sep 17 00:00:00 2001
From: guowenxue <guowenxue@gmail.com>
Date: Tue, 22 Aug 2023 10:05:46 +0800
Subject: [PATCH] Update image build script, fix u-boot deploy sector bug

---
 images/build.sh |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/images/build.sh b/images/build.sh
index 9460037..41e207e 100755
--- a/images/build.sh
+++ b/images/build.sh
@@ -91,7 +91,7 @@
     export BOOT_SIZE=`jq -r ".system.bootsize" $CONF_FILE | tr 'A-Z' 'a-z'`
 
     export ROOTFS=rootfs-${DISTRO}-${DISVER}
-    export IMAGE_NAME=$BOARD-$DISTRO-$DISVER-$BSPVER.img
+    export IMAGE_NAME=$DISTRO-$DISVER-$BSPVER.img
 
 
     # i.MX6ULL only need build uboot-imx
@@ -180,7 +180,7 @@
     sync
 
     pr_info "start install u-boot image"
-    dd if=$UBOOT_BINPATH/u-boot-${BOARD}.imx of=${IMAGE_NAME} bs=512 seek=66 conv=notrunc,sync
+    dd if=$UBOOT_BINPATH/u-boot-${BOARD}.imx of=${IMAGE_NAME} bs=512 seek=${UBOOT_SECTOR} conv=notrunc,sync
 
     pr_info "start install linux kernel images"
     mkdir -p $MNT_POINT
@@ -254,8 +254,13 @@
     cp $UBOOT_BINPATH/u-boot-${BOARD}.imx $INST_PATH
     mv $IMAGE_NAME $INST_PATH
 
+    cd $INST_PATH
+
+    pr_info "\ncompress system images $IMAGE_NAME"
+    bzip2 $IMAGE_NAME
+
     pr_info "\nsystem images installed to '$INST_PATH'"
-    ls $INST_PATH && echo ""
+    ls && echo ""
 }
 
 function do_clean()

--
Gitblit v1.9.1