ar71xx: another fix to wndr3700_board_detect
[openwrt/openwrt.git] / target / linux / ar71xx / base-files / lib / ar71xx.sh
index 8f3bf1d2b4178292cc1fa9a6229d7efc0396d2b2..678482eb156b77a7ea0a7aa5d8d3c698760da53b 100755 (executable)
@@ -37,8 +37,9 @@ wndr3700_board_detect() {
                machine="NETGEAR WNDR3700"
                ;;
        "33373031")
-               # Use awk to remove everything after the first zero byte
-               model="$(ar71xx_get_mtd_offset_size_format art 41 32 %c | LC_CTYPE=C awk -v 'FS=[^[:print:]]' '{print $1; exit}')"
+               model="$(ar71xx_get_mtd_offset_size_format art 41 32 %c)"
+               # Use awk to remove everything unprintable
+               model_stripped="$(ar71xx_get_mtd_offset_size_format art 41 32 %c | LC_CTYPE=C awk -v 'FS=[^[:print:]]' '{print $1; exit}')"
                case $model in
                $'\xff'*)
                        if [ "${model:24:1}" = 'N' ]; then
@@ -48,14 +49,14 @@ wndr3700_board_detect() {
                        fi
                        ;;
                '29763654+16+64'*)
-                       machine="NETGEAR ${model:14}"
+                       machine="NETGEAR ${model_stripped:14}"
                        ;;
                '29763654+16+128'*)
-                       machine="NETGEAR ${model:15}"
+                       machine="NETGEAR ${model_stripped:15}"
                        ;;
                *)
                        # Unknown ID
-                       machine="NETGEAR $model"
+                       machine="NETGEAR ${model_stripped}"
                esac
        esac
 
@@ -113,6 +114,9 @@ tplink_board_detect() {
        "044403"*)
                model="ANTMINER-S3"
                ;;
+       "44440101"*)
+               model="ANTROUTER-R1"
+               ;;
        "120000"*)
                model="MERCURY MAC1200R"
                ;;
@@ -122,7 +126,7 @@ tplink_board_detect() {
        "3C0002"*)
                model="MINIBOX_V1"
                ;;
-       "070300"*)
+       "070301"*)
                model="TP-Link TL-WR703N"
                ;;
        "071000"*)
@@ -359,6 +363,9 @@ ar71xx_board_detect() {
        *Antminer-S3)
                name="antminer-s3"
                ;;
+       *"Arduino Yun")
+               name="arduino-yun"
+               ;;
        *AP113)
                name="ap113"
                ;;
@@ -407,6 +414,12 @@ ar71xx_board_detect() {
        *AW-NR580)
                name="aw-nr580"
                ;;
+       *CAP324)
+               name="cap324"
+               ;;
+       *C-55)
+               name="c-55"
+               ;;
        *CAP4200AG)
                name="cap4200ag"
                ;;
@@ -417,6 +430,12 @@ ar71xx_board_detect() {
                name="cpe510"
                tplink_pharos_board_detect
                ;;
+       *CR3000)
+               name="cr3000"
+               ;;
+       *CR5000)
+               name="cr5000"
+               ;;
        *"DB120 reference board")
                name="db120"
                ;;
@@ -450,15 +469,24 @@ ar71xx_board_detect() {
        *"DIR-835 rev. A1")
                name="dir-835-a1"
                ;;
+       *"dLAN Hotspot")
+               name="dlan-hotspot"
+               ;;
        *"dLAN pro 500 Wireless+")
                name="dlan-pro-500-wp"
                ;;
        *"dLAN pro 1200+ WiFi ac")
                name="dlan-pro-1200-ac"
                ;;
+       *DR344)
+               name="dr344"
+               ;;
        *"Dragino v2")
                name="dragino2"
                ;;
+       *"Domino Pi")
+               name="gl-domino"
+               ;;
        *"EAP300 v2")
                name="eap300v2"
                ;;
@@ -475,6 +503,12 @@ ar71xx_board_detect() {
                name="gl-inet"
                gl_inet_board_detect
                ;;
+       *"GL AR150")
+               name="gl-ar150"
+               ;;
+       *"GL AR300")
+               name="gl-ar300"
+               ;;
        *"EnGenius EPG5000")
                name="epg5000"
                ;;
@@ -532,6 +566,9 @@ ar71xx_board_detect() {
        *MR16)
                name="mr16"
                ;;
+       *MR18)
+               name="mr18"
+               ;;
        *MR600v2)
                name="mr600v2"
                ;;
@@ -724,6 +761,9 @@ ar71xx_board_detect() {
        *TEW-732BR)
                name="tew-732br"
                ;;
+       *TEW-823DRU)
+               name="tew-823dru"
+               ;;
        *"TL-WR1041N v2")
                name="tl-wr1041n-v2"
                ;;