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>
This commit is contained in:
parent
e6604fab51
commit
213ba77359
3 changed files with 10 additions and 93 deletions
|
@ -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
|
|
||||||
}
|
|
|
@ -1,35 +1,20 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
PART_NAME=firmware
|
PART_NAME=firmware
|
||||||
|
REQUIRE_IMAGE_METADATA=1
|
||||||
|
|
||||||
platform_check_image() {
|
platform_check_image() {
|
||||||
local board=$(board_name)
|
local board=$(board_name)
|
||||||
|
|
||||||
[ "$#" -gt 1 ] && return 1
|
|
||||||
|
|
||||||
case "$board" in
|
case "$board" in
|
||||||
mbl)
|
mbl)
|
||||||
mbl_do_platform_check "$1"
|
mbl_do_platform_check "$1"
|
||||||
return $?;
|
return $?;
|
||||||
;;
|
;;
|
||||||
|
|
||||||
mr24|\
|
|
||||||
mx60)
|
|
||||||
merakinand_do_platform_check $board "$1"
|
|
||||||
return $?;
|
|
||||||
;;
|
|
||||||
|
|
||||||
wndr4700)
|
|
||||||
nand_do_platform_check $board "$1"
|
|
||||||
return $?;
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
*)
|
||||||
|
return 0
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
echo "Sysupgrade is not yet supported on $board."
|
|
||||||
return 1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
platform_pre_upgrade() {
|
platform_pre_upgrade() {
|
||||||
|
@ -37,10 +22,7 @@ platform_pre_upgrade() {
|
||||||
|
|
||||||
case "$board" in
|
case "$board" in
|
||||||
mr24|\
|
mr24|\
|
||||||
mx60)
|
mx60|\
|
||||||
merakinand_do_upgrade "$1"
|
|
||||||
;;
|
|
||||||
|
|
||||||
wndr4700)
|
wndr4700)
|
||||||
nand_do_upgrade "$1"
|
nand_do_upgrade "$1"
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -14,6 +14,7 @@ define Device/Default
|
||||||
KERNEL_ENTRY := 0x00000000
|
KERNEL_ENTRY := 0x00000000
|
||||||
KERNEL_LOADADDR := 0x00000000
|
KERNEL_LOADADDR := 0x00000000
|
||||||
DEVICE_DTS_DIR := ../dts
|
DEVICE_DTS_DIR := ../dts
|
||||||
|
SUPPORTED_DEVICES = $$(BOARD_NAME)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Build/dtb
|
define Build/dtb
|
||||||
|
@ -81,7 +82,7 @@ define Device/meraki_mr24
|
||||||
check-size $$(KERNEL_SIZE) | \
|
check-size $$(KERNEL_SIZE) | \
|
||||||
MerakiAdd-dtb | pad-to 2047k | MerakiAdd-initramfs | \
|
MerakiAdd-dtb | pad-to 2047k | MerakiAdd-initramfs | \
|
||||||
MerakiNAND
|
MerakiNAND
|
||||||
IMAGE/sysupgrade.tar := sysupgrade-tar
|
IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata
|
||||||
UBINIZE_OPTS := -E 5
|
UBINIZE_OPTS := -E 5
|
||||||
endef
|
endef
|
||||||
TARGET_DEVICES += meraki_mr24
|
TARGET_DEVICES += meraki_mr24
|
||||||
|
@ -106,7 +107,7 @@ define Device/meraki_mx60
|
||||||
check-size $$(KERNEL_SIZE) | \
|
check-size $$(KERNEL_SIZE) | \
|
||||||
MerakiAdd-dtb | pad-to 2047k | MerakiAdd-initramfs | \
|
MerakiAdd-dtb | pad-to 2047k | MerakiAdd-initramfs | \
|
||||||
MerakiNAND
|
MerakiNAND
|
||||||
IMAGE/sysupgrade.tar := sysupgrade-tar
|
IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata
|
||||||
UBINIZE_OPTS := -E 5
|
UBINIZE_OPTS := -E 5
|
||||||
endef
|
endef
|
||||||
TARGET_DEVICES += meraki_mx60
|
TARGET_DEVICES += meraki_mx60
|
||||||
|
@ -170,7 +171,7 @@ define Device/netgear_wndr4700
|
||||||
KERNEL_INITRAMFS := kernel-bin | gzip | dtb | wndr4700-specialImage gzip
|
KERNEL_INITRAMFS := kernel-bin | gzip | dtb | wndr4700-specialImage gzip
|
||||||
IMAGE/factory.img := create-uImage-dtb | append-kernel | pad-to 2M | append-ubi | \
|
IMAGE/factory.img := create-uImage-dtb | append-kernel | pad-to 2M | append-ubi | \
|
||||||
netgear-dni | check-size $$$$(IMAGE_SIZE)
|
netgear-dni | check-size $$$$(IMAGE_SIZE)
|
||||||
IMAGE/sysupgrade.tar := sysupgrade-tar
|
IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata
|
||||||
IMAGE/kernel.dtb := export-dtb | uImage none
|
IMAGE/kernel.dtb := export-dtb | uImage none
|
||||||
NETGEAR_BOARD_ID := WNDR4700
|
NETGEAR_BOARD_ID := WNDR4700
|
||||||
NETGEAR_HW_ID := 29763875+128+256
|
NETGEAR_HW_ID := 29763875+128+256
|
||||||
|
@ -219,13 +220,14 @@ define Device/MyBookLiveDefault
|
||||||
DEVICE_DTB := apollo3g.dtb
|
DEVICE_DTB := apollo3g.dtb
|
||||||
FILESYSTEMS := ext4
|
FILESYSTEMS := ext4
|
||||||
IMAGE/kernel.dtb := export-dtb
|
IMAGE/kernel.dtb := export-dtb
|
||||||
IMAGE/rootfs.img.gz := boot-script | boot-img | hdd-img | gzip
|
IMAGE/rootfs.img.gz := boot-script | boot-img | hdd-img | gzip | append-metadata
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Device/wd_mybooklive
|
define Device/wd_mybooklive
|
||||||
$(Device/MyBookLiveDefault)
|
$(Device/MyBookLiveDefault)
|
||||||
DEVICE_TITLE := Western Digital My Book Live
|
DEVICE_TITLE := Western Digital My Book Live
|
||||||
DEVICE_DTS := wd-mybooklive
|
DEVICE_DTS := wd-mybooklive
|
||||||
|
SUPPORTED_DEVICES := mbl
|
||||||
endef
|
endef
|
||||||
|
|
||||||
TARGET_DEVICES += wd_mybooklive
|
TARGET_DEVICES += wd_mybooklive
|
||||||
|
@ -235,6 +237,7 @@ $(Device/MyBookLiveDefault)
|
||||||
DEVICE_TITLE := Western Digital My Book Live Duo
|
DEVICE_TITLE := Western Digital My Book Live Duo
|
||||||
DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport kmod-usb-storage kmod-fs-vfat wpad-mini
|
DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport kmod-usb-storage kmod-fs-vfat wpad-mini
|
||||||
DEVICE_DTS := wd-mybooklive-duo
|
DEVICE_DTS := wd-mybooklive-duo
|
||||||
|
SUPPORTED_DEVICES := mbl
|
||||||
endef
|
endef
|
||||||
|
|
||||||
TARGET_DEVICES += wd_mybooklive-duo
|
TARGET_DEVICES += wd_mybooklive-duo
|
||||||
|
|
Loading…
Reference in a new issue