Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
ffbs-gluon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
darkbit
ffbs-gluon
Commits
692a7d52
Commit
692a7d52
authored
10 years ago
by
Matthias Schiffer
Browse files
Options
Downloads
Patches
Plain Diff
Add experimental fix for NETGEAR WNDR3700/3800 model string detection
parent
f4eb6504
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
patches/openwrt/0027-ar71xx-fix-model-string-detection-on-NETGEAR-WNDR3700-3800-WNDRMAC.patch
+52
-0
52 additions, 0 deletions
...l-string-detection-on-NETGEAR-WNDR3700-3800-WNDRMAC.patch
with
52 additions
and
0 deletions
patches/openwrt/0027-ar71xx-fix-model-string-detection-on-NETGEAR-WNDR3700-3800-WNDRMAC.patch
0 → 100644
+
52
−
0
View file @
692a7d52
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Sun, 15 Mar 2015 19:51:15 +0100
Subject: ar71xx: fix model string detection on NETGEAR WNDR3700/3800/WNDRMAC
There were a few issues with the existing code to detect the model string:
* Always using the string starting with byte 56 would cut off the W of WNDR when
the ID starts with 29763654+16+128 instead of 29763654+16+64
* The string contained garbage after the zero byte instead of cutting it off
after the zero (which wasn't always visible using busybox tools, but could
confuse other scripts)
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index ac7f787..f50a236 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -37,16 +37,28 @@
wndr3700_board_detect() {
machine="NETGEAR WNDR3700"
;;
"33373031")
- local model
- model=$(ar71xx_get_mtd_offset_size_format art 56 10 %c)
- if [ -z "$model" ] || [ "$model" = $'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff' ]; then
+ case "$(ar71xx_get_mtd_offset_size_format art 56 10 %c)" in
+ $'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff')
machine="NETGEAR WNDR3700v2"
- elif [ -z "$model" ] || [ "$model" = $'\xff\xff\xff\xff\xff\xff\xff\xff\xffN' ]; then
+ ;;
+ $'\xff\xff\xff\xff\xff\xff\xff\xff\xffN')
machine="NETGEAR WNDRMAC"
- else
- machine="NETGEAR $model"
- fi
- ;;
+ ;;
+ *)
+ # Use awk to remove everything after the first zero byte
+ model="$(ar71xx_get_mtd_offset_size_format art 41 32 %c | awk 'BEGIN{FS="[[:cntrl:]]"} {print $1; exit}')"
+ case $model in
+ '29763654+16+64'*)
+ machine="NETGEAR ${model:14}"
+ ;;
+ '29763654+16+128'*)
+ machine="NETGEAR ${model:15}"
+ ;;
+ *)
+ # Unknown ID
+ machine="NETGEAR $model"
+ esac
+ esac
esac
AR71XX_BOARD_NAME="$name"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment