aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2016-01-03 14:48:17 +0000
committerFelix Fietkau <nbd@openwrt.org>2016-01-03 14:48:17 +0000
commit31120eb1887ce4410a44cfb4f3135271860afd2c (patch)
treeb5f1e9d5a09477c2decd4551c74392bbd5090bad /target/linux
parent8e85d7a8ad7c194cd86f2299a7cf1c15898927b4 (diff)
downloadupstream-31120eb1887ce4410a44cfb4f3135271860afd2c.tar.gz
upstream-31120eb1887ce4410a44cfb4f3135271860afd2c.tar.bz2
upstream-31120eb1887ce4410a44cfb4f3135271860afd2c.zip
ar71xx: another fix to wndr3700_board_detect
My last bugfix (r47538) introduced a new bug in wndr3700_board_detect (again...). Assigning the result of ar71xx_get_mtd_offset_size_format to the model variable before stripping of garbage using awk will cause all NUL bytes to be removed before awk is applied, leading to model strings like "NETGEAR WNDRMACv2NETGEAR", where a NUL byte after the v2 is supposed to terminate the string. Fix by calling ar71xx_get_mtd_offset_size_format twice, once piping to awk directly. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net> Backport of r48075 git-svn-id: svn://svn.openwrt.org/openwrt/branches/chaos_calmer@48089 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux')
-rwxr-xr-xtarget/linux/ar71xx/base-files/lib/ar71xx.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 267e0b6725..0b2857d8b3 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -39,7 +39,7 @@ wndr3700_board_detect() {
"33373031")
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}')"
+ 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