ar71xx.sh 19 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264
  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 AR300")
  583. name="gl-ar300"
  584. ;;
  585. *"GL-AR300M")
  586. name="gl-ar300m"
  587. ;;
  588. *"GL-MIFI")
  589. name="gl-mifi"
  590. ;;
  591. *"EnGenius EPG5000")
  592. name="epg5000"
  593. ;;
  594. *"EnGenius ESR1750")
  595. name="esr1750"
  596. ;;
  597. *"EnGenius ESR900")
  598. name="esr900"
  599. ;;
  600. *JA76PF)
  601. name="ja76pf"
  602. ;;
  603. *JA76PF2)
  604. name="ja76pf2"
  605. ;;
  606. *"Bullet M")
  607. name="bullet-m"
  608. ubnt_xm_board_detect
  609. ;;
  610. *"Loco M XW")
  611. name="loco-m-xw"
  612. ;;
  613. *"Nanostation M")
  614. name="nanostation-m"
  615. ubnt_xm_board_detect
  616. ;;
  617. *"Nanostation M XW")
  618. name="nanostation-m-xw"
  619. ;;
  620. *JWAP003)
  621. name="jwap003"
  622. ;;
  623. *JWAP230)
  624. name="jwap230"
  625. ;;
  626. *"Hornet-UB")
  627. local size
  628. size=$(awk '/firmware/ { print $2 }' /proc/mtd)
  629. if [ "x$size" = "x00790000" ]; then
  630. name="hornet-ub"
  631. fi
  632. if [ "x$size" = "x00f90000" ]; then
  633. name="hornet-ub-x2"
  634. fi
  635. ;;
  636. *LS-SR71)
  637. name="ls-sr71"
  638. ;;
  639. *"MAC1200R")
  640. name="mc-mac1200r"
  641. ;;
  642. *"MiniBox V1.0")
  643. name="minibox-v1"
  644. ;;
  645. *MR12)
  646. name="mr12"
  647. ;;
  648. *MR16)
  649. name="mr16"
  650. ;;
  651. *MR18)
  652. name="mr18"
  653. ;;
  654. *MR600v2)
  655. name="mr600v2"
  656. ;;
  657. *MR1750)
  658. name="mr1750"
  659. ;;
  660. *MR1750v2)
  661. name="mr1750v2"
  662. ;;
  663. *MR600)
  664. name="mr600"
  665. ;;
  666. *MR900)
  667. name="mr900"
  668. ;;
  669. *MR900v2)
  670. name="mr900v2"
  671. ;;
  672. *"My Net N600")
  673. name="mynet-n600"
  674. ;;
  675. *"My Net N750")
  676. name="mynet-n750"
  677. ;;
  678. *"WD My Net Wi-Fi Range Extender")
  679. name="mynet-rext"
  680. ;;
  681. *MZK-W04NU)
  682. name="mzk-w04nu"
  683. ;;
  684. *MZK-W300NH)
  685. name="mzk-w300nh"
  686. ;;
  687. *"NBG460N/550N/550NH")
  688. name="nbg460n_550n_550nh"
  689. ;;
  690. *"Zyxel NBG6616")
  691. name="nbg6616"
  692. ;;
  693. *"Zyxel NBG6716")
  694. name="nbg6716"
  695. ;;
  696. *OM2P)
  697. name="om2p"
  698. ;;
  699. *OM2Pv2)
  700. name="om2pv2"
  701. ;;
  702. *OM2Pv4)
  703. name="om2pv4"
  704. ;;
  705. *"OM2P HS")
  706. name="om2p-hs"
  707. ;;
  708. *"OM2P HSv2")
  709. name="om2p-hsv2"
  710. ;;
  711. *"OM2P HSv3")
  712. name="om2p-hsv3"
  713. ;;
  714. *"OM2P HSv4")
  715. name="om2p-hsv4"
  716. ;;
  717. *"OM2P LC")
  718. name="om2p-lc"
  719. ;;
  720. *OM5P)
  721. name="om5p"
  722. ;;
  723. *"OM5P AN")
  724. name="om5p-an"
  725. ;;
  726. *"OM5P AC")
  727. name="om5p-ac"
  728. ;;
  729. *"OM5P ACv2")
  730. name="om5p-acv2"
  731. ;;
  732. *"OMY-X1")
  733. name="omy-x1"
  734. ;;
  735. *"OMY-G1")
  736. name="omy-g1"
  737. ;;
  738. *"Onion Omega")
  739. name="onion-omega"
  740. ;;
  741. *PB42)
  742. name="pb42"
  743. ;;
  744. *"PB44 reference board")
  745. name="pb44"
  746. ;;
  747. *"Qihoo 360 C301")
  748. name="qihoo-c301"
  749. ;;
  750. *"RE450")
  751. name="re450"
  752. ;;
  753. *"RouterBOARD 411/A/AH")
  754. name="rb-411"
  755. ;;
  756. *"RouterBOARD 411U")
  757. name="rb-411u"
  758. ;;
  759. *"RouterBOARD 433/AH")
  760. name="rb-433"
  761. ;;
  762. *"RouterBOARD 433UAH")
  763. name="rb-433u"
  764. ;;
  765. *"RouterBOARD 435G")
  766. name="rb-435g"
  767. ;;
  768. *"RouterBOARD 450")
  769. name="rb-450"
  770. ;;
  771. *"RouterBOARD 450G")
  772. name="rb-450g"
  773. ;;
  774. *"RouterBOARD 493/AH")
  775. name="rb-493"
  776. ;;
  777. *"RouterBOARD 493G")
  778. name="rb-493g"
  779. ;;
  780. *"RouterBOARD 750")
  781. name="rb-750"
  782. ;;
  783. *"RouterBOARD 750GL")
  784. name="rb-750gl"
  785. ;;
  786. *"RouterBOARD 751")
  787. name="rb-751"
  788. ;;
  789. *"RouterBOARD 751G")
  790. name="rb-751g"
  791. ;;
  792. *"RouterBOARD 911G-2HPnD")
  793. name="rb-911g-2hpnd"
  794. ;;
  795. *"RouterBOARD 911G-5HPnD")
  796. name="rb-911g-5hpnd"
  797. ;;
  798. *"RouterBOARD 911G-5HPacD")
  799. name="rb-911g-5hpacd"
  800. ;;
  801. *"RouterBOARD 912UAG-2HPnD")
  802. name="rb-912uag-2hpnd"
  803. ;;
  804. *"RouterBOARD 912UAG-5HPnD")
  805. name="rb-912uag-5hpnd"
  806. ;;
  807. *"RouterBOARD 941-2nD")
  808. name="rb-941-2nd"
  809. ;;
  810. *"RouterBOARD 951G-2HnD")
  811. name="rb-951g-2hnd"
  812. ;;
  813. *"RouterBOARD 951Ui-2HnD")
  814. name="rb-951ui-2hnd"
  815. ;;
  816. *"RouterBOARD 2011L")
  817. name="rb-2011l"
  818. ;;
  819. *"RouterBOARD 2011UAS")
  820. name="rb-2011uas"
  821. ;;
  822. *"RouterBOARD 2011UiAS")
  823. name="rb-2011uias"
  824. ;;
  825. *"RouterBOARD 2011UAS-2HnD")
  826. name="rb-2011uas-2hnd"
  827. ;;
  828. *"RouterBOARD 2011UiAS-2HnD")
  829. name="rb-2011uias-2hnd"
  830. ;;
  831. *"RouterBOARD SXT Lite2")
  832. name="rb-sxt2n"
  833. ;;
  834. *"RouterBOARD SXT Lite5")
  835. name="rb-sxt5n"
  836. ;;
  837. *"Rocket M")
  838. name="rocket-m"
  839. ubnt_xm_board_detect
  840. ;;
  841. *"Rocket M TI")
  842. name="rocket-m-ti"
  843. ;;
  844. *"Rocket M XW")
  845. name="rocket-m-xw"
  846. ;;
  847. *RouterStation)
  848. name="routerstation"
  849. ;;
  850. *"RouterStation Pro")
  851. name="routerstation-pro"
  852. ;;
  853. *RW2458N)
  854. name="rw2458n"
  855. ;;
  856. *"SMART-300")
  857. name="smart-300"
  858. ;;
  859. "Smart Electronics Black Swift board"*)
  860. name="bsb"
  861. ;;
  862. *"Telldus TellStick ZNet Lite")
  863. name="tellstick-znet-lite"
  864. ;;
  865. *SOM9331)
  866. name="som9331"
  867. ;;
  868. *SR3200)
  869. name="sr3200"
  870. ;;
  871. *TEW-632BRP)
  872. name="tew-632brp"
  873. ;;
  874. *TEW-673GRU)
  875. name="tew-673gru"
  876. ;;
  877. *TEW-712BR)
  878. name="tew-712br"
  879. ;;
  880. *TEW-732BR)
  881. name="tew-732br"
  882. ;;
  883. *TEW-823DRU)
  884. name="tew-823dru"
  885. ;;
  886. *"TL-WR1041N v2")
  887. name="tl-wr1041n-v2"
  888. ;;
  889. *TL-WR1043ND)
  890. name="tl-wr1043nd"
  891. ;;
  892. *"TL-WR1043ND v2")
  893. name="tl-wr1043nd-v2"
  894. ;;
  895. *"TL-WR1043ND v4")
  896. name="tl-wr1043nd-v4"
  897. ;;
  898. *TL-WR2543N*)
  899. name="tl-wr2543n"
  900. ;;
  901. *"DIR-615 rev. C1")
  902. name="dir-615-c1"
  903. ;;
  904. *TL-MR3020)
  905. name="tl-mr3020"
  906. ;;
  907. *TL-MR3040)
  908. name="tl-mr3040"
  909. ;;
  910. *"TL-MR3040 v2")
  911. name="tl-mr3040-v2"
  912. ;;
  913. *TL-MR3220)
  914. name="tl-mr3220"
  915. ;;
  916. *"TL-MR3220 v2")
  917. name="tl-mr3220-v2"
  918. ;;
  919. *TL-MR3420)
  920. name="tl-mr3420"
  921. ;;
  922. *"TL-MR3420 v2")
  923. name="tl-mr3420-v2"
  924. ;;
  925. *"TL-WA701ND v2")
  926. name="tl-wa701nd-v2"
  927. ;;
  928. *"TL-WA7210N v2")
  929. name="tl-wa7210n-v2"
  930. ;;
  931. *TL-WA750RE)
  932. name="tl-wa750re"
  933. ;;
  934. *"TL-WA7510N v1")
  935. name="tl-wa7510n"
  936. ;;
  937. *TL-WA850RE)
  938. name="tl-wa850re"
  939. ;;
  940. *TL-WA860RE)
  941. name="tl-wa860re"
  942. ;;
  943. *"TL-WA830RE v2")
  944. name="tl-wa830re-v2"
  945. ;;
  946. *"TL-WA801ND v2")
  947. name="tl-wa801nd-v2"
  948. ;;
  949. *"TL-WA801ND v3")
  950. name="tl-wa801nd-v3"
  951. ;;
  952. *"TL-WR802N v1")
  953. name="tl-wr802n-v1"
  954. ;;
  955. *TL-WA901ND)
  956. name="tl-wa901nd"
  957. ;;
  958. *"TL-WA901ND v2")
  959. name="tl-wa901nd-v2"
  960. ;;
  961. *"TL-WA901ND v3")
  962. name="tl-wa901nd-v3"
  963. ;;
  964. *"TL-WA901ND v4")
  965. name="tl-wa901nd-v4"
  966. ;;
  967. *"TL-WDR3320 v2")
  968. name="tl-wdr3320-v2"
  969. ;;
  970. *"TL-WDR3500")
  971. name="tl-wdr3500"
  972. ;;
  973. *"TL-WDR3600/4300/4310")
  974. name="tl-wdr4300"
  975. ;;
  976. *"TL-WDR4900 v2")
  977. name="tl-wdr4900-v2"
  978. ;;
  979. *"TL-WDR6500 v2")
  980. name="tl-wdr6500-v2"
  981. ;;
  982. *TL-WPA8630)
  983. name="tl-wpa8630"
  984. ;;
  985. *TL-WR741ND)
  986. name="tl-wr741nd"
  987. ;;
  988. *"TL-WR741ND v4")
  989. name="tl-wr741nd-v4"
  990. ;;
  991. *"TL-WR841N v1")
  992. name="tl-wr841n-v1"
  993. ;;
  994. *"TL-WR841N/ND v7")
  995. name="tl-wr841n-v7"
  996. ;;
  997. *"TL-WR841N/ND v8")
  998. name="tl-wr841n-v8"
  999. ;;
  1000. *"TL-WR841N/ND v9")
  1001. name="tl-wr841n-v9"
  1002. ;;
  1003. *"TL-WR841N/ND v11")
  1004. name="tl-wr841n-v11"
  1005. ;;
  1006. *"TL-WR842N/ND v2")
  1007. name="tl-wr842n-v2"
  1008. ;;
  1009. *"TL-WR842N/ND v3")
  1010. name="tl-wr842n-v3"
  1011. ;;
  1012. *TL-WR941ND)
  1013. name="tl-wr941nd"
  1014. ;;
  1015. *"TL-WR941N/ND v5")
  1016. name="tl-wr941nd-v5"
  1017. ;;
  1018. *"TL-WR941N/ND v6")
  1019. name="tl-wr941nd-v6"
  1020. ;;
  1021. *"TL-WR940N v4")
  1022. name="tl-wr940n-v4"
  1023. ;;
  1024. *"TL-WR703N v1")
  1025. name="tl-wr703n"
  1026. ;;
  1027. *"TL-WR710N v1")
  1028. name="tl-wr710n"
  1029. ;;
  1030. *"TL-WR720N"*)
  1031. name="tl-wr720n-v3"
  1032. ;;
  1033. *"TL-WR810N")
  1034. name="tl-wr810n"
  1035. ;;
  1036. *"TL-MR10U")
  1037. name="tl-mr10u"
  1038. ;;
  1039. *"TL-MR11U")
  1040. name="tl-mr11u"
  1041. ;;
  1042. *"TL-MR12U")
  1043. name="tl-mr12u"
  1044. ;;
  1045. *"TL-MR13U v1")
  1046. name="tl-mr13u"
  1047. ;;
  1048. *"Think Penguin Mini Router")
  1049. name="tpe-r1100"
  1050. ;;
  1051. *"Tube2H")
  1052. name="tube2h"
  1053. ;;
  1054. *UniFi)
  1055. name="unifi"
  1056. ;;
  1057. *"UniFi-AC-LITE")
  1058. name="unifiac-lite"
  1059. ;;
  1060. *"UniFi-AC-PRO")
  1061. name="unifiac-pro"
  1062. ;;
  1063. *"UniFi AP Pro")
  1064. name="uap-pro"
  1065. ;;
  1066. "WeIO"*)
  1067. name="weio"
  1068. ;;
  1069. *WHR-G301N)
  1070. name="whr-g301n"
  1071. ;;
  1072. *WHR-HP-GN)
  1073. name="whr-hp-gn"
  1074. ;;
  1075. *WLAE-AG300N)
  1076. name="wlae-ag300n"
  1077. ;;
  1078. *"UniFiAP Outdoor")
  1079. name="unifi-outdoor"
  1080. ;;
  1081. *"UniFiAP Outdoor+")
  1082. name="unifi-outdoor-plus"
  1083. ;;
  1084. *WP543)
  1085. name="wp543"
  1086. ;;
  1087. *WPE72)
  1088. name="wpe72"
  1089. ;;
  1090. *WPJ342)
  1091. name="wpj342"
  1092. ;;
  1093. *WPJ344)
  1094. name="wpj344"
  1095. ;;
  1096. *WPJ531)
  1097. name="wpj531"
  1098. ;;
  1099. *WPJ558)
  1100. name="wpj558"
  1101. ;;
  1102. *WNDAP360)
  1103. name="wndap360"
  1104. ;;
  1105. *"WNDR3700/WNDR3800/WNDRMAC")
  1106. wndr3700_board_detect "$machine"
  1107. ;;
  1108. *"R6100")
  1109. name="r6100"
  1110. ;;
  1111. *"WNDR3700v4")
  1112. name="wndr3700v4"
  1113. ;;
  1114. *"WNDR4300")
  1115. name="wndr4300"
  1116. ;;
  1117. *"WNR2000 V4")
  1118. name="wnr2000-v4"
  1119. ;;
  1120. *"WNR2000 V3")
  1121. name="wnr2000-v3"
  1122. ;;
  1123. *WNR2000)
  1124. name="wnr2000"
  1125. ;;
  1126. *WNR2200)
  1127. name="wnr2200"
  1128. ;;
  1129. *"WNR612 V2")
  1130. name="wnr612-v2"
  1131. ;;
  1132. *"WNR1000 V2")
  1133. name="wnr1000-v2"
  1134. ;;
  1135. *WPN824N)
  1136. name="wpn824n"
  1137. ;;
  1138. *WRT160NL)
  1139. name="wrt160nl"
  1140. ;;
  1141. *WRT400N)
  1142. name="wrt400n"
  1143. ;;
  1144. *"WRTnode2Q board")
  1145. name="wrtnode2q"
  1146. ;;
  1147. *"WZR-450HP2")
  1148. name="wzr-450hp2"
  1149. ;;
  1150. *"WZR-HP-AG300H/WZR-600DHP")
  1151. name="wzr-hp-ag300h"
  1152. ;;
  1153. *WZR-HP-G300NH)
  1154. name="wzr-hp-g300nh"
  1155. ;;
  1156. *WZR-HP-G450H)
  1157. name="wzr-hp-g450h"
  1158. ;;
  1159. *WZR-HP-G300NH2)
  1160. name="wzr-hp-g300nh2"
  1161. ;;
  1162. *WHR-HP-G300N)
  1163. name="whr-hp-g300n"
  1164. ;;
  1165. *XD3200)
  1166. name="xd3200"
  1167. ;;
  1168. *Z1)
  1169. name="z1"
  1170. ;;
  1171. *ZBT-WE1526)
  1172. name="zbt-we1526"
  1173. ;;
  1174. *ZCN-1523H-2)
  1175. name="zcn-1523h-2"
  1176. ;;
  1177. *ZCN-1523H-5)
  1178. name="zcn-1523h-5"
  1179. ;;
  1180. *EmbWir-Dorin)
  1181. name="ew-dorin"
  1182. ;;
  1183. *EmbWir-Dorin-Router)
  1184. name="ew-dorin-router"
  1185. ;;
  1186. "8devices Carambola2"*)
  1187. name="carambola2"
  1188. ;;
  1189. *"Sitecom WLR-8100")
  1190. name="wlr8100"
  1191. ;;
  1192. *"BHU BXU2000n-2 rev. A1")
  1193. name="bxu2000n-2-a1"
  1194. ;;
  1195. *"HiWiFi HC6361")
  1196. name="hiwifi-hc6361"
  1197. ;;
  1198. esac
  1199. [ -z "$AR71XX_MODEL" ] && [ "${machine:0:8}" = 'TP-LINK ' ] && \
  1200. tplink_board_detect "$machine"
  1201. [ -z "$name" ] && name="unknown"
  1202. [ -z "$AR71XX_BOARD_NAME" ] && AR71XX_BOARD_NAME="$name"
  1203. [ -z "$AR71XX_MODEL" ] && AR71XX_MODEL="$machine"
  1204. [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
  1205. echo "$AR71XX_BOARD_NAME" > /tmp/sysinfo/board_name
  1206. echo "$AR71XX_MODEL" > /tmp/sysinfo/model
  1207. }
  1208. ar71xx_board_name() {
  1209. local name
  1210. [ -f /tmp/sysinfo/board_name ] && name=$(cat /tmp/sysinfo/board_name)
  1211. [ -z "$name" ] && name="unknown"
  1212. echo "$name"
  1213. }