aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm47xx/base-files
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@openwrt.org>2014-01-12 18:56:57 +0000
committerHauke Mehrtens <hauke@openwrt.org>2014-01-12 18:56:57 +0000
commitfbc1c16f1b21af640a0be1c2e2c09bb65d46dd53 (patch)
tree40b0e70c6d3e78eebd9564d0b6b040f367ae8358 /target/linux/brcm47xx/base-files
parent3d734a755e63db6919b6b844a111c19d8765426d (diff)
downloadmaster-187ad058-fbc1c16f1b21af640a0be1c2e2c09bb65d46dd53.tar.gz
master-187ad058-fbc1c16f1b21af640a0be1c2e2c09bb65d46dd53.tar.bz2
master-187ad058-fbc1c16f1b21af640a0be1c2e2c09bb65d46dd53.zip
brcm47xx: parse model from cpuinfo
Instead of looking into the proc entry provided by broadcom-diag use the board info from /proc/cpuinfo to get the board we are on. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@39256 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/brcm47xx/base-files')
-rwxr-xr-xtarget/linux/brcm47xx/base-files/etc/init.d/netconfig5
1 files changed, 2 insertions, 3 deletions
diff --git a/target/linux/brcm47xx/base-files/etc/init.d/netconfig b/target/linux/brcm47xx/base-files/etc/init.d/netconfig
index d0ce9d3d48..915288124c 100755
--- a/target/linux/brcm47xx/base-files/etc/init.d/netconfig
+++ b/target/linux/brcm47xx/base-files/etc/init.d/netconfig
@@ -45,6 +45,7 @@ start() {
local cpuport=5
[ -e /sbin/swconfig ] && cpuport=$(swconfig dev switch0 help 2>/dev/null | sed -ne "s|.*cpu @ \([0-9]*\).*|\1|p")
+ local model=$(awk 'BEGIN{FS="[ \t]+:[ \t]"} /machine/ {print $2}' /proc/cpuinfo)
local network_defs=`(
if grep -E 'mtd0: 000(6|a)0000' /proc/mtd 2>&- >&-; then
@@ -53,7 +54,7 @@ start() {
else
strings "$(find_mtd_part nvram)"
fi
- ) | awk -v cpuport="$cpuport" '
+ ) | awk -v cpuport="$cpuport" -v model="$model" '
function macinc(mac, maca, i, result) {
split(mac, maca, ":")
for (i = 1; i <= 6; i++) maca[i] = "0x" maca[i]
@@ -74,8 +75,6 @@ start() {
c["wan_ifname"]="eth0.2"
c["vlan1ports"]="1 2 3 4 5t"
c["vlan2ports"]="0 5t"
- getline < "/proc/diag/model"
- model=$0
for (i = 0; i < 6; i++) {
if (mac_check != "") mac_check = mac_check ":"
mac_check = mac_check "[0-9a-fA-F][0-9a-fA-F]"