From 491e839262fd2bf7417c57e12ebb7383011dae1c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
Date: Thu, 26 Sep 2019 06:45:11 +0200
Subject: brcm47xx: sysupgrade: fix device model detection
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

$(board_name) was providing content on "boardtype" (and optionally
"boardnum") NVRAM values. That function requires & expects more specific
and detailed model name extracted from the /proc/cpuinfo.

Fixes: f12a32630ff5 ("treewide: use the generic board_name function")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
 target/linux/brcm47xx/base-files/lib/upgrade/platform.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/brcm47xx/base-files/lib/upgrade/platform.sh b/target/linux/brcm47xx/base-files/lib/upgrade/platform.sh
index dfd4e97ed2..eeeb84f4a4 100644
--- a/target/linux/brcm47xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/brcm47xx/base-files/lib/upgrade/platform.sh
@@ -7,9 +7,9 @@ get_magic_long_at() {
 }
 
 platform_expected_image() {
-	local machine=$(board_name)
+	local model="$(cat /tmp/sysinfo/model)"
 
-	case "$machine" in
+	case "$model" in
 		"Netgear WGR614 V8")	echo "chk U12H072T00_NETGEAR"; return;;
 		"Netgear WGR614 V9")	echo "chk U12H094T00_NETGEAR"; return;;
 		"Netgear WGR614 V10")	echo "chk U12H139T01_NETGEAR"; return;;
-- 
cgit v1.2.3