diff options
author | Felix Fietkau <nbd@openwrt.org> | 2016-01-03 14:48:13 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2016-01-03 14:48:13 +0000 |
commit | 8e85d7a8ad7c194cd86f2299a7cf1c15898927b4 (patch) | |
tree | f41473f299822f8b9a9c6891356928c7c1029059 /target | |
parent | 6ed31e2b5cefc350d8621236110dee22482cc719 (diff) | |
download | upstream-8e85d7a8ad7c194cd86f2299a7cf1c15898927b4.tar.gz upstream-8e85d7a8ad7c194cd86f2299a7cf1c15898927b4.tar.bz2 upstream-8e85d7a8ad7c194cd86f2299a7cf1c15898927b4.zip |
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@universe-factory.net>
Backport of r47538
git-svn-id: svn://svn.openwrt.org/openwrt/branches/chaos_calmer@48088 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target')
-rwxr-xr-x | target/linux/ar71xx/base-files/lib/ar71xx.sh | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh index af92b0175c..267e0b6725 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh @@ -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="$(echo -n "$model" | 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 |