Changeset 47538


Ignore:
Timestamp:
2015-11-21T00:34:11+01:00 (20 months ago)
Author:
jow
Message:

ar71xx: fix wndr3700_board_detect for some NETGEAR WNDR3700v2 (again)

When fixing the model string for WNDR3700v2 which contain a model string
followed by 0xff in r46455, the match for other versions of the WNDR3700v2
which just contain lots of 0xff broke (as the 0xff $model is checked for
is stripped off).

Fix by stripping off non-printable characters only for the actual output
string, but not for the internal matching.

Signed-off-by: Matthias Schiffer <mschiffer@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/ar71xx/base-files/lib/ar71xx.sh

    r47451 r47538  
    3838                ;; 
    3939        "33373031") 
    40                 # Use awk to remove everything after the first zero byte 
    41                 model="$(ar71xx_get_mtd_offset_size_format art 41 32 %c | LC_CTYPE=C awk -v 'FS=[^[:print:]]' '{print $1; exit}')" 
     40                model="$(ar71xx_get_mtd_offset_size_format art 41 32 %c)" 
     41                # Use awk to remove everything unprintable 
     42                model_stripped="$(echo -n "$model" | LC_CTYPE=C awk -v 'FS=[^[:print:]]' '{print $1; exit}')" 
    4243                case $model in 
    4344                $'\xff'*) 
     
    4950                        ;; 
    5051                '29763654+16+64'*) 
    51                         machine="NETGEAR ${model:14}" 
     52                        machine="NETGEAR ${model_stripped:14}" 
    5253                        ;; 
    5354                '29763654+16+128'*) 
    54                         machine="NETGEAR ${model:15}" 
     55                        machine="NETGEAR ${model_stripped:15}" 
    5556                        ;; 
    5657                *) 
    5758                        # Unknown ID 
    58                         machine="NETGEAR $model" 
     59                        machine="NETGEAR ${model_stripped}" 
    5960                esac 
    6061        esac 
Note: See TracChangeset for help on using the changeset viewer.