treewide: validate unified uImage.FIT images before flashing

Prevent flashing truncated or otherwise corrupted uImage.FIT images
by verifying checksums and hashes of all sub-images before flashing
using the newly packaged fit_check_sign tool.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
This commit is contained in:
Daniel Golle
2025-03-29 05:09:09 +00:00
parent 5175d0a623
commit 29ec74b8c7
6 changed files with 19 additions and 15 deletions

View File

@@ -1,5 +1,5 @@
REQUIRE_IMAGE_METADATA=1
RAMFS_COPY_BIN='fitblk'
RAMFS_COPY_BIN='fitblk fit_check_sign'
asus_initial_setup()
{
@@ -224,11 +224,8 @@ platform_check_image() {
xiaomi,redmi-router-ax6000-ubootmod|\
xiaomi,mi-router-wr30u-ubootmod|\
zyxel,ex5601-t0-ubootmod)
[ "$magic" != "d00dfeed" ] && {
echo "Invalid image type."
return 1
}
return 0
fit_check_image "$1"
return $?
;;
nradio,c8-668gl)
# tar magic `ustar`

View File

@@ -1,5 +1,5 @@
REQUIRE_IMAGE_METADATA=1
RAMFS_COPY_BIN='fitblk'
RAMFS_COPY_BIN='fitblk fit_check_sign'
platform_do_upgrade() {
local board=$(board_name)

View File

@@ -1,5 +1,5 @@
REQUIRE_IMAGE_METADATA=1
RAMFS_COPY_BIN='fitblk'
RAMFS_COPY_BIN='fitblk fit_check_sign'
# Legacy full system upgrade including preloader for MediaTek SoCs on eMMC or SD
legacy_mtk_mmc_full_upgrade() {