feat: OTA-Image mit Trailer im Build erzeugen
This commit is contained in:
@@ -15,6 +15,10 @@ function(nl_add_images target)
|
||||
$<TARGET_FILE:${target}> ${out}.bin
|
||||
COMMAND ${NL_WM_TOOL} -b ${out}.bin -sb ${SDK_DIR}/Bin/secboot.img -fc compress -it 2M
|
||||
-ua 100000 -ra 10100 -df -o ${out}
|
||||
COMMAND ${CMAKE_COMMAND} -DVERSION_HEADER=${CMAKE_BINARY_DIR}/generated/nl_version.h
|
||||
-DMKIMAGE=${CMAKE_SOURCE_DIR}/tools/mkimage/nl_mkimage.py -DIMAGE=${out}_gz.img
|
||||
-DDEVICE=${NINLIGHT_DEVICE} -DOUT=${out}_ota.img
|
||||
-P ${CMAKE_SOURCE_DIR}/cmake/run_mkimage.cmake
|
||||
COMMAND ${CMAKE_SIZE} $<TARGET_FILE:${target}>
|
||||
COMMENT "Packing ${target}.fls and ${target}_gz.img")
|
||||
endfunction()
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
file(READ ${VERSION_HEADER} V)
|
||||
string(REGEX MATCH "\"([^\"]*)\"" _m "${V}")
|
||||
set(VERSION "${CMAKE_MATCH_1}")
|
||||
execute_process(COMMAND python3 ${MKIMAGE} --image ${IMAGE} --device ${DEVICE} --version ${VERSION} --out ${OUT}
|
||||
RESULT_VARIABLE rc)
|
||||
if(NOT rc EQUAL 0)
|
||||
message(FATAL_ERROR "nl_mkimage failed (${rc})")
|
||||
endif()
|
||||
Reference in New Issue
Block a user