ath79: add and enforce image metadata
Add metadata to images and make the metdata mandatory. Signed-off-by: Mathias Kresin <dev@kresin.me>
This commit is contained in:
parent
f77db1a590
commit
f7ec385c13
5 changed files with 20 additions and 25 deletions
|
@ -3,27 +3,10 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
PART_NAME=firmware
|
PART_NAME=firmware
|
||||||
|
REQUIRE_IMAGE_METADATA=1
|
||||||
|
|
||||||
platform_check_image() {
|
platform_check_image() {
|
||||||
local board=$(board_name)
|
return 0
|
||||||
local magic="$(get_magic_word "$1")"
|
|
||||||
local magic_long="$(get_magic_long "$1")"
|
|
||||||
|
|
||||||
[ "$#" -gt 1 ] && return 1
|
|
||||||
|
|
||||||
case "$board" in
|
|
||||||
"ubnt,unifi")
|
|
||||||
[ "$magic" != "2705" ] && {
|
|
||||||
echo "Invalid image type."
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
echo "Sysupgrade is not yet supported on $board."
|
|
||||||
return 1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
platform_do_upgrade() {
|
platform_do_upgrade() {
|
||||||
|
|
|
@ -62,8 +62,10 @@ define Device/Default
|
||||||
KERNEL := kernel-bin | append-dtb | lzma | uImage lzma
|
KERNEL := kernel-bin | append-dtb | lzma | uImage lzma
|
||||||
KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | uImage lzma
|
KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | uImage lzma
|
||||||
COMPILE :=
|
COMPILE :=
|
||||||
|
SUPPORTED_DEVICES := $(subst _,$(comma),$(1))
|
||||||
IMAGES := sysupgrade.bin
|
IMAGES := sysupgrade.bin
|
||||||
IMAGE/sysupgrade.bin = append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs
|
IMAGE/sysupgrade.bin = append-kernel | pad-to $$$$(BLOCKSIZE) | \
|
||||||
|
append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
ifeq ($(SUBTARGET),generic)
|
ifeq ($(SUBTARGET),generic)
|
||||||
|
|
|
@ -41,7 +41,7 @@ define Device/tplink
|
||||||
TPLINK_HEADER_VERSION := 1
|
TPLINK_HEADER_VERSION := 1
|
||||||
LOADER_TYPE := gz
|
LOADER_TYPE := gz
|
||||||
IMAGES := sysupgrade.bin
|
IMAGES := sysupgrade.bin
|
||||||
IMAGE/sysupgrade.bin := append-rootfs | mktplinkfw sysupgrade
|
IMAGE/sysupgrade.bin := append-rootfs | mktplinkfw sysupgrade | append-metadata
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Device/tplink-nolzma
|
define Device/tplink-nolzma
|
||||||
|
@ -71,5 +71,6 @@ define Device/tl_wr1043nd_v1
|
||||||
DEVICE_TITLE := TP-LINK TL-WR1043N/ND v1
|
DEVICE_TITLE := TP-LINK TL-WR1043N/ND v1
|
||||||
DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport
|
DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport
|
||||||
TPLINK_HWID := 0x10430001
|
TPLINK_HWID := 0x10430001
|
||||||
|
SUPPORTED_DEVICES := tplink,tl-wr1043nd-v1 tl-wr1043nd
|
||||||
endef
|
endef
|
||||||
#TARGET_DEVICES += tl_wr1043nd_v1
|
#TARGET_DEVICES += tl_wr1043nd_v1
|
||||||
|
|
|
@ -31,9 +31,9 @@ define Device/ubnt
|
||||||
DEVICE_PACKAGES := kmod-usb-core kmod-usb2
|
DEVICE_PACKAGES := kmod-usb-core kmod-usb2
|
||||||
IMAGE_SIZE := 7552k
|
IMAGE_SIZE := 7552k
|
||||||
UBNT_BOARD := XM
|
UBNT_BOARD := XM
|
||||||
IMAGES := sysupgrade.bin factory.bin
|
IMAGES += factory.bin
|
||||||
IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
|
IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \
|
||||||
IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | mkubntimage-split
|
append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE) | mkubntimage-split
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Device/ubnt-xm
|
define Device/ubnt-xm
|
||||||
|
@ -55,23 +55,27 @@ endef
|
||||||
define Device/ubnt_bullet-m
|
define Device/ubnt_bullet-m
|
||||||
$(Device/ubnt-xm)
|
$(Device/ubnt-xm)
|
||||||
DEVICE_TITLE := Ubiquiti Bullet-M
|
DEVICE_TITLE := Ubiquiti Bullet-M
|
||||||
|
SUPPORTED_DEVICES += bullet-m
|
||||||
endef
|
endef
|
||||||
TARGET_DEVICES += ubnt_bullet-m
|
TARGET_DEVICES += ubnt_bullet-m
|
||||||
|
|
||||||
define Device/ubnt_rocket-m
|
define Device/ubnt_rocket-m
|
||||||
$(Device/ubnt-xm)
|
$(Device/ubnt-xm)
|
||||||
DEVICE_TITLE := Ubiquiti Rocket-M
|
DEVICE_TITLE := Ubiquiti Rocket-M
|
||||||
|
SUPPORTED_DEVICES += rocket-m
|
||||||
endef
|
endef
|
||||||
TARGET_DEVICES += ubnt_rocket-m
|
TARGET_DEVICES += ubnt_rocket-m
|
||||||
|
|
||||||
define Device/ubnt_nano-m
|
define Device/ubnt_nano-m
|
||||||
$(Device/ubnt-xm)
|
$(Device/ubnt-xm)
|
||||||
DEVICE_TITLE := Ubiquiti Nano-M
|
DEVICE_TITLE := Ubiquiti Nano-M
|
||||||
|
SUPPORTED_DEVICES += nano-m
|
||||||
endef
|
endef
|
||||||
TARGET_DEVICES += ubnt_nano-m
|
TARGET_DEVICES += ubnt_nano-m
|
||||||
|
|
||||||
define Device/ubnt_unifi
|
define Device/ubnt_unifi
|
||||||
$(Device/ubnt-bz)
|
$(Device/ubnt-bz)
|
||||||
DEVICE_TITLE := Ubiquiti UniFi
|
DEVICE_TITLE := Ubiquiti UniFi
|
||||||
|
SUPPORTED_DEVICES += unifi
|
||||||
endef
|
endef
|
||||||
TARGET_DEVICES += ubnt_unifi
|
TARGET_DEVICES += ubnt_unifi
|
||||||
|
|
|
@ -26,6 +26,7 @@ define Device/embeddedwireless_dorin
|
||||||
DEVICE_TITLE := Embedded Wireless Dorin
|
DEVICE_TITLE := Embedded Wireless Dorin
|
||||||
DEVICE_PACKAGES := kmod-usb-chipidea2
|
DEVICE_PACKAGES := kmod-usb-chipidea2
|
||||||
IMAGE_SIZE := 16000k
|
IMAGE_SIZE := 16000k
|
||||||
|
SUPPORTED_DEVICES += ew-dorin
|
||||||
endef
|
endef
|
||||||
TARGET_DEVICES += embeddedwireless_dorin
|
TARGET_DEVICES += embeddedwireless_dorin
|
||||||
|
|
||||||
|
@ -34,6 +35,7 @@ define Device/glinet_ar150
|
||||||
DEVICE_TITLE := GL.iNet GL-AR150
|
DEVICE_TITLE := GL.iNet GL-AR150
|
||||||
DEVICE_PACKAGES := kmod-usb-chipidea2
|
DEVICE_PACKAGES := kmod-usb-chipidea2
|
||||||
IMAGE_SIZE := 16000k
|
IMAGE_SIZE := 16000k
|
||||||
|
SUPPORTED_DEVICES += gl-ar150
|
||||||
endef
|
endef
|
||||||
TARGET_DEVICES += glinet_ar150
|
TARGET_DEVICES += glinet_ar150
|
||||||
|
|
||||||
|
@ -42,6 +44,7 @@ define Device/openmesh_om5p-ac-v2
|
||||||
DEVICE_TITLE := OpenMesh OM5P-AC v2
|
DEVICE_TITLE := OpenMesh OM5P-AC v2
|
||||||
DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca988x om-watchdog
|
DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca988x om-watchdog
|
||||||
IMAGE_SIZE := 7808k
|
IMAGE_SIZE := 7808k
|
||||||
|
SUPPORTED_DEVICES += om5p-acv2
|
||||||
endef
|
endef
|
||||||
TARGET_DEVICES += openmesh_om5p-ac-v2
|
TARGET_DEVICES += openmesh_om5p-ac-v2
|
||||||
|
|
||||||
|
@ -56,9 +59,10 @@ define Device/netgear_wndr3800
|
||||||
IMAGE_SIZE := 15872k
|
IMAGE_SIZE := 15872k
|
||||||
IMAGES := sysupgrade.bin factory.img
|
IMAGES := sysupgrade.bin factory.img
|
||||||
IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | netgear-squashfs | append-rootfs | pad-rootfs
|
IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | netgear-squashfs | append-rootfs | pad-rootfs
|
||||||
IMAGE/sysupgrade.bin := $$(IMAGE/default) | check-size $$$$(IMAGE_SIZE)
|
IMAGE/sysupgrade.bin := $$(IMAGE/default) | append-metadata | check-size $$$$(IMAGE_SIZE)
|
||||||
IMAGE/factory.img := $$(IMAGE/default) | netgear-dni | check-size $$$$(IMAGE_SIZE)
|
IMAGE/factory.img := $$(IMAGE/default) | netgear-dni | check-size $$$$(IMAGE_SIZE)
|
||||||
DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport kmod-leds-reset
|
DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport kmod-leds-reset
|
||||||
|
SUPPORTED_DEVICES += wndr3800
|
||||||
endef
|
endef
|
||||||
TARGET_DEVICES += netgear_wndr3800
|
TARGET_DEVICES += netgear_wndr3800
|
||||||
|
|
||||||
|
@ -67,5 +71,6 @@ define Device/buffalo_wzr-hp-g450h
|
||||||
DEVICE_TITLE := Buffalo WZR-HP-G450H
|
DEVICE_TITLE := Buffalo WZR-HP-G450H
|
||||||
DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport
|
DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport
|
||||||
IMAGE_SIZE := 32256k
|
IMAGE_SIZE := 32256k
|
||||||
|
SUPPORTED_DEVICES += wzr-hp-g450h
|
||||||
endef
|
endef
|
||||||
TARGET_DEVICES += buffalo_wzr-hp-g450h
|
TARGET_DEVICES += buffalo_wzr-hp-g450h
|
||||||
|
|
Loading…
Reference in a new issue