在 mkota.sh中添加 ota_all参数 315/1 315/head
authorSnickerSun <snickersun@163.com>
Tue, 18 Jun 2024 13:04:37 +0000 (21:04 +0800)
committerSnickerSun <snickersun@163.com>
Tue, 18 Jun 2024 13:04:37 +0000 (21:04 +0800)
mkota.sh

index a664853..2720097 100755 (executable)
--- a/mkota.sh
+++ b/mkota.sh
@@ -8,7 +8,7 @@ TARGET_VERSION=`basename $TARGET_DIR`
 RES_DIR=$3
 ROOTDIR=`basename $PWD`
 ADDITIONAL_RES_DIR=$PWD/code/sdk/output/additional_fs
-
+OTA_ALL_FLAG_PATH=$PWD/code/sdk/output/ota_all
 if [ ! -d "$SOURCE_DIR" ] ; then
 echo "$SOURCE_DIR not exist , skip create ota package"
 echo ""
@@ -20,6 +20,13 @@ echo ""
 exit 0
 fi
 
+if [ "$3" == "ota_all" ]; then
+touch $OTA_ALL_FLAG_PATH
+else
+rm $OTA_ALL_FLAG_PATH -f
+fi
+
+
 mkdir code/sdk/output/brandy/TestOTA/ -p
 rm -rf code/sdk/output/brandy/TestOTA/*
 
@@ -67,12 +74,15 @@ cd $PWD/code/sdk/
 cd -
 
 mkdir release/ota -p
-cp code/sdk/output/brandy/TestOTA/upgrade/update.fwpkg release/ota/${SOURCE_VERSION}_2_${TARGET_VERSION}_ota.fwpkg
-echo create ota file release/ota/${SOURCE_VERSION}_2_${TARGET_VERSION}_ota.fwpkg done 
+target_fwpkg_filepath=release/ota/${SOURCE_VERSION}_2_${TARGET_VERSION}_ota.fwpkg
+cp code/sdk/output/brandy/TestOTA/upgrade/update.fwpkg $target_fwpkg_filepath
+fwpkg_filesize=`ls $target_fwpkg_filepath -lh|awk '{print $5}'`
+
+echo create ota file $target_fwpkg_filepath $fwpkg_filesize done
 else
 
 echo ""
-echo "usage: $0 source_release target_release "
+echo "usage: $0 source_release target_release [ota_all]"
 echo ""
 
 fi