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. "081000"*)
  197. model="TP-Link TL-WR810N"
  198. ;;
  199. "083000"*)
  200. model="TP-Link TL-WA830RE"
  201. if [ "$hwver" = ' v10' ]; then
  202. hwver=' v1'
  203. fi
  204. ;;
  205. "084100"*)
  206. model="TP-Link TL-WR841N/ND"
  207. if [ "$hwid" = '08410002' -a "$mid" = '00000002' ]; then
  208. hwver=' v1.5'
  209. fi
  210. ;;
  211. "084200"*)
  212. model="TP-Link TL-WR842N/ND"
  213. ;;
  214. "084300"*)
  215. model="TP-Link TL-WR843N/ND"
  216. ;;
  217. "085000"*)
  218. model="TP-Link TL-WA850RE"
  219. ;;
  220. "086000"*)
  221. model="TP-Link TL-WA860RE"
  222. ;;
  223. "090100"*)
  224. model="TP-Link TL-WA901N/ND"
  225. ;;
  226. "094000"*)
  227. model="TP-Link TL-WR940N"
  228. ;;
  229. "094100"*)
  230. if [ "$hwid" = "09410002" -a "$mid" = "00420001" ]; then
  231. model="Rosewill RNX-N360RT"
  232. hwver=""
  233. else
  234. model="TP-Link TL-WR941N/ND"
  235. fi
  236. ;;
  237. "104100"*)
  238. model="TP-Link TL-WR1041N/ND"
  239. ;;
  240. "104300"*)
  241. model="TP-Link TL-WR1043N/ND"
  242. ;;
  243. "254300"*)
  244. model="TP-Link TL-WR2543N/ND"
  245. ;;
  246. "001001"*)
  247. model="TP-Link TL-MR10U"
  248. ;;
  249. "001101"*)
  250. model="TP-Link TL-MR11U"
  251. ;;
  252. "001201"*)
  253. model="TP-Link TL-MR12U"
  254. ;;
  255. "001301"*)
  256. model="TP-Link TL-MR13U"
  257. ;;
  258. "302000"*)
  259. model="TP-Link TL-MR3020"
  260. ;;
  261. "304000"*)
  262. model="TP-Link TL-MR3040"
  263. ;;
  264. "322000"*)
  265. model="TP-Link TL-MR3220"
  266. ;;
  267. "342000"*)
  268. model="TP-Link TL-MR3420"
  269. ;;
  270. "332000"*)
  271. model="TP-Link TL-WDR3320"
  272. ;;
  273. "350000"*)
  274. model="TP-Link TL-WDR3500"
  275. ;;
  276. "360000"*)
  277. model="TP-Link TL-WDR3600"
  278. ;;
  279. "430000"*)
  280. model="TP-Link TL-WDR4300"
  281. ;;
  282. "430080"*)
  283. iw reg set IL
  284. model="TP-Link TL-WDR4300 (IL)"
  285. ;;
  286. "431000"*)
  287. model="TP-Link TL-WDR4310"
  288. ;;
  289. "49000002")
  290. model="TP-Link TL-WDR4900"
  291. ;;
  292. "65000002")
  293. model="TP-Link TL-WDR6500"
  294. ;;
  295. "453000"*)
  296. model="Mercury MW4530R"
  297. ;;
  298. "934100"*)
  299. model="NC-LINK SMART-300"
  300. ;;
  301. "c50000"*)
  302. model="TP-Link Archer C5"
  303. ;;
  304. "750000"*|\
  305. "c70000"*)
  306. model="TP-Link Archer C7"
  307. ;;
  308. *)
  309. hwver=""
  310. ;;
  311. esac
  312. AR71XX_MODEL="$model$hwver"
  313. }
  314. tplink_pharos_get_model_string() {
  315. local part
  316. part=$(find_mtd_part 'product-info')
  317. [ -z "$part" ] && return 1
  318. # The returned string will end with \r\n, but we don't remove it here
  319. # to simplify matching against it in the sysupgrade image check
  320. dd if=$part bs=1 skip=4360 2>/dev/null | head -n 1
  321. }
  322. tplink_pharos_board_detect() {
  323. local model_string="$(tplink_pharos_get_model_string | tr -d '\r')"
  324. local oIFS="$IFS"; IFS=":"; set -- $model_string; IFS="$oIFS"
  325. local model="${1%%\(*}"
  326. AR71XX_MODEL="TP-Link $model v$2"
  327. }
  328. gl_inet_board_detect() {
  329. local size="$(mtd_get_part_size 'firmware')"
  330. case "$size" in
  331. 8192000)
  332. AR71XX_MODEL='GL-iNet 6408A v1'
  333. ;;
  334. 16580608)
  335. AR71XX_MODEL='GL-iNet 6416A v1'
  336. ;;
  337. esac
  338. }
  339. ar71xx_board_detect() {
  340. local machine
  341. local name
  342. machine=$(awk 'BEGIN{FS="[ \t]+:[ \t]"} /machine/ {print $2}' /proc/cpuinfo)
  343. case "$machine" in
  344. *"Oolite V1.0")
  345. name="oolite"
  346. ;;
  347. *"A40")
  348. name="a40"
  349. ;;
  350. *"A60")
  351. name="a60"
  352. ;;
  353. *"AC1750DB")
  354. name="f9k1115v2"
  355. ;;
  356. *"AirGateway")
  357. name="airgateway"
  358. ;;
  359. *"AirGateway Pro")
  360. name="airgatewaypro"
  361. ;;
  362. *"AirRouter")
  363. name="airrouter"
  364. ;;
  365. *"ALFA Network AP120C")
  366. name="alfa-ap120c"
  367. ;;
  368. *"ALFA Network AP96")
  369. name="alfa-ap96"
  370. ;;
  371. *"ALFA Network N2/N5")
  372. name="alfa-nx"
  373. ;;
  374. *ALL0258N)
  375. name="all0258n"
  376. ;;
  377. *ALL0305)
  378. name="all0305"
  379. ;;
  380. *ALL0315N)
  381. name="all0315n"
  382. ;;
  383. *Antminer-S1)
  384. name="antminer-s1"
  385. ;;
  386. *Antminer-S3)
  387. name="antminer-s3"
  388. ;;
  389. *"Arduino Yun")
  390. name="arduino-yun"
  391. ;;
  392. *"AP121 reference board")
  393. name="ap121"
  394. ;;
  395. *AP121-MINI)
  396. name="ap121-mini"
  397. ;;
  398. *"AP121F")
  399. name="ap121f"
  400. ;;
  401. *"AP132 reference board")
  402. name="ap132"
  403. ;;
  404. *"AP136-010 reference board")
  405. name="ap136-010"
  406. ;;
  407. *"AP136-020 reference board")
  408. name="ap136-020"
  409. ;;
  410. *"AP135-020 reference board")
  411. name="ap135-020"
  412. ;;
  413. *"AP143 reference board")
  414. name="ap143"
  415. ;;
  416. *"AP147-010 reference board")
  417. name="ap147-010"
  418. ;;
  419. *"AP152 reference board")
  420. name="ap152"
  421. ;;
  422. *AP90Q)
  423. name="ap90q"
  424. ;;
  425. *"Archer C5")
  426. name="archer-c5"
  427. ;;
  428. *"Archer C7")
  429. name="archer-c7"
  430. ;;
  431. *"Atheros AP96")
  432. name="ap96"
  433. ;;
  434. *AW-NR580)
  435. name="aw-nr580"
  436. ;;
  437. *BHR-4GRV2)
  438. name="bhr-4grv2"
  439. ;;
  440. *CAP324)
  441. name="cap324"
  442. ;;
  443. *C-55)
  444. name="c-55"
  445. ;;
  446. *C-60)
  447. name="c-60"
  448. ;;
  449. *CAP4200AG)
  450. name="cap4200ag"
  451. ;;
  452. *"CF-E316N v2")
  453. name="cf-e316n-v2"
  454. ;;
  455. *"CF-E320N v2")
  456. name="cf-e320n-v2"
  457. ;;
  458. *"CF-E380AC v1")
  459. name="cf-e380ac-v1"
  460. ;;
  461. *"CF-E380AC v2")
  462. name="cf-e380ac-v2"
  463. ;;
  464. *CF-E520N)
  465. name="cf-e520n"
  466. ;;
  467. *CF-E530N)
  468. name="cf-e530n"
  469. ;;
  470. *"CPE210/220")
  471. name="cpe210"
  472. tplink_pharos_board_detect
  473. ;;
  474. *"CPE510/520")
  475. name="cpe510"
  476. tplink_pharos_board_detect
  477. ;;
  478. *CPE830)
  479. name="cpe830"
  480. ;;
  481. *CPE870)
  482. name="cpe870"
  483. ;;
  484. *WBS210)
  485. name="wbs210"
  486. tplink_pharos_board_detect
  487. ;;
  488. *WBS510)
  489. name="wbs510"
  490. tplink_pharos_board_detect
  491. ;;
  492. *CR3000)
  493. name="cr3000"
  494. ;;
  495. *CR5000)
  496. name="cr5000"
  497. ;;
  498. *"DAP-2695 rev. A1")
  499. name="dap-2695-a1"
  500. ;;
  501. *"DB120 reference board")
  502. name="db120"
  503. ;;
  504. *"DGL-5500 rev. A1")
  505. name="dgl-5500-a1"
  506. ;;
  507. *"DHP-1565 rev. A1")
  508. name="dhp-1565-a1"
  509. ;;
  510. *"DIR-505 rev. A1")
  511. name="dir-505-a1"
  512. dir505_board_detect
  513. ;;
  514. *"DIR-600 rev. A1")
  515. name="dir-600-a1"
  516. ;;
  517. *"DIR-615 rev. E1")
  518. name="dir-615-e1"
  519. ;;
  520. *"DIR-615 rev. E4")
  521. name="dir-615-e4"
  522. ;;
  523. *"DIR-615 rev. I1")
  524. name="dir-615-i1"
  525. ;;
  526. *"DIR-825 rev. B1")
  527. name="dir-825-b1"
  528. ;;
  529. *"DIR-825 rev. C1")
  530. name="dir-825-c1"
  531. ;;
  532. *"DIR-835 rev. A1")
  533. name="dir-835-a1"
  534. ;;
  535. *"DIR-869 rev. A1")
  536. name="dir-869-a1"
  537. ;;
  538. *"dLAN Hotspot")
  539. name="dlan-hotspot"
  540. ;;
  541. *"dLAN pro 500 Wireless+")
  542. name="dlan-pro-500-wp"
  543. ;;
  544. *"dLAN pro 1200+ WiFi ac")
  545. name="dlan-pro-1200-ac"
  546. ;;
  547. *DR344)
  548. name="dr344"
  549. ;;
  550. *DR531)
  551. name="dr531"
  552. ;;
  553. *"Dragino v2")
  554. name="dragino2"
  555. ;;
  556. *"Domino Pi")
  557. name="gl-domino"
  558. ;;
  559. *"DW33D")
  560. name="dw33d"
  561. ;;
  562. *E2100L)
  563. name="e2100l"
  564. ;;
  565. *"EAP120")
  566. name="eap120"
  567. tplink_pharos_board_detect
  568. ;;
  569. *"EAP300 v2")
  570. name="eap300v2"
  571. ;;
  572. *EAP7660D)
  573. name="eap7660d"
  574. ;;
  575. *EL-M150)
  576. name="el-m150"
  577. ;;
  578. *EL-MINI)
  579. name="el-mini"
  580. ;;
  581. *"GL-CONNECT INET v1")
  582. name="gl-inet"
  583. gl_inet_board_detect
  584. ;;
  585. *"GL AR150")
  586. name="gl-ar150"
  587. ;;
  588. *"GL AR300")
  589. name="gl-ar300"
  590. ;;
  591. *"GL-AR300M")
  592. name="gl-ar300m"
  593. ;;
  594. *"GL-MIFI")
  595. name="gl-mifi"
  596. ;;
  597. *"EnGenius EPG5000")
  598. name="epg5000"
  599. ;;
  600. *"EnGenius ESR1750")
  601. name="esr1750"
  602. ;;
  603. *"EnGenius ESR900")
  604. name="esr900"
  605. ;;
  606. *JA76PF)
  607. name="ja76pf"
  608. ;;
  609. *JA76PF2)
  610. name="ja76pf2"
  611. ;;
  612. *"Bullet M")
  613. name="bullet-m"
  614. ubnt_xm_board_detect
  615. ;;
  616. *"Loco M XW")
  617. name="loco-m-xw"
  618. ;;
  619. *"Nanostation M")
  620. name="nanostation-m"
  621. ubnt_xm_board_detect
  622. ;;
  623. *"Nanostation M XW")
  624. name="nanostation-m-xw"
  625. ;;
  626. *JWAP003)
  627. name="jwap003"
  628. ;;
  629. *JWAP230)
  630. name="jwap230"
  631. ;;
  632. *"Hornet-UB")
  633. local size
  634. size=$(awk '/firmware/ { print $2 }' /proc/mtd)
  635. if [ "x$size" = "x00790000" ]; then
  636. name="hornet-ub"
  637. fi
  638. if [ "x$size" = "x00f90000" ]; then
  639. name="hornet-ub-x2"
  640. fi
  641. ;;
  642. *LS-SR71)
  643. name="ls-sr71"
  644. ;;
  645. *"MAC1200R")
  646. name="mc-mac1200r"
  647. ;;
  648. *"MiniBox V1.0")
  649. name="minibox-v1"
  650. ;;
  651. *MR12)
  652. name="mr12"
  653. ;;
  654. *MR16)
  655. name="mr16"
  656. ;;
  657. *MR18)
  658. name="mr18"
  659. ;;
  660. *MR600v2)
  661. name="mr600v2"
  662. ;;
  663. *MR1750)
  664. name="mr1750"
  665. ;;
  666. *MR1750v2)
  667. name="mr1750v2"
  668. ;;
  669. *MR600)
  670. name="mr600"
  671. ;;
  672. *MR900)
  673. name="mr900"
  674. ;;
  675. *MR900v2)
  676. name="mr900v2"
  677. ;;
  678. *"My Net N600")
  679. name="mynet-n600"
  680. ;;
  681. *"My Net N750")
  682. name="mynet-n750"
  683. ;;
  684. *"WD My Net Wi-Fi Range Extender")
  685. name="mynet-rext"
  686. ;;
  687. *MZK-W04NU)
  688. name="mzk-w04nu"
  689. ;;
  690. *MZK-W300NH)
  691. name="mzk-w300nh"
  692. ;;
  693. *"NBG460N/550N/550NH")
  694. name="nbg460n_550n_550nh"
  695. ;;
  696. *"Zyxel NBG6616")
  697. name="nbg6616"
  698. ;;
  699. *"Zyxel NBG6716")
  700. name="nbg6716"
  701. ;;
  702. *OM2P)
  703. name="om2p"
  704. ;;
  705. *OM2Pv2)
  706. name="om2pv2"
  707. ;;
  708. *OM2Pv4)
  709. name="om2pv4"
  710. ;;
  711. *"OM2P HS")
  712. name="om2p-hs"
  713. ;;
  714. *"OM2P HSv2")
  715. name="om2p-hsv2"
  716. ;;
  717. *"OM2P HSv3")
  718. name="om2p-hsv3"
  719. ;;
  720. *"OM2P HSv4")
  721. name="om2p-hsv4"
  722. ;;
  723. *"OM2P LC")
  724. name="om2p-lc"
  725. ;;
  726. *OM5P)
  727. name="om5p"
  728. ;;
  729. *"OM5P AN")
  730. name="om5p-an"
  731. ;;
  732. *"OM5P AC")
  733. name="om5p-ac"
  734. ;;
  735. *"OM5P ACv2")
  736. name="om5p-acv2"
  737. ;;
  738. *"OMY-X1")
  739. name="omy-x1"
  740. ;;
  741. *"OMY-G1")
  742. name="omy-g1"
  743. ;;
  744. *"Onion Omega")
  745. name="onion-omega"
  746. ;;
  747. *PB42)
  748. name="pb42"
  749. ;;
  750. *"PB44 reference board")
  751. name="pb44"
  752. ;;
  753. *"Qihoo 360 C301")
  754. name="qihoo-c301"
  755. ;;
  756. *"RE450")
  757. name="re450"
  758. ;;
  759. *"RouterBOARD 411/A/AH")
  760. name="rb-411"
  761. ;;
  762. *"RouterBOARD 411U")
  763. name="rb-411u"
  764. ;;
  765. *"RouterBOARD 433/AH")
  766. name="rb-433"
  767. ;;
  768. *"RouterBOARD 433UAH")
  769. name="rb-433u"
  770. ;;
  771. *"RouterBOARD 435G")
  772. name="rb-435g"
  773. ;;
  774. *"RouterBOARD 450")
  775. name="rb-450"
  776. ;;
  777. *"RouterBOARD 450G")
  778. name="rb-450g"
  779. ;;
  780. *"RouterBOARD 493/AH")
  781. name="rb-493"
  782. ;;
  783. *"RouterBOARD 493G")
  784. name="rb-493g"
  785. ;;
  786. *"RouterBOARD 750")
  787. name="rb-750"
  788. ;;
  789. *"RouterBOARD 750GL")
  790. name="rb-750gl"
  791. ;;
  792. *"RouterBOARD 751")
  793. name="rb-751"
  794. ;;
  795. *"RouterBOARD 751G")
  796. name="rb-751g"
  797. ;;
  798. *"RouterBOARD 911G-2HPnD")
  799. name="rb-911g-2hpnd"
  800. ;;
  801. *"RouterBOARD 911G-5HPnD")
  802. name="rb-911g-5hpnd"
  803. ;;
  804. *"RouterBOARD 911G-5HPacD")
  805. name="rb-911g-5hpacd"
  806. ;;
  807. *"RouterBOARD 912UAG-2HPnD")
  808. name="rb-912uag-2hpnd"
  809. ;;
  810. *"RouterBOARD 912UAG-5HPnD")
  811. name="rb-912uag-5hpnd"
  812. ;;
  813. *"RouterBOARD 941-2nD")
  814. name="rb-941-2nd"
  815. ;;
  816. *"RouterBOARD 951G-2HnD")
  817. name="rb-951g-2hnd"
  818. ;;
  819. *"RouterBOARD 951Ui-2HnD")
  820. name="rb-951ui-2hnd"
  821. ;;
  822. *"RouterBOARD 2011L")
  823. name="rb-2011l"
  824. ;;
  825. *"RouterBOARD 2011UAS")
  826. name="rb-2011uas"
  827. ;;
  828. *"RouterBOARD 2011UiAS")
  829. name="rb-2011uias"
  830. ;;
  831. *"RouterBOARD 2011UAS-2HnD")
  832. name="rb-2011uas-2hnd"
  833. ;;
  834. *"RouterBOARD 2011UiAS-2HnD")
  835. name="rb-2011uias-2hnd"
  836. ;;
  837. *"RouterBOARD SXT Lite2")
  838. name="rb-sxt2n"
  839. ;;
  840. *"RouterBOARD SXT Lite5")
  841. name="rb-sxt5n"
  842. ;;
  843. *"Rocket M")
  844. name="rocket-m"
  845. ubnt_xm_board_detect
  846. ;;
  847. *"Rocket M TI")
  848. name="rocket-m-ti"
  849. ;;
  850. *"Rocket M XW")
  851. name="rocket-m-xw"
  852. ;;
  853. *RouterStation)
  854. name="routerstation"
  855. ;;
  856. *"RouterStation Pro")
  857. name="routerstation-pro"
  858. ;;
  859. *RW2458N)
  860. name="rw2458n"
  861. ;;
  862. *"SMART-300")
  863. name="smart-300"
  864. ;;
  865. "Smart Electronics Black Swift board"*)
  866. name="bsb"
  867. ;;
  868. *"Telldus TellStick ZNet Lite")
  869. name="tellstick-znet-lite"
  870. ;;
  871. *SOM9331)
  872. name="som9331"
  873. ;;
  874. *SR3200)
  875. name="sr3200"
  876. ;;
  877. *TEW-632BRP)
  878. name="tew-632brp"
  879. ;;
  880. *TEW-673GRU)
  881. name="tew-673gru"
  882. ;;
  883. *TEW-712BR)
  884. name="tew-712br"
  885. ;;
  886. *TEW-732BR)
  887. name="tew-732br"
  888. ;;
  889. *TEW-823DRU)
  890. name="tew-823dru"
  891. ;;
  892. *"TL-WR1041N v2")
  893. name="tl-wr1041n-v2"
  894. ;;
  895. *TL-WR1043ND)
  896. name="tl-wr1043nd"
  897. ;;
  898. *"TL-WR1043ND v2")
  899. name="tl-wr1043nd-v2"
  900. ;;
  901. *"TL-WR1043ND v4")
  902. name="tl-wr1043nd-v4"
  903. ;;
  904. *TL-WR2543N*)
  905. name="tl-wr2543n"
  906. ;;
  907. *"DIR-615 rev. C1")
  908. name="dir-615-c1"
  909. ;;
  910. *TL-MR3020)
  911. name="tl-mr3020"
  912. ;;
  913. *TL-MR3040)
  914. name="tl-mr3040"
  915. ;;
  916. *"TL-MR3040 v2")
  917. name="tl-mr3040-v2"
  918. ;;
  919. *TL-MR3220)
  920. name="tl-mr3220"
  921. ;;
  922. *"TL-MR3220 v2")
  923. name="tl-mr3220-v2"
  924. ;;
  925. *TL-MR3420)
  926. name="tl-mr3420"
  927. ;;
  928. *"TL-MR3420 v2")
  929. name="tl-mr3420-v2"
  930. ;;
  931. *"TL-WA701ND v2")
  932. name="tl-wa701nd-v2"
  933. ;;
  934. *"TL-WA7210N v2")
  935. name="tl-wa7210n-v2"
  936. ;;
  937. *TL-WA750RE)
  938. name="tl-wa750re"
  939. ;;
  940. *"TL-WA7510N v1")
  941. name="tl-wa7510n"
  942. ;;
  943. *TL-WA850RE)
  944. name="tl-wa850re"
  945. ;;
  946. *TL-WA860RE)
  947. name="tl-wa860re"
  948. ;;
  949. *"TL-WA830RE v2")
  950. name="tl-wa830re-v2"
  951. ;;
  952. *"TL-WA801ND v2")
  953. name="tl-wa801nd-v2"
  954. ;;
  955. *"TL-WA801ND v3")
  956. name="tl-wa801nd-v3"
  957. ;;
  958. *"TL-WR802N v1")
  959. name="tl-wr802n-v1"
  960. ;;
  961. *TL-WA901ND)
  962. name="tl-wa901nd"
  963. ;;
  964. *"TL-WA901ND v2")
  965. name="tl-wa901nd-v2"
  966. ;;
  967. *"TL-WA901ND v3")
  968. name="tl-wa901nd-v3"
  969. ;;
  970. *"TL-WA901ND v4")
  971. name="tl-wa901nd-v4"
  972. ;;
  973. *"TL-WDR3320 v2")
  974. name="tl-wdr3320-v2"
  975. ;;
  976. *"TL-WDR3500")
  977. name="tl-wdr3500"
  978. ;;
  979. *"TL-WDR3600/4300/4310")
  980. name="tl-wdr4300"
  981. ;;
  982. *"TL-WDR4900 v2")
  983. name="tl-wdr4900-v2"
  984. ;;
  985. *"TL-WDR6500 v2")
  986. name="tl-wdr6500-v2"
  987. ;;
  988. *TL-WPA8630)
  989. name="tl-wpa8630"
  990. ;;
  991. *TL-WR741ND)
  992. name="tl-wr741nd"
  993. ;;
  994. *"TL-WR741ND v4")
  995. name="tl-wr741nd-v4"
  996. ;;
  997. *"TL-WR841N v1")
  998. name="tl-wr841n-v1"
  999. ;;
  1000. *"TL-WR841N/ND v7")
  1001. name="tl-wr841n-v7"
  1002. ;;
  1003. *"TL-WR841N/ND v8")
  1004. name="tl-wr841n-v8"
  1005. ;;
  1006. *"TL-WR841N/ND v9")
  1007. name="tl-wr841n-v9"
  1008. ;;
  1009. *"TL-WR841N/ND v11")
  1010. name="tl-wr841n-v11"
  1011. ;;
  1012. *"TL-WR842N/ND v2")
  1013. name="tl-wr842n-v2"
  1014. ;;
  1015. *"TL-WR842N/ND v3")
  1016. name="tl-wr842n-v3"
  1017. ;;
  1018. *TL-WR941ND)
  1019. name="tl-wr941nd"
  1020. ;;
  1021. *"TL-WR941N/ND v5")
  1022. name="tl-wr941nd-v5"
  1023. ;;
  1024. *"TL-WR941N/ND v6")
  1025. name="tl-wr941nd-v6"
  1026. ;;
  1027. *"TL-WR940N v4")
  1028. name="tl-wr940n-v4"
  1029. ;;
  1030. *"TL-WR703N v1")
  1031. name="tl-wr703n"
  1032. ;;
  1033. *"TL-WR710N v1")
  1034. name="tl-wr710n"
  1035. ;;
  1036. *"TL-WR720N"*)
  1037. name="tl-wr720n-v3"
  1038. ;;
  1039. *"TL-WR810N")
  1040. name="tl-wr810n"
  1041. ;;
  1042. *"TL-MR10U")
  1043. name="tl-mr10u"
  1044. ;;
  1045. *"TL-MR11U")
  1046. name="tl-mr11u"
  1047. ;;
  1048. *"TL-MR12U")
  1049. name="tl-mr12u"
  1050. ;;
  1051. *"TL-MR13U v1")
  1052. name="tl-mr13u"
  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. }