Add metadata to images and make the metdata mandatory.
Signed-off-by: Mathias Kresin <dev@kresin.me>
#
PART_NAME=firmware
+REQUIRE_IMAGE_METADATA=1
platform_check_image() {
- local board=$(board_name)
- 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
+ return 0
}
platform_do_upgrade() {
KERNEL := kernel-bin | append-dtb | lzma | uImage lzma
KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | uImage lzma
COMPILE :=
+ SUPPORTED_DEVICES := $(subst _,$(comma),$(1))
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
ifeq ($(SUBTARGET),generic)
TPLINK_HEADER_VERSION := 1
LOADER_TYPE := gz
IMAGES := sysupgrade.bin
- IMAGE/sysupgrade.bin := append-rootfs | mktplinkfw sysupgrade
+ IMAGE/sysupgrade.bin := append-rootfs | mktplinkfw sysupgrade | append-metadata
endef
define Device/tplink-nolzma
DEVICE_TITLE := TP-LINK TL-WR1043N/ND v1
DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport
TPLINK_HWID := 0x10430001
+ SUPPORTED_DEVICES := tplink,tl-wr1043nd-v1 tl-wr1043nd
endef
#TARGET_DEVICES += tl_wr1043nd_v1
DEVICE_PACKAGES := kmod-usb-core kmod-usb2
IMAGE_SIZE := 7552k
UBNT_BOARD := XM
- IMAGES := sysupgrade.bin factory.bin
- IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
- IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | mkubntimage-split
+ IMAGES += factory.bin
+ IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \
+ append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE) | mkubntimage-split
endef
define Device/ubnt-xm
define Device/ubnt_bullet-m
$(Device/ubnt-xm)
DEVICE_TITLE := Ubiquiti Bullet-M
+ SUPPORTED_DEVICES += bullet-m
endef
TARGET_DEVICES += ubnt_bullet-m
define Device/ubnt_rocket-m
$(Device/ubnt-xm)
DEVICE_TITLE := Ubiquiti Rocket-M
+ SUPPORTED_DEVICES += rocket-m
endef
TARGET_DEVICES += ubnt_rocket-m
define Device/ubnt_nano-m
$(Device/ubnt-xm)
DEVICE_TITLE := Ubiquiti Nano-M
+ SUPPORTED_DEVICES += nano-m
endef
TARGET_DEVICES += ubnt_nano-m
define Device/ubnt_unifi
$(Device/ubnt-bz)
DEVICE_TITLE := Ubiquiti UniFi
+ SUPPORTED_DEVICES += unifi
endef
TARGET_DEVICES += ubnt_unifi
DEVICE_TITLE := Embedded Wireless Dorin
DEVICE_PACKAGES := kmod-usb-chipidea2
IMAGE_SIZE := 16000k
+ SUPPORTED_DEVICES += ew-dorin
endef
TARGET_DEVICES += embeddedwireless_dorin
DEVICE_TITLE := GL.iNet GL-AR150
DEVICE_PACKAGES := kmod-usb-chipidea2
IMAGE_SIZE := 16000k
+ SUPPORTED_DEVICES += gl-ar150
endef
TARGET_DEVICES += glinet_ar150
DEVICE_TITLE := OpenMesh OM5P-AC v2
DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca988x om-watchdog
IMAGE_SIZE := 7808k
+ SUPPORTED_DEVICES += om5p-acv2
endef
TARGET_DEVICES += openmesh_om5p-ac-v2
IMAGE_SIZE := 15872k
IMAGES := sysupgrade.bin factory.img
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)
DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport kmod-leds-reset
+ SUPPORTED_DEVICES += wndr3800
endef
TARGET_DEVICES += netgear_wndr3800
DEVICE_TITLE := Buffalo WZR-HP-G450H
DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport
IMAGE_SIZE := 32256k
+ SUPPORTED_DEVICES += wzr-hp-g450h
endef
TARGET_DEVICES += buffalo_wzr-hp-g450h