diff options
author | Christian Lamparter <chunkeey@gmail.com> | 2017-12-17 15:00:00 +0100 |
---|---|---|
committer | Mathias Kresin <dev@kresin.me> | 2017-12-21 01:05:16 +0100 |
commit | 213ba77359191d6e3053119a8eb8f1e924aa2cb4 (patch) | |
tree | 352c1fdcb328d1f875293a5508958fcae3bec4da /target/linux/apm821xx/base-files | |
parent | e6604fab514f92cf2851b043d751f690666c9e82 (diff) | |
download | mtk-20170518-213ba77359191d6e3053119a8eb8f1e924aa2cb4.zip mtk-20170518-213ba77359191d6e3053119a8eb8f1e924aa2cb4.tar.gz mtk-20170518-213ba77359191d6e3053119a8eb8f1e924aa2cb4.tar.bz2 |
apm821xx: enable metadata for packaging
This patch enables metadata-supported image verification
for all apm821xx supported devices. Since this method comes
with a built-in image verification tool (fwtool), the previous
image checks can be removed.
Signed-off-by: Mathias Kresin <dev@kresin.me>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Diffstat (limited to 'target/linux/apm821xx/base-files')
-rwxr-xr-x | target/linux/apm821xx/base-files/lib/upgrade/merakinand.sh | 68 | ||||
-rwxr-xr-x | target/linux/apm821xx/base-files/lib/upgrade/platform.sh | 24 |
2 files changed, 3 insertions, 89 deletions
diff --git a/target/linux/apm821xx/base-files/lib/upgrade/merakinand.sh b/target/linux/apm821xx/base-files/lib/upgrade/merakinand.sh deleted file mode 100755 index fb961b8..0000000 --- a/target/linux/apm821xx/base-files/lib/upgrade/merakinand.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2016 Chris Blake <chrisrblake93@gmail.com> -# -# Custom upgrade script for Meraki NAND devices (ex. MR24) -# Based on merakinand.sh from the ar71xx target -# -. /lib/apm821xx.sh -. /lib/functions.sh - -merakinand_do_kernel_check() { - local board_name="$1" - local tar_file="$2" - local image_magic_word=`(tar xf $tar_file sysupgrade-$board_name/kernel -O 2>/dev/null | dd bs=1 count=4 skip=0 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"')` - - # What is our kernel magic string? - case "$board_name" in - "mr24"|\ - "mx60") - [ "$image_magic_word" == "8e73ed8a" ] && { - echo "pass" && return 0 - } - ;; - esac - - exit 1 -} - -merakinand_do_platform_check() { - local board_name="$1" - local tar_file="$2" - local control_length=`(tar xf $tar_file sysupgrade-$board_name/CONTROL -O | wc -c) 2> /dev/null` - local file_type="$(identify_tar $2 sysupgrade-$board_name/root)" - local kernel_magic="$(merakinand_do_kernel_check $1 $2)" - - case "$board_name" in - "mr24"|\ - "mx60") - [ "$control_length" = 0 -o "$file_type" != "squashfs" -o "$kernel_magic" != "pass" ] && { - echo "Invalid sysupgrade file for $board_name" - return 1 - } - ;; - *) - echo "Unsupported device $board_name"; - return 1 - ;; - esac - - return 0 -} - -merakinand_do_upgrade() { - local tar_file="$1" - local board_name="$(board_name)" - - # Do we need to do any platform tweaks? - case "$board_name" in - "mr24"|\ - "mx60") - nand_do_upgrade $1 - ;; - *) - echo "Unsupported device $board_name"; - exit 1 - ;; - esac -} diff --git a/target/linux/apm821xx/base-files/lib/upgrade/platform.sh b/target/linux/apm821xx/base-files/lib/upgrade/platform.sh index 8c716bf..7c9c413 100755 --- a/target/linux/apm821xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/apm821xx/base-files/lib/upgrade/platform.sh @@ -1,35 +1,20 @@ #!/bin/sh PART_NAME=firmware +REQUIRE_IMAGE_METADATA=1 platform_check_image() { local board=$(board_name) - [ "$#" -gt 1 ] && return 1 - case "$board" in mbl) mbl_do_platform_check "$1" return $?; ;; - - mr24|\ - mx60) - merakinand_do_platform_check $board "$1" - return $?; - ;; - - wndr4700) - nand_do_platform_check $board "$1" - return $?; - ;; - *) + return 0 ;; esac - - echo "Sysupgrade is not yet supported on $board." - return 1 } platform_pre_upgrade() { @@ -37,10 +22,7 @@ platform_pre_upgrade() { case "$board" in mr24|\ - mx60) - merakinand_do_upgrade "$1" - ;; - + mx60|\ wndr4700) nand_do_upgrade "$1" ;; |