2010-05-30 01:32:47 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Copyright (C) 2007 OpenWrt.org
|
|
|
|
#
|
|
|
|
#
|
|
|
|
|
2015-03-16 11:52:16 +00:00
|
|
|
board_id=""
|
2010-05-30 01:32:47 +00:00
|
|
|
sys_mtd_part=""
|
2013-02-05 22:25:30 +00:00
|
|
|
ifname=""
|
2010-05-30 01:32:47 +00:00
|
|
|
|
2015-03-16 11:52:26 +00:00
|
|
|
brcm63xx_dt_detect() {
|
2015-03-16 11:52:20 +00:00
|
|
|
local board_name
|
|
|
|
|
|
|
|
case "$1" in
|
2015-03-16 11:52:26 +00:00
|
|
|
"ADB P.DG A4001N")
|
|
|
|
board_name="a4001n"
|
2015-03-16 11:52:20 +00:00
|
|
|
;;
|
2015-03-16 11:52:26 +00:00
|
|
|
"ADB P.DG A4001N1")
|
2015-03-16 11:52:20 +00:00
|
|
|
board_name="a4001n1"
|
|
|
|
;;
|
2016-12-23 23:24:44 +00:00
|
|
|
"ADB P.DG AV4202N")
|
|
|
|
board_name="av4202n"
|
|
|
|
;;
|
2017-02-19 18:27:36 +00:00
|
|
|
"Actiontec R1000H")
|
|
|
|
board_name="r1000h"
|
|
|
|
;;
|
2015-03-16 11:52:26 +00:00
|
|
|
"Alcatel RG100A")
|
|
|
|
board_name="rg100a"
|
2015-03-16 11:52:20 +00:00
|
|
|
;;
|
2015-03-16 11:52:26 +00:00
|
|
|
"ASMAX AR 1004g")
|
|
|
|
board_name="ar100g"
|
2015-03-16 11:52:20 +00:00
|
|
|
;;
|
2015-03-16 11:52:26 +00:00
|
|
|
"Belkin F5D7633")
|
|
|
|
board_name="f5d7633"
|
2015-03-16 11:52:20 +00:00
|
|
|
;;
|
2015-03-16 11:52:26 +00:00
|
|
|
"Broadcom 96348R reference board")
|
|
|
|
board_name="bcm96348r"
|
2015-03-16 11:52:20 +00:00
|
|
|
;;
|
2015-03-30 20:21:07 +00:00
|
|
|
"Broadcom BCM96318REF reference board")
|
|
|
|
board_name="bcm96318ref"
|
|
|
|
;;
|
|
|
|
"Broadcom BCM96318REF_P300 reference board")
|
|
|
|
board_name="bcm96318ref_p300"
|
|
|
|
;;
|
2015-03-25 15:35:24 +00:00
|
|
|
"Broadcom BCM963268BU_P300 reference board")
|
|
|
|
board_name="bcm963268bu_p300"
|
|
|
|
;;
|
2015-04-21 16:43:46 +00:00
|
|
|
"Broadcom BCM963269BHR reference board")
|
|
|
|
board_name="bcm963269bhr"
|
|
|
|
;;
|
2015-03-16 11:52:26 +00:00
|
|
|
"Broadcom bcm963281TAN reference board")
|
|
|
|
board_name="bcm963281tan"
|
2015-03-16 11:52:20 +00:00
|
|
|
;;
|
2015-03-16 11:52:26 +00:00
|
|
|
"Broadcom BCM96328avng reference board")
|
2015-03-25 15:36:26 +00:00
|
|
|
board_name="bcm96328avng"
|
2015-03-16 11:52:26 +00:00
|
|
|
;;
|
|
|
|
"Broadcom BCM96345GW2 reference board")
|
|
|
|
board_name="bcm96345gw2"
|
|
|
|
;;
|
|
|
|
"Broadcom BCM96348GW-10 reference board")
|
|
|
|
board_name="bcm96348gw-10"
|
|
|
|
;;
|
|
|
|
"Broadcom BCM96348GW-11 reference board")
|
2015-03-16 11:52:20 +00:00
|
|
|
board_name="bcm96348gw-11"
|
|
|
|
;;
|
2015-03-16 11:52:26 +00:00
|
|
|
"Broadcom BCM96348GW reference board")
|
|
|
|
board_name="bcm96358gw"
|
2015-03-16 11:52:20 +00:00
|
|
|
;;
|
2015-03-16 11:52:26 +00:00
|
|
|
"Broadcom BCM96358VW reference board")
|
|
|
|
board_name="bcm96358vw"
|
|
|
|
;;
|
|
|
|
"Broadcom BCM96358VW2 reference board")
|
|
|
|
board_name="bcm96358vw2"
|
|
|
|
;;
|
|
|
|
"Broadcom BCM96368MVNgr reference board")
|
|
|
|
board_name="bcm96368mvngr"
|
|
|
|
;;
|
|
|
|
"Broadcom BCM96368MVWG reference board")
|
|
|
|
board_name="bcm96368mvwg"
|
|
|
|
;;
|
2015-03-25 15:35:12 +00:00
|
|
|
"BT Home Hub 2.0 Type A")
|
|
|
|
board_name="homehub2a"
|
|
|
|
;;
|
2015-03-30 20:20:49 +00:00
|
|
|
"BT Voyager 2110")
|
|
|
|
board_name="v2110"
|
|
|
|
;;
|
2015-03-16 11:52:26 +00:00
|
|
|
"BT Voyager V2500V")
|
2015-03-25 15:36:15 +00:00
|
|
|
board_name="v2500v_bb"
|
2015-03-16 11:52:26 +00:00
|
|
|
;;
|
2017-08-12 10:40:22 +00:00
|
|
|
"Comtrend AR-5315u")
|
|
|
|
board_name="ar-5315u"
|
|
|
|
;;
|
2015-03-16 11:52:26 +00:00
|
|
|
"Comtrend AR-5381u")
|
|
|
|
board_name="ar-5381u"
|
|
|
|
;;
|
|
|
|
"Comtrend AR-5387un")
|
|
|
|
board_name="ar-5387un"
|
2015-03-16 11:52:20 +00:00
|
|
|
;;
|
2015-03-16 11:52:26 +00:00
|
|
|
"Comtrend CT-5365")
|
|
|
|
board_name="ct-5365"
|
|
|
|
;;
|
|
|
|
"Comtrend CT-536+/CT-5621T")
|
|
|
|
board_name="ct-536p_5621t"
|
|
|
|
;;
|
|
|
|
"Comtrend CT-6373")
|
|
|
|
board_name="ct-6373"
|
|
|
|
;;
|
|
|
|
"Comtrend VR-3025u")
|
2015-03-16 11:52:20 +00:00
|
|
|
board_name="vr-3025u"
|
|
|
|
;;
|
2015-03-16 11:52:26 +00:00
|
|
|
"Comtrend VR-3025un")
|
|
|
|
board_name="vr-3025un"
|
|
|
|
;;
|
2015-08-30 12:17:46 +00:00
|
|
|
"Comtrend VR-3026e")
|
|
|
|
board_name="vr-3026e"
|
|
|
|
;;
|
2015-03-16 11:52:26 +00:00
|
|
|
"Comtrend WAP-5813n")
|
2015-03-16 11:52:20 +00:00
|
|
|
board_name="wap-5813n"
|
|
|
|
;;
|
2015-03-16 11:52:26 +00:00
|
|
|
"Davolink DV-201AMR")
|
|
|
|
board_name="dv-201amr"
|
2015-03-16 11:52:20 +00:00
|
|
|
;;
|
2015-03-16 11:52:26 +00:00
|
|
|
"D-Link DSL-2640B rev B2")
|
|
|
|
board_name="dsl-2640b-b"
|
|
|
|
;;
|
2015-03-25 15:35:37 +00:00
|
|
|
"D-Link DSL-2640U/BRU/C")
|
|
|
|
board_name="dsl-2640u"
|
|
|
|
;;
|
2015-03-16 11:52:26 +00:00
|
|
|
"D-Link DSL-2650U")
|
|
|
|
board_name="dsl-2650u"
|
|
|
|
;;
|
|
|
|
"D-Link DSL-2740B/DSL-2741B rev C2/3")
|
2015-03-16 11:52:20 +00:00
|
|
|
board_name="dsl-274xb-c"
|
|
|
|
;;
|
2015-03-16 11:52:26 +00:00
|
|
|
"D-Link DSL-2740B/DSL-2741B rev F1")
|
|
|
|
board_name="dsl-274xb-f"
|
2015-03-16 11:52:20 +00:00
|
|
|
;;
|
2015-03-30 20:21:15 +00:00
|
|
|
"D-Link DSL-2750B/DSL-2751 rev D1")
|
|
|
|
board_name="dsl-275xb-d"
|
|
|
|
;;
|
2015-03-16 11:52:26 +00:00
|
|
|
"D-Link DVA-G3810BN/TL")
|
|
|
|
board_name="dva-g3810bn"
|
|
|
|
;;
|
2015-03-25 15:36:12 +00:00
|
|
|
"Dynalink RTA770BW")
|
|
|
|
board_name="rta770bw"
|
|
|
|
;;
|
|
|
|
"Dynalink RTA770W")
|
|
|
|
board_name="rta770w"
|
|
|
|
;;
|
2015-03-16 11:52:26 +00:00
|
|
|
"Dynalink RTA1025W")
|
|
|
|
board_name="rta1025w"
|
|
|
|
;;
|
|
|
|
"Dynalink RTA1320")
|
|
|
|
board_name="rta1320"
|
|
|
|
;;
|
|
|
|
"Huawei EchoLife HG520v")
|
|
|
|
board_name="hg520v"
|
|
|
|
;;
|
|
|
|
"Huawei EchoLife HG553")
|
|
|
|
board_name="hg553"
|
|
|
|
;;
|
|
|
|
"Huawei EchoLife HG556a (version A)")
|
|
|
|
board_name="hg556a_a"
|
|
|
|
;;
|
|
|
|
"Huawei EchoLife HG556a (version B)")
|
|
|
|
board_name="hg556a_b"
|
2015-03-16 11:52:20 +00:00
|
|
|
;;
|
2015-03-16 11:52:26 +00:00
|
|
|
"Huawei EchoLife HG556a (version C)")
|
|
|
|
board_name="hg556a_c"
|
|
|
|
;;
|
2016-01-18 10:47:23 +00:00
|
|
|
"Huawei HG622")
|
|
|
|
board_name="hg622"
|
|
|
|
;;
|
2015-05-21 19:31:54 +00:00
|
|
|
"Huawei HG655b")
|
|
|
|
board_name="hg655b"
|
|
|
|
;;
|
2015-03-30 20:21:01 +00:00
|
|
|
"Inteno VG50")
|
|
|
|
board_name="vg50"
|
|
|
|
;;
|
2015-03-16 11:52:26 +00:00
|
|
|
"Inventel Livebox 1")
|
|
|
|
board_name="livebox1"
|
2015-03-16 11:52:20 +00:00
|
|
|
;;
|
2015-03-16 11:52:26 +00:00
|
|
|
"Netgear CVG834G")
|
2015-03-16 11:52:20 +00:00
|
|
|
board_name="cvg834g"
|
|
|
|
;;
|
2015-03-16 11:52:26 +00:00
|
|
|
"Netgear DG834GT/PN")
|
|
|
|
board_name="dg834gt"
|
2015-03-16 11:52:20 +00:00
|
|
|
;;
|
2015-03-25 15:35:43 +00:00
|
|
|
"Netgear DG834G v4")
|
|
|
|
board_name="dg834g_v4"
|
|
|
|
;;
|
2015-03-16 11:52:26 +00:00
|
|
|
"Netgear DGND3700v1/DGND3800B")
|
2015-03-16 11:52:20 +00:00
|
|
|
board_name="dgnd3700v1_dgnd3800b"
|
|
|
|
;;
|
2016-05-22 22:56:23 +00:00
|
|
|
"Netgear EVG2000")
|
|
|
|
board_name="evg2000"
|
|
|
|
;;
|
2015-12-02 22:18:20 +00:00
|
|
|
"NuCom R5010UN v2")
|
|
|
|
board_name="r5010un_v2"
|
|
|
|
;;
|
2016-12-03 14:51:05 +00:00
|
|
|
"Observa VH4032N")
|
|
|
|
board_name="vh4032n"
|
|
|
|
;;
|
2015-03-16 11:52:26 +00:00
|
|
|
"Pirelli A226G")
|
|
|
|
board_name="a226g"
|
|
|
|
;;
|
|
|
|
"Pirelli A226M")
|
|
|
|
board_name="a226m"
|
|
|
|
;;
|
|
|
|
"Pirelli A226M-FWB")
|
|
|
|
board_name="a226m-fwb"
|
|
|
|
;;
|
|
|
|
"Pirelli Alice Gate AGPF-S0")
|
|
|
|
board_name="agpf-s0"
|
|
|
|
;;
|
|
|
|
"Sagem F@ST2404")
|
|
|
|
board_name="fast2404"
|
|
|
|
;;
|
|
|
|
"Sagem F@ST2504n")
|
2015-03-16 11:52:20 +00:00
|
|
|
board_name="fast2504n"
|
|
|
|
;;
|
2015-03-16 11:52:26 +00:00
|
|
|
"Sagem F@ST2604")
|
|
|
|
board_name="fast2604"
|
|
|
|
;;
|
2015-08-05 13:55:37 +00:00
|
|
|
"Sagem F@ST2704N")
|
|
|
|
board_name="fast2704n"
|
|
|
|
;;
|
2015-03-16 11:52:26 +00:00
|
|
|
"Sagem F@ST2704V2")
|
2015-03-16 11:52:20 +00:00
|
|
|
board_name="fast2704v2"
|
|
|
|
;;
|
2017-08-31 20:22:37 +00:00
|
|
|
"Sercomm AD1018 (SPI flash mod)")
|
|
|
|
board_name="ad1018-nor"
|
|
|
|
;;
|
2015-03-16 11:52:26 +00:00
|
|
|
"SFR Neuf Box 4"*)
|
|
|
|
board_name="neufbox4"
|
2015-03-16 11:52:20 +00:00
|
|
|
;;
|
2015-03-16 11:52:26 +00:00
|
|
|
"SFR neufbox 6 (Sercomm)")
|
|
|
|
board_name="neufbox6"
|
2015-03-16 11:52:20 +00:00
|
|
|
;;
|
2015-03-16 11:52:26 +00:00
|
|
|
"T-Com Speedport W303 V")
|
|
|
|
board_name="spw303v"
|
2015-03-16 11:52:20 +00:00
|
|
|
;;
|
2015-03-16 11:52:26 +00:00
|
|
|
"T-Com Speedport W500 V")
|
|
|
|
board_name="spw500v"
|
2015-03-16 11:52:20 +00:00
|
|
|
;;
|
2015-03-16 11:52:26 +00:00
|
|
|
"TECOM GW6000")
|
|
|
|
board_name="g6000"
|
2015-03-16 11:52:20 +00:00
|
|
|
;;
|
2015-03-16 11:52:26 +00:00
|
|
|
"TECOM GW6200")
|
|
|
|
board_name="g6200"
|
2015-03-16 11:52:20 +00:00
|
|
|
;;
|
2017-02-14 15:37:04 +00:00
|
|
|
"Telsey CPVA502+")
|
2015-03-25 15:35:57 +00:00
|
|
|
board_name="cpva502p"
|
|
|
|
;;
|
2015-03-16 11:52:26 +00:00
|
|
|
"Telsey CPVA642-type (CPA-ZNTE60T)")
|
|
|
|
board_name="cpva642"
|
2015-03-16 11:52:20 +00:00
|
|
|
;;
|
2015-03-25 15:36:05 +00:00
|
|
|
"Telsey MAGIC")
|
|
|
|
board_name="magic"
|
|
|
|
;;
|
2015-03-16 11:52:26 +00:00
|
|
|
"TP-Link TD-W8900GB")
|
|
|
|
board_name="td-w8900gb"
|
2015-03-16 11:52:20 +00:00
|
|
|
;;
|
2015-03-16 11:52:26 +00:00
|
|
|
"USRobotics 9108")
|
|
|
|
board_name="usr9108"
|
|
|
|
;;
|
|
|
|
"Zyxel P870HW-51a v2")
|
2015-03-16 11:52:20 +00:00
|
|
|
board_name="p870hw-51a_v2"
|
|
|
|
;;
|
2015-03-16 11:52:26 +00:00
|
|
|
*)
|
|
|
|
board_name="unknown"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
echo "$board_name"
|
|
|
|
}
|
|
|
|
|
|
|
|
brcm63xx_legacy_detect() {
|
|
|
|
local board_name
|
|
|
|
|
|
|
|
case "$1" in
|
2015-03-16 11:52:20 +00:00
|
|
|
*)
|
|
|
|
board_name="unknown"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
echo "$board_name"
|
|
|
|
}
|
|
|
|
|
2010-05-30 01:32:47 +00:00
|
|
|
brcm63xx_detect() {
|
2015-03-16 11:52:20 +00:00
|
|
|
local board_name model
|
|
|
|
|
2015-03-16 11:52:16 +00:00
|
|
|
board_id=$(awk 'BEGIN{FS="[ \t:/]+"} /system type/ {print $4}' /proc/cpuinfo)
|
2010-05-30 01:32:47 +00:00
|
|
|
|
2015-03-16 11:52:20 +00:00
|
|
|
if [ -e /proc/device-tree ]; then
|
|
|
|
model=$(cat /proc/device-tree/model)
|
2015-03-16 11:52:26 +00:00
|
|
|
board_name=$(brcm63xx_dt_detect "$model")
|
2015-03-16 11:52:20 +00:00
|
|
|
else
|
|
|
|
model="Unknown bcm63xx board"
|
2015-03-16 11:52:26 +00:00
|
|
|
board_name=$(brcm63xx_legacy_detect "$board_id")
|
2015-03-16 11:52:20 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
[ -e "/tmp/sysinfo" ] || mkdir -p "/tmp/sysinfo"
|
|
|
|
|
|
|
|
echo "$board_name" > /tmp/sysinfo/board_name
|
|
|
|
echo "$model" > /tmp/sysinfo/model
|
|
|
|
}
|