mediatek: mt7622: check firmware metadata
authorDaniel Golle <daniel@makrotopia.org>
Thu, 4 Mar 2021 02:49:38 +0000 (02:49 +0000)
committerDaniel Golle <daniel@makrotopia.org>
Thu, 4 Mar 2021 02:57:19 +0000 (02:57 +0000)
All mt7622 devices except for the UBI-variant of the mt7622-rfb1 carry
metadata appended to the sysupgrade image.
Add it for the mt7622-rfb1-ubi as well and check it on sysupgrade to
avoid accidentally flashing firmware for the wrong device (or variant
or future DEVICE_COMPAT_VERSION).

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
target/linux/mediatek/image/mt7622.mk
target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh

index 11185ba52a1497b7244f5e4e62df5abd06f59331..0de1c375b21a20c8fcdf1cdbd88e27c010ba36a4 100644 (file)
@@ -129,7 +129,7 @@ define Device/mediatek_mt7622-rfb1-ubi
   IMAGES += factory.bin
   IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
                 check-size $$$$(IMAGE_SIZE)
-  IMAGE/sysupgrade.bin := sysupgrade-tar
+  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
   DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-usb3 kmod-ata-ahci-mtk
 endef
 TARGET_DEVICES += mediatek_mt7622-rfb1-ubi
index 4e45c026ab30f179c181131c83fbbbf87fe49309..87852881bf4d2cb6e6fa5ce50c20671cf0398ac4 100755 (executable)
@@ -1,3 +1,4 @@
+REQUIRE_IMAGE_METADATA=1
 RAMFS_COPY_BIN='fw_printenv fw_setenv blockdev'
 RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock'