ramips: fallback to generic board detect
authorMathias Kresin <dev@kresin.me>
Fri, 1 Dec 2017 07:10:24 +0000 (08:10 +0100)
committerMathias Kresin <dev@kresin.me>
Thu, 21 Dec 2017 00:05:16 +0000 (01:05 +0100)
Fallback to the generic board detection if no case for the current
board exists.

Signed-off-by: Mathias Kresin <dev@kresin.me>
target/linux/ramips/base-files/etc/board.d/02_network
target/linux/ramips/base-files/lib/ramips.sh
target/linux/ramips/base-files/lib/upgrade/platform.sh
target/linux/ramips/image/mt7621.mk

index 0cbc4eb5b16021d22bcadd5206eaec49c85774dd..e47a43eca0e6a54eb5e3ac89191e2bf934dbdc87 100755 (executable)
@@ -114,7 +114,7 @@ ramips_setup_interfaces()
        youku-yk1|\
        zbt-ape522ii|\
        zbt-we1326|\
-       zbt-we3526|\
+       zbtlink,zbt-we3526|\
        zbt-we826-16M|\
        zbt-we826-32M|\
        zbt-wg2626|\
index a08f2331704c82c76f2dbf95c7d115813a86333a..e85b29361057c0f3acdc061bfb11b9b6b283d93b 100755 (executable)
@@ -3,9 +3,6 @@
 # Copyright (C) 2010-2013 OpenWrt.org
 #
 
-RAMIPS_BOARD_NAME=
-RAMIPS_MODEL=
-
 ramips_board_detect() {
        local machine
        local name
@@ -733,18 +730,13 @@ ramips_board_detect() {
        *"YK1")
                name="youku-yk1"
                ;;
-       *)
-               name="$(strings /proc/device-tree/compatible | head -1)"
-               name="${name##*,}"
-               name="${name:-generic}"
-               ;;
        esac
 
-       [ -z "$RAMIPS_BOARD_NAME" ] && RAMIPS_BOARD_NAME="$name"
-       [ -z "$RAMIPS_MODEL" ] && RAMIPS_MODEL="$machine"
+       # use generic board detect if no name is set
+       [ -z "$name" ] && return
 
        [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
 
-       echo "$RAMIPS_BOARD_NAME" > /tmp/sysinfo/board_name
-       echo "$RAMIPS_MODEL" > /tmp/sysinfo/model
+       echo "$name" > /tmp/sysinfo/board_name
+       echo "$machine" > /tmp/sysinfo/model
 }
index 2d4a13f531dd61fd84009c78e549bc4b1656d401..5f2c4a043a69d4999741a15cd14f460984b3fbe8 100755 (executable)
@@ -202,7 +202,7 @@ platform_check_image() {
        zbt-wa05|\
        zbt-we1326|\
        zbt-we2026|\
-       zbt-we3526|\
+       zbtlink,zbt-we3526|\
        zbt-we826-16M|\
        zbt-we826-32M|\
        zbt-wg2626|\
index 82d0eeae62e10aaa3bfa4a9815b2d7883d94a107..b55f696a86f14ea3cdf98bd13ad69b95bd1198eb 100644 (file)
@@ -332,7 +332,7 @@ TARGET_DEVICES += zbt-we1326
 define Device/zbt-we3526
   DTS := ZBT-WE3526
   IMAGE_SIZE := $(ralink_default_fw_size_16M)
-  SUPPORTED_DEVICES += zbt-we3526
+  SUPPORTED_DEVICES := zbtlink,zbt-we3526
   DEVICE_TITLE := ZBT WE3526
   DEVICE_PACKAGES := \
        kmod-sdhci-mt7620 kmod-mt7603 kmod-mt76x2 \