ar71xx.sh 19 KB

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