aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ath79
diff options
context:
space:
mode:
authorMathias Kresin <dev@kresin.me>2018-05-07 22:41:04 +0200
committerMathias Kresin <dev@kresin.me>2018-05-17 07:40:19 +0200
commitf7ec385c1381db731cd5f1d22fe31149ffcbbb5e (patch)
treed6d54c02093558fa29f09033497baef67e97074f /target/linux/ath79
parentf77db1a59036d896139e6cddcdb62bf38f2f9ff6 (diff)
downloadupstream-f7ec385c1381db731cd5f1d22fe31149ffcbbb5e.tar.gz
upstream-f7ec385c1381db731cd5f1d22fe31149ffcbbb5e.tar.bz2
upstream-f7ec385c1381db731cd5f1d22fe31149ffcbbb5e.zip
ath79: add and enforce image metadata
Add metadata to images and make the metdata mandatory. Signed-off-by: Mathias Kresin <dev@kresin.me>
Diffstat (limited to 'target/linux/ath79')
-rw-r--r--target/linux/ath79/base-files/lib/upgrade/platform.sh21
-rw-r--r--target/linux/ath79/image/Makefile4
-rw-r--r--target/linux/ath79/image/generic-tp-link.mk3
-rw-r--r--target/linux/ath79/image/generic-ubnt.mk10
-rw-r--r--target/linux/ath79/image/generic.mk7
5 files changed, 20 insertions, 25 deletions
diff --git a/target/linux/ath79/base-files/lib/upgrade/platform.sh b/target/linux/ath79/base-files/lib/upgrade/platform.sh
index 2d67785fd5..dfcf70487b 100644
--- a/target/linux/ath79/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ath79/base-files/lib/upgrade/platform.sh
@@ -3,27 +3,10 @@
#
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() {
diff --git a/target/linux/ath79/image/Makefile b/target/linux/ath79/image/Makefile
index 9c789d4e0f..cbd205bc78 100644
--- a/target/linux/ath79/image/Makefile
+++ b/target/linux/ath79/image/Makefile
@@ -62,8 +62,10 @@ define Device/Default
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)
diff --git a/target/linux/ath79/image/generic-tp-link.mk b/target/linux/ath79/image/generic-tp-link.mk
index c7d44305cc..901ced9a81 100644
--- a/target/linux/ath79/image/generic-tp-link.mk
+++ b/target/linux/ath79/image/generic-tp-link.mk
@@ -41,7 +41,7 @@ define Device/tplink
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
@@ -71,5 +71,6 @@ define Device/tl_wr1043nd_v1
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
diff --git a/target/linux/ath79/image/generic-ubnt.mk b/target/linux/ath79/image/generic-ubnt.mk
index d1ed4535dc..1aae93869e 100644
--- a/target/linux/ath79/image/generic-ubnt.mk
+++ b/target/linux/ath79/image/generic-ubnt.mk
@@ -31,9 +31,9 @@ define Device/ubnt
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
@@ -55,23 +55,27 @@ endef
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
diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk
index 3488e62c40..741396473d 100644
--- a/target/linux/ath79/image/generic.mk
+++ b/target/linux/ath79/image/generic.mk
@@ -26,6 +26,7 @@ define Device/embeddedwireless_dorin
DEVICE_TITLE := Embedded Wireless Dorin
DEVICE_PACKAGES := kmod-usb-chipidea2
IMAGE_SIZE := 16000k
+ SUPPORTED_DEVICES += ew-dorin
endef
TARGET_DEVICES += embeddedwireless_dorin
@@ -34,6 +35,7 @@ define Device/glinet_ar150
DEVICE_TITLE := GL.iNet GL-AR150
DEVICE_PACKAGES := kmod-usb-chipidea2
IMAGE_SIZE := 16000k
+ SUPPORTED_DEVICES += gl-ar150
endef
TARGET_DEVICES += glinet_ar150
@@ -42,6 +44,7 @@ define Device/openmesh_om5p-ac-v2
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
@@ -56,9 +59,10 @@ define Device/netgear_wndr3800
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
@@ -67,5 +71,6 @@ define Device/buffalo_wzr-hp-g450h
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