Files
templates/tools/firmware-build/keil/postcompile.bat
Andrey da055c2787 feat(firmware-info): архивируй сборки по хешу и дате
Создай в postcompile CCS и Keil папку по commit исходников и UTC-времени precompile. Сохрани точные образы, manifest, SHA-256 и метаданные, сохраняя прежние выходные файлы. Опиши копирование каталогов в SETGUI и проверь разные даты, целостность и Git-метаданные.
2026-10-08 15:31:13 +03:00

34 lines
1.3 KiB
Batchfile

@echo off
setlocal EnableExtensions DisableDelayedExpansion
if /i "%~1"=="--identity" goto identity
rem Legacy mode retained for existing SETGUI publication configurations.
if "%~1"=="" goto usage
if not "%~2"=="" goto usage
if not exist "%~1" (
echo [firmware-build] Release config not found: "%~1" 1>&2
exit /b 2
)
call "%~dp0..\..\firmware-publish\PUBLISH_FIRMWARE.bat" --config "%~f1" --preflight
exit /b %errorlevel%
:identity
if "%~2"=="" goto usage
if "%~3"=="" goto usage
if not "%~4"=="" goto usage
if /i not "%~x2"==".hex" if /i not "%~x2"==".bin" (
echo [firmware-build] Expected a ready HEX or BIN image: "%~2" 1>&2
exit /b 2
)
python "%~dp0..\..\..\c\firmware-info\tools\identity.py" seal --image "%~f2" --metadata "%~f3"
if errorlevel 1 exit /b %errorlevel%
python "%~dp0..\..\..\c\firmware-info\tools\identity.py" verify --image "%~f2" --manifest "%~f2.manifest.json"
if errorlevel 1 exit /b %errorlevel%
python "%~dp0..\..\..\c\firmware-info\tools\identity.py" archive --image "%~f2" --metadata "%~f3"
if errorlevel 1 exit /b %errorlevel%
echo [firmware-build] Image: "%~f2"
echo [firmware-build] Manifest: "%~f2.manifest.json"
echo [firmware-build] SHA-256: "%~f2.sha256"
exit /b 0
:usage
echo Usage: postcompile.bat --identity "image.hex-or-bin" "generated-metadata.json" 1>&2
exit /b 2