From: snickersun Date: Mon, 20 Apr 2026 10:30:15 +0000 (+0800) Subject: 把版本号和编译版本之间建立关联。方便查找版本。 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;ds=inline;p=mirrors%2FASR1603_G5.git 把版本号和编译版本之间建立关联。方便查找版本。 --- diff --git a/2.sdk-ZY/new.bat b/2.sdk-ZY/new.bat index e1adebb8..e521785e 100644 --- a/2.sdk-ZY/new.bat +++ b/2.sdk-ZY/new.bat @@ -1,6 +1,35 @@ @echo off -call new_version.bat %1 +if "%~1"=="" goto usage +set "PROJ_DIR=%~dp0project\%~1" +if not exist "%PROJ_DIR%" goto proj_missing +if not exist "%PROJ_DIR%\new_version.bat" goto ver_missing +pushd "%PROJ_DIR%" +call new_version.bat +if errorlevel 1 goto popd_fail +call new.bat +if errorlevel 1 goto popd_fail +popd +call "%~dp0release_copy.bat" "%~1" +if errorlevel 1 exit /b 1 +exit /b 0 -cd project\%1\ +:popd_fail +popd +exit /b 1 -call new.bat %1 +:proj_missing +echo ERROR: Project directory does not exist: "%PROJ_DIR%" +echo Expected folder: project\%~1 under the SDK root. +exit /b 1 + +:ver_missing +echo ERROR: Cannot find new_version.bat in the project folder. +echo Path: "%PROJ_DIR%\new_version.bat" +echo Create project\%~1\new_version.bat to maintain firmware Version and Build_Time. +exit /b 1 + +:usage +echo ERROR: Missing project name argument. +echo Usage: new.bat ^ +echo Example: new.bat K01 +exit /b 1 diff --git a/2.sdk-ZY/new_clean.bat b/2.sdk-ZY/new_clean.bat index 4c55cdbb..dfe725fd 100644 --- a/2.sdk-ZY/new_clean.bat +++ b/2.sdk-ZY/new_clean.bat @@ -3,5 +3,5 @@ cd Helios_SDK helios clean cd .. -new.bat %1 +call "%~dp0new.bat" "%~1" :exit \ No newline at end of file diff --git a/2.sdk-ZY/new_version.bat b/2.sdk-ZY/new_version.bat deleted file mode 100644 index c4947b90..00000000 --- a/2.sdk-ZY/new_version.bat +++ /dev/null @@ -1,2 +0,0 @@ -echo Version="V1.0" > project\%1%\sdk\services\microPython\ports\quectel\core\versions.py -echo Build_Time="%date:~0,4%-%date:~5,2%-%date:~8,2% %time:~0,8%" >> project\%1%\sdk\services\microPython\ports\quectel\core\versions.py \ No newline at end of file diff --git a/2.sdk-ZY/project/K01/new.bat b/2.sdk-ZY/project/K01/new.bat index c7b80b13..2a124f8f 100644 --- a/2.sdk-ZY/project/K01/new.bat +++ b/2.sdk-ZY/project/K01/new.bat @@ -2,38 +2,34 @@ md images del images /q -@GOTO :STEP1 ..\..\Helios_SDK\tools\ASR_1606\win32\mklfs.exe -c ext -b 4096 -r 4096 -p 4096 -s 1048576 -i .\images\ext_fs.bin if errorlevel 1 ( - echo "ext_fs.bin生成失败 !!!!!!!!!!!!!!! " + echo ERROR: mklfs failed while building ext_fs.bin goto exit ) -if errorlevel 0 ( - echo "ext_fs.bin生成成功 !!!!!!!!!!!!!!! " -) -:STEP1 - ..\..\Helios_SDK\tools\ASR_1606\win32\mklfs.exe -c usr -b 4096 -r 4096 -p 4096 -s 696320 -i .\images\customer_fs.bin if errorlevel 1 ( - echo "customer_fs.bin生成失败 请检查usr目录是否大于316K!!!!!!!!!!!!!!!" + echo ERROR: mklfs failed while building customer_fs.bin + echo usr may exceed LFS capacity - see mklfs -s on the line above + echo Legacy hint: old scripts mentioned ~316K - increase -s or shrink usr goto exit ) -if errorlevel 0 ( - echo "customer_fs.bin生成成功 !!!!!!!!!!!!!!! " -) - -%copy font\ext_font.bin images\ext_font.bin% - +copy /Y font\ext_font.bin images\ext_font.bin ..\..\Helios_SDK\tools\common\win32\7z\7z a sdk\system\platform\ASR_1606\boards\EG810MCN_GA_VOLTE\images\firmware_base_release_pack.zip .\images\ -if errorlevel 0 ( - echo images压缩成功!!!!!!!!!!!!!! -) if errorlevel 1 ( - echo images压缩失败!!!!!!!!!!!!!!!!!! + echo ERROR: 7z failed to pack images into firmware_base_release_pack.zip goto exit ) xcopy sdk\ ..\..\Helios_SDK\ /e/h/y cd ..\..\Helios_SDK helios make services/microPython @EG810MCN_GA_VOLTE EG810MCN_GA_VOLTE +if errorlevel 1 ( + echo ERROR: helios build failed - see compiler output above + cd .. + exit /b 1 +) cd .. -:exit \ No newline at end of file +exit /b 0 + +:exit +exit /b 1 diff --git a/2.sdk-ZY/project/K01/new_version.bat b/2.sdk-ZY/project/K01/new_version.bat new file mode 100644 index 00000000..f7fef1a1 --- /dev/null +++ b/2.sdk-ZY/project/K01/new_version.bat @@ -0,0 +1,6 @@ +@echo off +REM FW version (edit FW_VERSION). Build_Time is generated each run. +set "FW_VERSION=V1.0" + +echo Version="%FW_VERSION%" > sdk\services\microPython\ports\quectel\core\versions.py +echo Build_Time="%date:~0,4%-%date:~5,2%-%date:~8,2% %time:~0,8%" >> sdk\services\microPython\ports\quectel\core\versions.py diff --git a/2.sdk-ZY/project/W9/new.bat b/2.sdk-ZY/project/W9/new.bat index 1f314e93..40fbff58 100644 --- a/2.sdk-ZY/project/W9/new.bat +++ b/2.sdk-ZY/project/W9/new.bat @@ -2,38 +2,34 @@ md images del images /q -@GOTO :STEP1 ..\..\Helios_SDK\tools\ASR_1606\win32\mklfs.exe -c ext -b 4096 -r 4096 -p 4096 -s 1048576 -i .\images\ext_fs.bin if errorlevel 1 ( - echo "ext_fs.bin生成失败 !!!!!!!!!!!!!!! " + echo ERROR: mklfs failed while building ext_fs.bin goto exit ) -if errorlevel 0 ( - echo "ext_fs.bin生成成功 !!!!!!!!!!!!!!! " -) -:STEP1 - ..\..\Helios_SDK\tools\ASR_1606\win32\mklfs.exe -c usr -b 4096 -r 4096 -p 4096 -s 589824 -i .\images\customer_fs.bin if errorlevel 1 ( - echo "customer_fs.bin生成失败 请检查usr目录是否大于316K!!!!!!!!!!!!!!!" + echo ERROR: mklfs failed while building customer_fs.bin + echo usr may exceed LFS capacity - see mklfs -s on the line above + echo Legacy hint: old scripts mentioned ~316K - increase -s or shrink usr goto exit ) -if errorlevel 0 ( - echo "customer_fs.bin生成成功 !!!!!!!!!!!!!!! " -) - -%copy font\ext_font.bin images\ext_font.bin% - +copy /Y font\ext_font.bin images\ext_font.bin ..\..\Helios_SDK\tools\common\win32\7z\7z a sdk\system\platform\ASR_1606\boards\EG810MCN_GA_VOLTE\images\firmware_base_release_pack.zip .\images\ -if errorlevel 0 ( - echo images压缩成功!!!!!!!!!!!!!! -) if errorlevel 1 ( - echo images压缩失败!!!!!!!!!!!!!!!!!! + echo ERROR: 7z failed to pack images into firmware_base_release_pack.zip goto exit ) xcopy sdk\ ..\..\Helios_SDK\ /e/h/y cd ..\..\Helios_SDK helios make services/microPython @EG810MCN_GA_VOLTE EG810MCN_GA_VOLTE +if errorlevel 1 ( + echo ERROR: helios build failed - see compiler output above + cd .. + exit /b 1 +) cd .. -:exit \ No newline at end of file +exit /b 0 + +:exit +exit /b 1 diff --git a/2.sdk-ZY/project/W9/new_version.bat b/2.sdk-ZY/project/W9/new_version.bat new file mode 100644 index 00000000..f7fef1a1 --- /dev/null +++ b/2.sdk-ZY/project/W9/new_version.bat @@ -0,0 +1,6 @@ +@echo off +REM FW version (edit FW_VERSION). Build_Time is generated each run. +set "FW_VERSION=V1.0" + +echo Version="%FW_VERSION%" > sdk\services\microPython\ports\quectel\core\versions.py +echo Build_Time="%date:~0,4%-%date:~5,2%-%date:~8,2% %time:~0,8%" >> sdk\services\microPython\ports\quectel\core\versions.py diff --git a/2.sdk-ZY/release_copy.bat b/2.sdk-ZY/release_copy.bat new file mode 100644 index 00000000..6f84d29b --- /dev/null +++ b/2.sdk-ZY/release_copy.bat @@ -0,0 +1,84 @@ +@echo off +setlocal EnableDelayedExpansion +REM Copy Helios_SDK\opt\release\\ to release\__