[source] ramips: fallback to generic board detect
LEDE Commits
lede-commits at lists.infradead.org
Wed Dec 20 16:06:19 PST 2017
mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/7d3ec5f8332859be4c5da6275df1cbdfad6e73b5
commit 7d3ec5f8332859be4c5da6275df1cbdfad6e73b5
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Fri Dec 1 08:10:24 2017 +0100
ramips: fallback to generic board detect
Fallback to the generic board detection if no case for the current
board exists.
Signed-off-by: Mathias Kresin <dev at kresin.me>
---
target/linux/ramips/base-files/etc/board.d/02_network | 2 +-
target/linux/ramips/base-files/lib/ramips.sh | 16 ++++------------
target/linux/ramips/base-files/lib/upgrade/platform.sh | 2 +-
target/linux/ramips/image/mt7621.mk | 2 +-
4 files changed, 7 insertions(+), 15 deletions(-)
diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network
index 0cbc4eb..e47a43e 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -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|\
diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh
index a08f233..e85b293 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -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
}
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index 2d4a13f..5f2c4a0 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -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|\
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index 82d0eea..b55f696 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -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 \
More information about the lede-commits
mailing list