[openwrt/openwrt] mediatek: mt7622: check firmware metadata
LEDE Commits
lede-commits at lists.infradead.org
Thu Mar 4 03:05:33 GMT 2021
dangole pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/1d412235a57f3359d1c7bb63bfebce50c56caee6
commit 1d412235a57f3359d1c7bb63bfebce50c56caee6
Author: Daniel Golle <daniel at makrotopia.org>
AuthorDate: Thu Mar 4 02:49:38 2021 +0000
mediatek: mt7622: check firmware metadata
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 at makrotopia.org>
---
target/linux/mediatek/image/mt7622.mk | 2 +-
target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/target/linux/mediatek/image/mt7622.mk b/target/linux/mediatek/image/mt7622.mk
index 11185ba52a..0de1c375b2 100644
--- a/target/linux/mediatek/image/mt7622.mk
+++ b/target/linux/mediatek/image/mt7622.mk
@@ -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
diff --git a/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh
index 4e45c026ab..87852881bf 100755
--- a/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh
+++ b/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh
@@ -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'
More information about the lede-commits
mailing list