brcm2708: convert to metadata

This patch converts all the raspberrypi images to utilize
the common metadata-based image verification.

Note: the CM1 and CM3 currently use the same "rpi-cm"
boardname.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
This commit is contained in:
Christian Lamparter
2017-12-17 15:18:46 +01:00
committed by Álvaro Fernández Rojas
parent 67c1c145f0
commit e79b096ee1
2 changed files with 7 additions and 17 deletions

View File

@@ -1,20 +1,7 @@
get_magic_at() {
local file="$1"
local pos="$2"
get_image "$file" | dd bs=1 count=2 skip="$pos" 2>/dev/null | hexdump -v -n 2 -e '1/1 "%02x"'
}
REQUIRE_IMAGE_METADATA=1
platform_check_image() {
local file="$1"
local magic
magic=$(get_magic_at "$file" 510)
[ "$magic" != "55aa" ] && {
echo "Failed to verify MBR boot signature."
return 1
}
return 0;
return 0
}
platform_do_upgrade() {