ar71xx.sh 17 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138
  1. #!/bin/sh
  2. #
  3. # Copyright (C) 2009-2011 OpenWrt.org
  4. #
  5. AR71XX_BOARD_NAME=
  6. AR71XX_MODEL=
  7. ar71xx_get_mtd_offset_size_format() {
  8. local mtd="$1"
  9. local offset="$2"
  10. local size="$3"
  11. local format="$4"
  12. local dev
  13. dev=$(find_mtd_part $mtd)
  14. [ -z "$dev" ] && return
  15. dd if=$dev bs=1 skip=$offset count=$size 2>/dev/null | hexdump -v -e "1/1 \"$format\""
  16. }
  17. ar71xx_get_mtd_part_magic() {
  18. local mtd="$1"
  19. ar71xx_get_mtd_offset_size_format "$mtd" 0 4 %02x
  20. }
  21. wndr3700_board_detect() {
  22. local machine="$1"
  23. local magic
  24. local name
  25. name="wndr3700"
  26. magic="$(ar71xx_get_mtd_part_magic firmware)"
  27. case $magic in
  28. "33373030")
  29. machine="NETGEAR WNDR3700"
  30. ;;
  31. "33373031")
  32. model="$(ar71xx_get_mtd_offset_size_format art 41 32 %c)"
  33. # Use awk to remove everything unprintable
  34. model_stripped="$(ar71xx_get_mtd_offset_size_format art 41 32 %c | LC_CTYPE=C awk -v 'FS=[^[:print:]]' '{print $1; exit}')"
  35. case $model in
  36. $'\xff'*)
  37. if [ "${model:24:1}" = 'N' ]; then
  38. machine="NETGEAR WNDRMAC"
  39. else
  40. machine="NETGEAR WNDR3700v2"
  41. fi
  42. ;;
  43. '29763654+16+64'*)
  44. machine="NETGEAR ${model_stripped:14}"
  45. ;;
  46. '29763654+16+128'*)
  47. machine="NETGEAR ${model_stripped:15}"
  48. ;;
  49. *)
  50. # Unknown ID
  51. machine="NETGEAR ${model_stripped}"
  52. esac
  53. esac
  54. AR71XX_BOARD_NAME="$name"
  55. AR71XX_MODEL="$machine"
  56. }
  57. cybertan_get_hw_magic() {
  58. local part
  59. part=$(find_mtd_part firmware)
  60. [ -z "$part" ] && return 1
  61. dd bs=8 count=1 skip=0 if=$part 2>/dev/null | hexdump -v -n 8 -e '1/1 "%02x"'
  62. }
  63. tplink_get_hwid() {
  64. local part
  65. part=$(find_mtd_part firmware)
  66. [ -z "$part" ] && return 1
  67. dd if=$part bs=4 count=1 skip=16 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"'
  68. }
  69. tplink_get_mid() {
  70. local part
  71. part=$(find_mtd_part firmware)
  72. [ -z "$part" ] && return 1
  73. dd if=$part bs=4 count=1 skip=17 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"'
  74. }
  75. tplink_board_detect() {
  76. local model="$1"
  77. local hwid
  78. local hwver
  79. hwid=$(tplink_get_hwid)
  80. mid=$(tplink_get_mid)
  81. hwver=${hwid:6:2}
  82. hwver=" v${hwver#0}"
  83. case "$hwid" in
  84. "015000"*)
  85. model="EasyLink EL-M150"
  86. ;;
  87. "015300"*)
  88. model="EasyLink EL-MINI"
  89. ;;
  90. "044401"*)
  91. model="ANTMINER-S1"
  92. ;;
  93. "044403"*)
  94. model="ANTMINER-S3"
  95. ;;
  96. "44440101"*)
  97. model="ANTROUTER-R1"
  98. ;;
  99. "120000"*)
  100. model="MERCURY MAC1200R"
  101. ;;
  102. "007260"*)
  103. model="TellStick ZNet Lite"
  104. ;;
  105. "066601"*)
  106. model="OMYlink OMY-G1"
  107. ;;
  108. "066602"*)
  109. model="OMYlink OMY-X1"
  110. ;;
  111. "3C0001"*)
  112. model="OOLITE"
  113. ;;
  114. "3C0002"*)
  115. model="MINIBOX_V1"
  116. ;;
  117. "070301"*)
  118. model="TP-Link TL-WR703N"
  119. ;;
  120. "071000"*)
  121. model="TP-Link TL-WR710N"
  122. if [ "$hwid" = '07100002' -a "$mid" = '00000002' ]; then
  123. hwver=' v2.1'
  124. fi
  125. ;;
  126. "072001"*)
  127. model="TP-Link TL-WR720N"
  128. ;;
  129. "070100"*)
  130. model="TP-Link TL-WA701N/ND"
  131. ;;
  132. "073000"*)
  133. model="TP-Link TL-WA730RE"
  134. ;;
  135. "074000"*)
  136. model="TP-Link TL-WR740N/ND"
  137. ;;
  138. "074100"*)
  139. model="TP-Link TL-WR741N/ND"
  140. ;;
  141. "074300"*)
  142. model="TP-Link TL-WR743N/ND"
  143. ;;
  144. "075000"*)
  145. model="TP-Link TL-WA750RE"
  146. ;;
  147. "721000"*)
  148. model="TP-Link TL-WA7210N"
  149. ;;
  150. "751000"*)
  151. model="TP-Link TL-WA7510N"
  152. ;;
  153. "080100"*)
  154. model="TP-Link TL-WA801N/ND"
  155. ;;
  156. "083000"*)
  157. model="TP-Link TL-WA830RE"
  158. if [ "$hwver" = ' v10' ]; then
  159. hwver=' v1'
  160. fi
  161. ;;
  162. "084100"*)
  163. model="TP-Link TL-WR841N/ND"
  164. if [ "$hwid" = '08410002' -a "$mid" = '00000002' ]; then
  165. hwver=' v1.5'
  166. fi
  167. ;;
  168. "084200"*)
  169. model="TP-Link TL-WR842N/ND"
  170. ;;
  171. "084300"*)
  172. model="TP-Link TL-WR843N/ND"
  173. ;;
  174. "085000"*)
  175. model="TP-Link TL-WA850RE"
  176. ;;
  177. "086000"*)
  178. model="TP-Link TL-WA860RE"
  179. ;;
  180. "090100"*)
  181. model="TP-Link TL-WA901N/ND"
  182. ;;
  183. "094100"*)
  184. if [ "$hwid" = "09410002" -a "$mid" = "00420001" ]; then
  185. model="Rosewill RNX-N360RT"
  186. hwver=""
  187. else
  188. model="TP-Link TL-WR941N/ND"
  189. fi
  190. ;;
  191. "104100"*)
  192. model="TP-Link TL-WR1041N/ND"
  193. ;;
  194. "104300"*)
  195. model="TP-Link TL-WR1043N/ND"
  196. ;;
  197. "254300"*)
  198. model="TP-Link TL-WR2543N/ND"
  199. ;;
  200. "001001"*)
  201. model="TP-Link TL-MR10U"
  202. ;;
  203. "001101"*)
  204. model="TP-Link TL-MR11U"
  205. ;;
  206. "001201"*)
  207. model="TP-Link TL-MR12U"
  208. ;;
  209. "001301"*)
  210. model="TP-Link TL-MR13U"
  211. ;;
  212. "302000"*)
  213. model="TP-Link TL-MR3020"
  214. ;;
  215. "304000"*)
  216. model="TP-Link TL-MR3040"
  217. ;;
  218. "322000"*)
  219. model="TP-Link TL-MR3220"
  220. ;;
  221. "342000"*)
  222. model="TP-Link TL-MR3420"
  223. ;;
  224. "332000"*)
  225. model="TP-Link TL-WDR3320"
  226. ;;
  227. "350000"*)
  228. model="TP-Link TL-WDR3500"
  229. ;;
  230. "360000"*)
  231. model="TP-Link TL-WDR3600"
  232. ;;
  233. "430000"*)
  234. model="TP-Link TL-WDR4300"
  235. ;;
  236. "430080"*)
  237. iw reg set IL
  238. model="TP-Link TL-WDR4300 (IL)"
  239. ;;
  240. "431000"*)
  241. model="TP-Link TL-WDR4310"
  242. ;;
  243. "49000002")
  244. model="TP-Link TL-WDR4900"
  245. ;;
  246. "65000002")
  247. model="TP-Link TL-WDR6500"
  248. ;;
  249. "453000"*)
  250. model="MERCURY MW4530R"
  251. ;;
  252. "934100"*)
  253. model="NC-LINK SMART-300"
  254. ;;
  255. "c50000"*)
  256. model="TP-Link Archer C5"
  257. ;;
  258. "750000"*|\
  259. "c70000"*)
  260. model="TP-Link Archer C7"
  261. ;;
  262. *)
  263. hwver=""
  264. ;;
  265. esac
  266. AR71XX_MODEL="$model$hwver"
  267. }
  268. tplink_pharos_get_model_string() {
  269. local part
  270. part=$(find_mtd_part 'product-info')
  271. [ -z "$part" ] && return 1
  272. # The returned string will end with \r\n, but we don't remove it here
  273. # to simplify matching against it in the sysupgrade image check
  274. dd if=$part bs=1 skip=4360 2>/dev/null | head -n 1
  275. }
  276. tplink_pharos_board_detect() {
  277. local model_string="$(tplink_pharos_get_model_string | tr -d '\r')"
  278. local oIFS="$IFS"; IFS=":"; set -- $model_string; IFS="$oIFS"
  279. local model
  280. case "$1" in
  281. 'CPE210(TP-LINK|UN|N300-2)')
  282. model='TP-Link CPE210'
  283. ;;
  284. 'CPE220(TP-LINK|UN|N300-2)')
  285. model='TP-Link CPE220'
  286. ;;
  287. 'CPE510(TP-LINK|UN|N300-5)')
  288. model='TP-Link CPE510'
  289. ;;
  290. 'CPE520(TP-LINK|UN|N300-5)')
  291. model='TP-Link CPE520'
  292. ;;
  293. esac
  294. [ -n "$model" ] && AR71XX_MODEL="$model v$2"
  295. }
  296. gl_inet_board_detect() {
  297. local size="$(mtd_get_part_size 'firmware')"
  298. case "$size" in
  299. 8192000)
  300. AR71XX_MODEL='GL-iNet 6408A v1'
  301. ;;
  302. 16580608)
  303. AR71XX_MODEL='GL-iNet 6416A v1'
  304. ;;
  305. esac
  306. }
  307. ar71xx_board_detect() {
  308. local machine
  309. local name
  310. machine=$(awk 'BEGIN{FS="[ \t]+:[ \t]"} /machine/ {print $2}' /proc/cpuinfo)
  311. case "$machine" in
  312. *"Oolite V1.0")
  313. name="oolite"
  314. ;;
  315. *"AC1750DB")
  316. name="f9k1115v2"
  317. ;;
  318. *"AirGateway")
  319. name="airgateway"
  320. ;;
  321. *"AirGateway Pro")
  322. name="airgatewaypro"
  323. ;;
  324. *"AirRouter")
  325. name="airrouter"
  326. ;;
  327. *"ALFA Network AP120C")
  328. name="alfa-ap120c"
  329. ;;
  330. *"ALFA Network AP96")
  331. name="alfa-ap96"
  332. ;;
  333. *"ALFA Network N2/N5")
  334. name="alfa-nx"
  335. ;;
  336. *ALL0258N)
  337. name="all0258n"
  338. ;;
  339. *ALL0305)
  340. name="all0305"
  341. ;;
  342. *ALL0315N)
  343. name="all0315n"
  344. ;;
  345. *Antminer-S1)
  346. name="antminer-s1"
  347. ;;
  348. *Antminer-S3)
  349. name="antminer-s3"
  350. ;;
  351. *"Arduino Yun")
  352. name="arduino-yun"
  353. ;;
  354. *AP113)
  355. name="ap113"
  356. ;;
  357. *"AP121 reference board")
  358. name="ap121"
  359. ;;
  360. *AP121-MINI)
  361. name="ap121-mini"
  362. ;;
  363. *"AP132 reference board")
  364. name="ap132"
  365. ;;
  366. *"AP136-010 reference board")
  367. name="ap136-010"
  368. ;;
  369. *"AP136-020 reference board")
  370. name="ap136-020"
  371. ;;
  372. *"AP135-020 reference board")
  373. name="ap135-020"
  374. ;;
  375. *"AP143 reference board")
  376. name="ap143"
  377. ;;
  378. *"AP147-010 reference board")
  379. name="ap147-010"
  380. ;;
  381. *"AP152 reference board")
  382. name="ap152"
  383. ;;
  384. *AP81)
  385. name="ap81"
  386. ;;
  387. *AP83)
  388. name="ap83"
  389. ;;
  390. *"Archer C5")
  391. name="archer-c5"
  392. ;;
  393. *"Archer C7")
  394. name="archer-c7"
  395. ;;
  396. *"Atheros AP96")
  397. name="ap96"
  398. ;;
  399. *AW-NR580)
  400. name="aw-nr580"
  401. ;;
  402. *CAP324)
  403. name="cap324"
  404. ;;
  405. *C-55)
  406. name="c-55"
  407. ;;
  408. *CAP4200AG)
  409. name="cap4200ag"
  410. ;;
  411. *"COMFAST CF-E316N v2")
  412. name="cf-e316n-v2"
  413. ;;
  414. *"CPE210/220")
  415. name="cpe210"
  416. tplink_pharos_board_detect
  417. ;;
  418. *"CPE510/520")
  419. name="cpe510"
  420. tplink_pharos_board_detect
  421. ;;
  422. *CR3000)
  423. name="cr3000"
  424. ;;
  425. *CR5000)
  426. name="cr5000"
  427. ;;
  428. *"DB120 reference board")
  429. name="db120"
  430. ;;
  431. *"DGL-5500 rev. A1")
  432. name="dgl-5500-a1"
  433. ;;
  434. *"DHP-1565 rev. A1")
  435. name="dhp-1565-a1"
  436. ;;
  437. *"DIR-505 rev. A1")
  438. name="dir-505-a1"
  439. ;;
  440. *"DIR-600 rev. A1")
  441. name="dir-600-a1"
  442. ;;
  443. *"DIR-615 rev. E1")
  444. name="dir-615-e1"
  445. ;;
  446. *"DIR-615 rev. E4")
  447. name="dir-615-e4"
  448. ;;
  449. *"DIR-615 rev. I1")
  450. name="dir-615-i1"
  451. ;;
  452. *"DIR-825 rev. B1")
  453. name="dir-825-b1"
  454. ;;
  455. *"DIR-825 rev. C1")
  456. name="dir-825-c1"
  457. ;;
  458. *"DIR-835 rev. A1")
  459. name="dir-835-a1"
  460. ;;
  461. *"dLAN Hotspot")
  462. name="dlan-hotspot"
  463. ;;
  464. *"dLAN pro 500 Wireless+")
  465. name="dlan-pro-500-wp"
  466. ;;
  467. *"dLAN pro 1200+ WiFi ac")
  468. name="dlan-pro-1200-ac"
  469. ;;
  470. *DR344)
  471. name="dr344"
  472. ;;
  473. *"Dragino v2")
  474. name="dragino2"
  475. ;;
  476. *"Domino Pi")
  477. name="gl-domino"
  478. ;;
  479. *"DW33D")
  480. name="dw33d"
  481. ;;
  482. *"EAP300 v2")
  483. name="eap300v2"
  484. ;;
  485. *EAP7660D)
  486. name="eap7660d"
  487. ;;
  488. *EL-M150)
  489. name="el-m150"
  490. ;;
  491. *EL-MINI)
  492. name="el-mini"
  493. ;;
  494. *"GL-CONNECT INET v1")
  495. name="gl-inet"
  496. gl_inet_board_detect
  497. ;;
  498. *"GL AR150")
  499. name="gl-ar150"
  500. ;;
  501. *"GL AR300")
  502. name="gl-ar300"
  503. ;;
  504. *"EnGenius EPG5000")
  505. name="epg5000"
  506. ;;
  507. *"EnGenius ESR1750")
  508. name="esr1750"
  509. ;;
  510. *"EnGenius ESR900")
  511. name="esr900"
  512. ;;
  513. *JA76PF)
  514. name="ja76pf"
  515. ;;
  516. *JA76PF2)
  517. name="ja76pf2"
  518. ;;
  519. *"Bullet M")
  520. name="bullet-m"
  521. ;;
  522. *"Loco M XW")
  523. name="loco-m-xw"
  524. ;;
  525. *"Nanostation M")
  526. name="nanostation-m"
  527. ;;
  528. *"Nanostation M XW")
  529. name="nanostation-m-xw"
  530. ;;
  531. *JWAP003)
  532. name="jwap003"
  533. ;;
  534. *"Hornet-UB")
  535. local size
  536. size=$(awk '/firmware/ { print $2 }' /proc/mtd)
  537. if [ "x$size" = "x00790000" ]; then
  538. name="hornet-ub"
  539. fi
  540. if [ "x$size" = "x00f90000" ]; then
  541. name="hornet-ub-x2"
  542. fi
  543. ;;
  544. *LS-SR71)
  545. name="ls-sr71"
  546. ;;
  547. *"MAC1200R")
  548. name="mc-mac1200r"
  549. ;;
  550. *"MiniBox V1.0")
  551. name="minibox-v1"
  552. ;;
  553. *MR12)
  554. name="mr12"
  555. ;;
  556. *MR16)
  557. name="mr16"
  558. ;;
  559. *MR18)
  560. name="mr18"
  561. ;;
  562. *MR600v2)
  563. name="mr600v2"
  564. ;;
  565. *MR1750)
  566. name="mr1750"
  567. ;;
  568. *MR1750v2)
  569. name="mr1750v2"
  570. ;;
  571. *MR600)
  572. name="mr600"
  573. ;;
  574. *MR900)
  575. name="mr900"
  576. ;;
  577. *MR900v2)
  578. name="mr900v2"
  579. ;;
  580. *"My Net N600")
  581. name="mynet-n600"
  582. ;;
  583. *"My Net N750")
  584. name="mynet-n750"
  585. ;;
  586. *"WD My Net Wi-Fi Range Extender")
  587. name="mynet-rext"
  588. ;;
  589. *MZK-W04NU)
  590. name="mzk-w04nu"
  591. ;;
  592. *MZK-W300NH)
  593. name="mzk-w300nh"
  594. ;;
  595. *"NBG460N/550N/550NH")
  596. name="nbg460n_550n_550nh"
  597. ;;
  598. *"Zyxel NBG6616")
  599. name="nbg6616"
  600. ;;
  601. *"Zyxel NBG6716")
  602. name="nbg6716"
  603. ;;
  604. *OM2P)
  605. name="om2p"
  606. ;;
  607. *OM2Pv2)
  608. name="om2pv2"
  609. ;;
  610. *"OM2P HS")
  611. name="om2p-hs"
  612. ;;
  613. *"OM2P HSv2")
  614. name="om2p-hsv2"
  615. ;;
  616. *"OM2P HSv3")
  617. name="om2p-hsv3"
  618. ;;
  619. *"OM2P LC")
  620. name="om2p-lc"
  621. ;;
  622. *OM5P)
  623. name="om5p"
  624. ;;
  625. *"OM5P AN")
  626. name="om5p-an"
  627. ;;
  628. *"OM5P AC")
  629. name="om5p-ac"
  630. ;;
  631. *"OM5P ACv2")
  632. name="om5p-acv2"
  633. ;;
  634. *"OMY-X1")
  635. name="omy-x1"
  636. ;;
  637. *"OMY-G1")
  638. name="omy-g1"
  639. ;;
  640. *"Onion Omega")
  641. name="onion-omega"
  642. ;;
  643. *PB42)
  644. name="pb42"
  645. ;;
  646. *"PB44 reference board")
  647. name="pb44"
  648. ;;
  649. *PB92)
  650. name="pb92"
  651. ;;
  652. *"Qihoo 360 C301")
  653. name="qihoo-c301"
  654. ;;
  655. *"RouterBOARD 411/A/AH")
  656. name="rb-411"
  657. ;;
  658. *"RouterBOARD 411U")
  659. name="rb-411u"
  660. ;;
  661. *"RouterBOARD 433/AH")
  662. name="rb-433"
  663. ;;
  664. *"RouterBOARD 433UAH")
  665. name="rb-433u"
  666. ;;
  667. *"RouterBOARD 435G")
  668. name="rb-435g"
  669. ;;
  670. *"RouterBOARD 450")
  671. name="rb-450"
  672. ;;
  673. *"RouterBOARD 450G")
  674. name="rb-450g"
  675. ;;
  676. *"RouterBOARD 493/AH")
  677. name="rb-493"
  678. ;;
  679. *"RouterBOARD 493G")
  680. name="rb-493g"
  681. ;;
  682. *"RouterBOARD 750")
  683. name="rb-750"
  684. ;;
  685. *"RouterBOARD 750GL")
  686. name="rb-750gl"
  687. ;;
  688. *"RouterBOARD 751")
  689. name="rb-751"
  690. ;;
  691. *"RouterBOARD 751G")
  692. name="rb-751g"
  693. ;;
  694. *"RouterBOARD 911G-2HPnD")
  695. name="rb-911g-2hpnd"
  696. ;;
  697. *"RouterBOARD 911G-5HPnD")
  698. name="rb-911g-5hpnd"
  699. ;;
  700. *"RouterBOARD 911G-5HPacD")
  701. name="rb-911g-5hpacd"
  702. ;;
  703. *"RouterBOARD 912UAG-2HPnD")
  704. name="rb-912uag-2hpnd"
  705. ;;
  706. *"RouterBOARD 912UAG-5HPnD")
  707. name="rb-912uag-5hpnd"
  708. ;;
  709. *"RouterBOARD 951G-2HnD")
  710. name="rb-951g-2hnd"
  711. ;;
  712. *"RouterBOARD 951Ui-2HnD")
  713. name="rb-951ui-2hnd"
  714. ;;
  715. *"RouterBOARD 2011L")
  716. name="rb-2011l"
  717. ;;
  718. *"RouterBOARD 2011UAS")
  719. name="rb-2011uas"
  720. ;;
  721. *"RouterBOARD 2011UiAS")
  722. name="rb-2011uias"
  723. ;;
  724. *"RouterBOARD 2011UAS-2HnD")
  725. name="rb-2011uas-2hnd"
  726. ;;
  727. *"RouterBOARD 2011UiAS-2HnD")
  728. name="rb-2011uias-2hnd"
  729. ;;
  730. *"RouterBOARD SXT Lite2")
  731. name="rb-sxt2n"
  732. ;;
  733. *"RouterBOARD SXT Lite5")
  734. name="rb-sxt5n"
  735. ;;
  736. *"Rocket M")
  737. name="rocket-m"
  738. ;;
  739. *"Rocket M TI")
  740. name="rocket-m-ti"
  741. ;;
  742. *"Rocket M XW")
  743. name="rocket-m-xw"
  744. ;;
  745. *RouterStation)
  746. name="routerstation"
  747. ;;
  748. *"RouterStation Pro")
  749. name="routerstation-pro"
  750. ;;
  751. *RW2458N)
  752. name="rw2458n"
  753. ;;
  754. *"SMART-300")
  755. name="smart-300"
  756. ;;
  757. "Smart Electronics Black Swift board"*)
  758. name="bsb"
  759. ;;
  760. *"Telldus TellStick ZNet Lite")
  761. name="tellstick-znet-lite"
  762. ;;
  763. *SOM9331)
  764. name="som9331"
  765. ;;
  766. *TEW-632BRP)
  767. name="tew-632brp"
  768. ;;
  769. *TEW-673GRU)
  770. name="tew-673gru"
  771. ;;
  772. *TEW-712BR)
  773. name="tew-712br"
  774. ;;
  775. *TEW-732BR)
  776. name="tew-732br"
  777. ;;
  778. *TEW-823DRU)
  779. name="tew-823dru"
  780. ;;
  781. *"TL-WR1041N v2")
  782. name="tl-wr1041n-v2"
  783. ;;
  784. *TL-WR1043ND)
  785. name="tl-wr1043nd"
  786. ;;
  787. *"TL-WR1043ND v2")
  788. name="tl-wr1043nd-v2"
  789. ;;
  790. *"TL-WR1043ND v4")
  791. name="tl-wr1043nd-v4"
  792. ;;
  793. *TL-WR2543N*)
  794. name="tl-wr2543n"
  795. ;;
  796. *"DIR-615 rev. C1")
  797. name="dir-615-c1"
  798. ;;
  799. *TL-MR3020)
  800. name="tl-mr3020"
  801. ;;
  802. *TL-MR3040)
  803. name="tl-mr3040"
  804. ;;
  805. *"TL-MR3040 v2")
  806. name="tl-mr3040-v2"
  807. ;;
  808. *TL-MR3220)
  809. name="tl-mr3220"
  810. ;;
  811. *"TL-MR3220 v2")
  812. name="tl-mr3220-v2"
  813. ;;
  814. *TL-MR3420)
  815. name="tl-mr3420"
  816. ;;
  817. *"TL-MR3420 v2")
  818. name="tl-mr3420-v2"
  819. ;;
  820. *"TL-WA701ND v2")
  821. name="tl-wa701nd-v2"
  822. ;;
  823. *"TL-WA7210N v2")
  824. name="tl-wa7210n-v2"
  825. ;;
  826. *TL-WA750RE)
  827. name="tl-wa750re"
  828. ;;
  829. *"TL-WA7510N v1")
  830. name="tl-wa7510n"
  831. ;;
  832. *TL-WA850RE)
  833. name="tl-wa850re"
  834. ;;
  835. *TL-WA860RE)
  836. name="tl-wa860re"
  837. ;;
  838. *"TL-WA830RE v2")
  839. name="tl-wa830re-v2"
  840. ;;
  841. *"TL-WA801ND v2")
  842. name="tl-wa801nd-v2"
  843. ;;
  844. *"TL-WA801ND v3")
  845. name="tl-wa801nd-v3"
  846. ;;
  847. *TL-WA901ND)
  848. name="tl-wa901nd"
  849. ;;
  850. *"TL-WA901ND v2")
  851. name="tl-wa901nd-v2"
  852. ;;
  853. *"TL-WA901ND v3")
  854. name="tl-wa901nd-v3"
  855. ;;
  856. *"TL-WA901ND v4")
  857. name="tl-wa901nd-v4"
  858. ;;
  859. *"TL-WDR3320 v2")
  860. name="tl-wdr3320-v2"
  861. ;;
  862. *"TL-WDR3500")
  863. name="tl-wdr3500"
  864. ;;
  865. *"TL-WDR3600/4300/4310")
  866. name="tl-wdr4300"
  867. ;;
  868. *"TL-WDR4900 v2")
  869. name="tl-wdr4900-v2"
  870. ;;
  871. *"TL-WDR6500 v2")
  872. name="tl-wdr6500-v2"
  873. ;;
  874. *TL-WR741ND)
  875. name="tl-wr741nd"
  876. ;;
  877. *"TL-WR741ND v4")
  878. name="tl-wr741nd-v4"
  879. ;;
  880. *"TL-WR841N v1")
  881. name="tl-wr841n-v1"
  882. ;;
  883. *"TL-WR841N/ND v7")
  884. name="tl-wr841n-v7"
  885. ;;
  886. *"TL-WR841N/ND v8")
  887. name="tl-wr841n-v8"
  888. ;;
  889. *"TL-WR841N/ND v9")
  890. name="tl-wr841n-v9"
  891. ;;
  892. *"TL-WR841N/ND v11")
  893. name="tl-wr841n-v11"
  894. ;;
  895. *"TL-WR842N/ND v2")
  896. name="tl-wr842n-v2"
  897. ;;
  898. *"TL-WR842N/ND v3")
  899. name="tl-wr842n-v3"
  900. ;;
  901. *TL-WR941ND)
  902. name="tl-wr941nd"
  903. ;;
  904. *"TL-WR941N/ND v5")
  905. name="tl-wr941nd-v5"
  906. ;;
  907. *"TL-WR941N/ND v6")
  908. name="tl-wr941nd-v6"
  909. ;;
  910. *"TL-WR703N v1")
  911. name="tl-wr703n"
  912. ;;
  913. *"TL-WR710N v1")
  914. name="tl-wr710n"
  915. ;;
  916. *"TL-WR720N"*)
  917. name="tl-wr720n-v3"
  918. ;;
  919. *"TL-WR810N")
  920. name="tl-wr810n"
  921. ;;
  922. *"TL-MR10U")
  923. name="tl-mr10u"
  924. ;;
  925. *"TL-MR11U")
  926. name="tl-mr11u"
  927. ;;
  928. *"TL-MR12U")
  929. name="tl-mr12u"
  930. ;;
  931. *"TL-MR13U v1")
  932. name="tl-mr13u"
  933. ;;
  934. *"Tube2H")
  935. name="tube2h"
  936. ;;
  937. *UniFi)
  938. name="unifi"
  939. ;;
  940. *"UniFi-AC-LITE")
  941. name="unifiac-lite"
  942. ;;
  943. *"UniFi-AC-PRO")
  944. name="unifiac-pro"
  945. ;;
  946. *"UniFi AP Pro")
  947. name="uap-pro"
  948. ;;
  949. "WeIO"*)
  950. name="weio"
  951. ;;
  952. *WHR-G301N)
  953. name="whr-g301n"
  954. ;;
  955. *WHR-HP-GN)
  956. name="whr-hp-gn"
  957. ;;
  958. *WLAE-AG300N)
  959. name="wlae-ag300n"
  960. ;;
  961. *"UniFiAP Outdoor")
  962. name="unifi-outdoor"
  963. ;;
  964. *"UniFiAP Outdoor+")
  965. name="unifi-outdoor-plus"
  966. ;;
  967. *WP543)
  968. name="wp543"
  969. ;;
  970. *WPE72)
  971. name="wpe72"
  972. ;;
  973. *WPJ342)
  974. name="wpj342"
  975. ;;
  976. *WPJ344)
  977. name="wpj344"
  978. ;;
  979. *WPJ531)
  980. name="wpj531"
  981. ;;
  982. *WPJ558)
  983. name="wpj558"
  984. ;;
  985. *WNDAP360)
  986. name="wndap360"
  987. ;;
  988. *"WNDR3700/WNDR3800/WNDRMAC")
  989. wndr3700_board_detect "$machine"
  990. ;;
  991. *"R6100")
  992. name="r6100"
  993. ;;
  994. *"WNDR3700v4")
  995. name="wndr3700v4"
  996. ;;
  997. *"WNDR4300")
  998. name="wndr4300"
  999. ;;
  1000. *"WNR2000 V4")
  1001. name="wnr2000-v4"
  1002. ;;
  1003. *"WNR2000 V3")
  1004. name="wnr2000-v3"
  1005. ;;
  1006. *WNR2000)
  1007. name="wnr2000"
  1008. ;;
  1009. *WNR2200)
  1010. name="wnr2200"
  1011. ;;
  1012. *"WNR612 V2")
  1013. name="wnr612-v2"
  1014. ;;
  1015. *"WNR1000 V2")
  1016. name="wnr1000-v2"
  1017. ;;
  1018. *WPN824N)
  1019. name="wpn824n"
  1020. ;;
  1021. *WRT160NL)
  1022. name="wrt160nl"
  1023. ;;
  1024. *E2100L)
  1025. name="e2100l"
  1026. ;;
  1027. *WRT400N)
  1028. name="wrt400n"
  1029. ;;
  1030. *"WRTnode2Q board")
  1031. name="wrtnode2q"
  1032. ;;
  1033. *"WZR-450HP2")
  1034. name="wzr-450hp2"
  1035. ;;
  1036. *"WZR-HP-AG300H/WZR-600DHP")
  1037. name="wzr-hp-ag300h"
  1038. ;;
  1039. *WZR-HP-G300NH)
  1040. name="wzr-hp-g300nh"
  1041. ;;
  1042. *WZR-HP-G450H)
  1043. name="wzr-hp-g450h"
  1044. ;;
  1045. *WZR-HP-G300NH2)
  1046. name="wzr-hp-g300nh2"
  1047. ;;
  1048. *WHR-HP-G300N)
  1049. name="whr-hp-g300n"
  1050. ;;
  1051. *ZCN-1523H-2)
  1052. name="zcn-1523h-2"
  1053. ;;
  1054. *ZCN-1523H-5)
  1055. name="zcn-1523h-5"
  1056. ;;
  1057. *EmbWir-Dorin)
  1058. name="ew-dorin"
  1059. ;;
  1060. *EmbWir-Dorin-Router)
  1061. name="ew-dorin-router"
  1062. ;;
  1063. "8devices Carambola2"*)
  1064. name="carambola2"
  1065. ;;
  1066. *"Sitecom WLR-8100")
  1067. name="wlr8100"
  1068. ;;
  1069. *"BHU BXU2000n-2 rev. A1")
  1070. name="bxu2000n-2-a1"
  1071. ;;
  1072. *"HiWiFi HC6361")
  1073. name="hiwifi-hc6361"
  1074. ;;
  1075. *"ANONABOX_PRO")
  1076. name="anonabox-pro"
  1077. ;;
  1078. esac
  1079. [ -z "$AR71XX_MODEL" ] && [ "${machine:0:8}" = 'TP-LINK ' ] && \
  1080. tplink_board_detect "$machine"
  1081. [ -z "$name" ] && name="unknown"
  1082. [ -z "$AR71XX_BOARD_NAME" ] && AR71XX_BOARD_NAME="$name"
  1083. [ -z "$AR71XX_MODEL" ] && AR71XX_MODEL="$machine"
  1084. [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
  1085. echo "$AR71XX_BOARD_NAME" > /tmp/sysinfo/board_name
  1086. echo "$AR71XX_MODEL" > /tmp/sysinfo/model
  1087. }
  1088. ar71xx_board_name() {
  1089. local name
  1090. [ -f /tmp/sysinfo/board_name ] && name=$(cat /tmp/sysinfo/board_name)
  1091. [ -z "$name" ] && name="unknown"
  1092. echo "$name"
  1093. }