2010-04-12 01:47:23 +08:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2013-03-03 20:47:02 +08:00
|
|
|
# Copyright (C) 2010-2013 OpenWrt.org
|
2010-04-12 01:47:23 +08:00
|
|
|
#
|
|
|
|
|
2013-03-03 20:47:02 +08:00
|
|
|
RAMIPS_BOARD_NAME=
|
|
|
|
RAMIPS_MODEL=
|
|
|
|
|
2013-03-03 20:47:28 +08:00
|
|
|
all500x_board_detect() {
|
|
|
|
local systype
|
|
|
|
|
|
|
|
systype=$(awk 'BEGIN{FS="[ \t]+:[ \t]"} /system type/ {print $2}' /proc/cpuinfo)
|
|
|
|
case "$systype" in
|
|
|
|
*"RT5350"*)
|
|
|
|
RAMIPS_MODEL="Allnet ALL5003"
|
|
|
|
;;
|
|
|
|
*"RT3352"*)
|
|
|
|
RAMIPS_MODEL="Allnet ALL5002"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
2013-03-03 20:47:02 +08:00
|
|
|
|
|
|
|
ramips_board_detect() {
|
2010-04-12 01:47:23 +08:00
|
|
|
local machine
|
|
|
|
local name
|
|
|
|
|
|
|
|
machine=$(awk 'BEGIN{FS="[ \t]+:[ \t]"} /machine/ {print $2}' /proc/cpuinfo)
|
|
|
|
|
|
|
|
case "$machine" in
|
2012-08-29 18:37:43 +08:00
|
|
|
*"8devices Carambola")
|
|
|
|
name="carambola"
|
|
|
|
;;
|
2012-07-12 21:29:46 +08:00
|
|
|
*"Edimax 3g-6200n")
|
|
|
|
name="3g-6200n"
|
|
|
|
;;
|
2012-12-30 01:50:32 +08:00
|
|
|
*"AirLive Air3GII")
|
|
|
|
name="air3gii"
|
|
|
|
;;
|
2013-02-03 01:01:50 +08:00
|
|
|
*"Edimax BR-6425")
|
|
|
|
name="br6425"
|
|
|
|
;;
|
2012-08-18 01:56:07 +08:00
|
|
|
*"Allnet ALL0239-3G")
|
|
|
|
name="all0239-3g"
|
|
|
|
;;
|
2012-01-24 19:48:47 +08:00
|
|
|
*"Allnet ALL0256N")
|
|
|
|
name="all0256n"
|
|
|
|
;;
|
2013-03-03 20:47:25 +08:00
|
|
|
*"Allnet ALL5002/ALL5003")
|
2012-07-25 04:38:14 +08:00
|
|
|
name="all5002"
|
|
|
|
;;
|
2012-03-30 00:03:04 +08:00
|
|
|
*"ARC FreeStation5")
|
|
|
|
name="freestation5"
|
|
|
|
;;
|
2011-08-15 22:11:45 +08:00
|
|
|
*"Argus ATP-52B")
|
|
|
|
name="argus-atp52b"
|
|
|
|
;;
|
2013-01-06 19:11:42 +08:00
|
|
|
*"BR6524N")
|
|
|
|
name="br6524n"
|
|
|
|
;;
|
2012-03-28 03:29:57 +08:00
|
|
|
*"Asus WL-330N")
|
|
|
|
name="wl-330n"
|
|
|
|
;;
|
2012-04-24 00:56:05 +08:00
|
|
|
*"Asus WL-330N3G")
|
|
|
|
name="wl-330n3g"
|
|
|
|
;;
|
2011-07-03 23:01:56 +08:00
|
|
|
*"Aztech HW550-3G")
|
|
|
|
name="hw550-3g"
|
|
|
|
;;
|
2011-07-28 18:56:22 +08:00
|
|
|
*"DIR-300 B1")
|
2010-04-12 01:47:23 +08:00
|
|
|
name="dir-300-b1"
|
|
|
|
;;
|
2011-07-28 18:56:24 +08:00
|
|
|
*"DIR-600 B1")
|
|
|
|
name="dir-600-b1"
|
|
|
|
;;
|
|
|
|
*"DIR-600 B2")
|
|
|
|
name="dir-600-b2"
|
|
|
|
;;
|
2012-08-12 20:48:24 +08:00
|
|
|
*"DIR-620 A1")
|
|
|
|
name="dir-620-a1"
|
|
|
|
;;
|
2012-08-18 01:56:05 +08:00
|
|
|
*"DIR-615 H1")
|
|
|
|
name="dir-615-h1"
|
|
|
|
;;
|
2012-11-25 22:25:27 +08:00
|
|
|
*"DIR-615 D")
|
|
|
|
name="dir-615-d"
|
|
|
|
;;
|
2012-10-18 15:23:03 +08:00
|
|
|
*"DIR-645")
|
|
|
|
name="dir-645"
|
|
|
|
;;
|
2013-03-03 20:46:08 +08:00
|
|
|
*"DAP-1350")
|
|
|
|
name="dap-1350"
|
|
|
|
;;
|
2011-12-23 22:27:10 +08:00
|
|
|
*"ESR-9753")
|
|
|
|
name="esr-9753"
|
|
|
|
;;
|
2011-12-28 16:43:43 +08:00
|
|
|
*"F5D8235 v1")
|
|
|
|
name="f5d8235-v1"
|
|
|
|
;;
|
2011-07-03 23:01:56 +08:00
|
|
|
*"F5D8235 v2")
|
|
|
|
name="f5d8235-v2"
|
|
|
|
;;
|
2012-12-10 22:13:01 +08:00
|
|
|
*"Hauppauge Broadway")
|
|
|
|
name="broadway"
|
|
|
|
;;
|
2010-04-12 01:47:23 +08:00
|
|
|
*"La Fonera 2.0N")
|
|
|
|
name="fonera20n"
|
|
|
|
;;
|
2012-11-30 01:37:13 +08:00
|
|
|
*"Asus RT-N13U")
|
|
|
|
name="rt-n13u"
|
|
|
|
;;
|
2011-07-03 23:01:56 +08:00
|
|
|
*"MoFi Network MOFI3500-3GN")
|
|
|
|
name="mofi3500-3gn"
|
|
|
|
;;
|
2011-08-23 04:41:49 +08:00
|
|
|
*"NBG-419N")
|
|
|
|
name="nbg-419n"
|
|
|
|
;;
|
2011-10-25 05:49:36 +08:00
|
|
|
*"NexAira BC2")
|
|
|
|
name="bc2"
|
|
|
|
;;
|
2011-07-28 18:56:32 +08:00
|
|
|
*"NW718")
|
|
|
|
name="nw718"
|
|
|
|
;;
|
2013-02-03 01:21:05 +08:00
|
|
|
*"Omnima EMB HPM")
|
|
|
|
name="omni-emb-hpm"
|
|
|
|
;;
|
2011-12-15 04:51:26 +08:00
|
|
|
*"Omnima MiniEMBWiFi")
|
|
|
|
name="omni-emb"
|
|
|
|
;;
|
2012-06-19 17:52:15 +08:00
|
|
|
*"Petatel PSR-680W"*)
|
|
|
|
name="psr-680w"
|
|
|
|
;;
|
2012-12-30 01:50:38 +08:00
|
|
|
*"Planex MZK-W300NH2"*)
|
|
|
|
name="mzk-w300nh2"
|
|
|
|
;;
|
2011-07-03 23:01:56 +08:00
|
|
|
*"PWH2004")
|
|
|
|
name="pwh2004"
|
|
|
|
;;
|
2011-07-28 18:56:30 +08:00
|
|
|
*"RT-G32 B1")
|
|
|
|
name="rt-g32-b1"
|
|
|
|
;;
|
2012-03-05 00:09:11 +08:00
|
|
|
*"RT-N10+")
|
|
|
|
name="rt-n10-plus"
|
|
|
|
;;
|
2011-07-03 23:01:56 +08:00
|
|
|
*"RT-N15")
|
|
|
|
name="rt-n15"
|
|
|
|
;;
|
2012-02-13 23:18:04 +08:00
|
|
|
*"RT-N56U")
|
|
|
|
name="rt-n56u"
|
|
|
|
;;
|
2012-02-20 00:44:49 +08:00
|
|
|
*"Skyline SL-R7205"*)
|
|
|
|
name="sl-r7205"
|
|
|
|
;;
|
2012-01-23 18:23:32 +08:00
|
|
|
*"Sparklan WCR-150GN")
|
2011-07-03 23:01:56 +08:00
|
|
|
name="wcr-150gn"
|
|
|
|
;;
|
2010-04-12 01:47:23 +08:00
|
|
|
*"V22RW-2X2")
|
|
|
|
name="v22rw-2x2"
|
|
|
|
;;
|
2011-12-28 16:43:32 +08:00
|
|
|
*"W502U")
|
|
|
|
name="w502u"
|
|
|
|
;;
|
2010-04-12 01:47:23 +08:00
|
|
|
*"WHR-G300N")
|
|
|
|
name="whr-g300n"
|
|
|
|
;;
|
2012-01-26 18:44:23 +08:00
|
|
|
*"Sitecom WL-341 v3")
|
|
|
|
name="wl341v3"
|
|
|
|
;;
|
2011-12-23 22:27:16 +08:00
|
|
|
*"Sitecom WL-351 v1 002")
|
|
|
|
name="wl-351"
|
|
|
|
;;
|
2013-01-20 01:05:06 +08:00
|
|
|
*"Tenda 3G300M")
|
|
|
|
name="3g300m"
|
|
|
|
;;
|
2012-04-21 20:30:40 +08:00
|
|
|
*"Tenda W306R V2.0")
|
|
|
|
name="w306r-v20"
|
|
|
|
;;
|
2012-10-18 15:23:12 +08:00
|
|
|
*"TEW-691GR")
|
|
|
|
name="tew-691gr"
|
|
|
|
;;
|
2012-10-18 15:23:07 +08:00
|
|
|
*"TEW-692GR")
|
|
|
|
name="tew-692gr"
|
|
|
|
;;
|
2012-02-16 05:13:11 +08:00
|
|
|
*"Ralink V11ST-FE")
|
|
|
|
name="v11st-fe"
|
|
|
|
;;
|
2011-12-28 00:56:30 +08:00
|
|
|
*"WLI-TX4-AG300N")
|
|
|
|
name="wli-tx4-ag300n"
|
|
|
|
;;
|
2011-07-03 23:01:56 +08:00
|
|
|
*"WZR-AGL300NH")
|
|
|
|
name="wzr-agl300nh"
|
2011-04-04 16:43:07 +08:00
|
|
|
;;
|
2011-08-23 02:08:45 +08:00
|
|
|
*"WR512-3GN-like router")
|
2011-08-19 23:55:10 +08:00
|
|
|
name="wr512-3gn"
|
|
|
|
;;
|
2013-03-12 05:02:43 +08:00
|
|
|
*"UR-326N4G Wireless N router")
|
|
|
|
name="ur-326n4g"
|
|
|
|
;;
|
2012-04-24 00:56:06 +08:00
|
|
|
*"UR-336UN Wireless N router")
|
|
|
|
name="ur-336un"
|
|
|
|
;;
|
2012-02-11 23:11:36 +08:00
|
|
|
*"AWB WR6202")
|
|
|
|
name="wr6202"
|
|
|
|
;;
|
2012-03-05 00:09:13 +08:00
|
|
|
*"XDX RN502J")
|
|
|
|
name="xdxrn502j"
|
|
|
|
;;
|
2010-04-12 01:47:23 +08:00
|
|
|
*)
|
|
|
|
name="generic"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2013-03-03 20:47:28 +08:00
|
|
|
case "$machine" in
|
|
|
|
*"Allnet ALL5002/ALL5003")
|
|
|
|
all500x_board_detect
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2013-03-03 20:47:02 +08:00
|
|
|
[ -z "$RAMIPS_BOARD_NAME" ] && RAMIPS_BOARD_NAME="$name"
|
|
|
|
[ -z "$RAMIPS_MODEL" ] && RAMIPS_MODEL="$machine"
|
|
|
|
|
|
|
|
[ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
|
|
|
|
|
|
|
|
echo "$RAMIPS_BOARD_NAME" > /tmp/sysinfo/board_name
|
|
|
|
echo "$RAMIPS_MODEL" > /tmp/sysinfo/model
|
|
|
|
}
|
|
|
|
|
|
|
|
ramips_board_name() {
|
|
|
|
local name
|
|
|
|
|
|
|
|
[ -f /tmp/sysinfo/board_name ] && name=$(cat /tmp/sysinfo/board_name)
|
|
|
|
[ -z "$name" ] && name="unknown"
|
|
|
|
|
|
|
|
echo "$name"
|
2010-04-12 01:47:23 +08:00
|
|
|
}
|