[source] mediatek: fix sysupgrade board detection

LEDE Commits lede-commits at lists.infradead.org
Mon Apr 24 03:18:19 PDT 2017


blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/da352c46235a69d333277b52c1d98fe334b94d9f

commit da352c46235a69d333277b52c1d98fe334b94d9f
Author: John Crispin <john at phrozen.org>
AuthorDate: Mon Apr 10 06:45:59 2017 +0200

    mediatek: fix sysupgrade board detection
    
    boardnames were changed with the recent target update. the sysupgrade board
    detection was not updated properly.
    
    Signed-off-by: John Crispin <john at phrozen.org>
---
 target/linux/mediatek/base-files/lib/upgrade/platform.sh | 8 +++++---
 target/linux/mediatek/image/Makefile                     | 7 +++++--
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/target/linux/mediatek/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/base-files/lib/upgrade/platform.sh
index f2dd453..9a844bc 100755
--- a/target/linux/mediatek/base-files/lib/upgrade/platform.sh
+++ b/target/linux/mediatek/base-files/lib/upgrade/platform.sh
@@ -20,11 +20,12 @@ platform_check_image() {
 	local board=$(cat /tmp/sysinfo/board_name)
 
 	case "$board" in
-	NAND)
+	mediatek,mt7623-rfb-nand-ephy |\
+	mediatek,mt7623-rfb-nand)
 		nand_do_platform_check $board $1
 		return $?
 		;;
-	eMMC)
+	mediatek,mt7623-rfb-emmc)
 		local kernel_length=`(tar xf $tar_file sysupgrade-$board/kernel -O | wc -c) 2> /dev/null`
 		local rootfs_length=`(tar xf $tar_file sysupgrade-$board/root -O | wc -c) 2> /dev/null`
 		;;
@@ -46,7 +47,8 @@ platform_check_image() {
 platform_pre_upgrade() {
 	local board=$(cat /tmp/sysinfo/board_name)
 	case "$board" in
-	NAND)
+	mediatek,mt7623-rfb-nand-ephy |\
+	mediatek,mt7623-rfb-nand)
 		nand_do_upgrade $1
 		;;
 	esac
diff --git a/target/linux/mediatek/image/Makefile b/target/linux/mediatek/image/Makefile
index ac42691..177e4f7 100644
--- a/target/linux/mediatek/image/Makefile
+++ b/target/linux/mediatek/image/Makefile
@@ -25,6 +25,9 @@ endif
 	)
 endef
 
+COMPAT_NAND:=mediatek,mt7623-rfb-nand
+COMPAT_NAND_EPHY:=mediatek,mt7623-rfb-nand-ephy
+
 define Image/Build/squashfs
 	$(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
 	$(CP) $(KDIR)/root.squashfs $(BIN_DIR)/$(IMG_PREFIX)-root.squashfs
@@ -39,8 +42,8 @@ ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
 	$(CP) $(KDIR)/uImage-NAND-initramfs $(BIN_DIR)/$(IMG_PREFIX)-uImage-NAND-initramfs
 	$(CP) $(KDIR)/uImage-NAND-ePHY-initramfs $(BIN_DIR)/$(IMG_PREFIX)-uImage-NAND-ePHY-initramfs
 endif
-	$(call Image/Build/SysupgradeNAND,NAND,$(1),$(KDIR)/uImage-NAND)
-	$(call Image/Build/SysupgradeNAND,NAND-ePHY,$(1),$(KDIR)/uImage-NAND-ePHY)
+	$(call Image/Build/SysupgradeNAND,NAND,$(1),$(KDIR)/uImage-NAND,$$(COMPAT_NAND))
+	$(call Image/Build/SysupgradeNAND,NAND-ePHY,$(1),$(KDIR)/uImage-NAND-ePHY,$$(COMPAT_NAND_EPHY))
 endef
 
 define Image/Build



More information about the lede-commits mailing list