0022-ar71xx-avoid-AR71XX_MODEL-ending-with-a-space-on-some-TP-LINK-like-devices.patch 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. From: Matthias Schiffer <mschiffer@universe-factory.net>
  2. Date: Fri, 1 Apr 2016 23:19:16 +0200
  3. Subject: ar71xx: avoid AR71XX_MODEL ending with a space on some TP-LINK-like devices
  4. Instead of adding the space when combining $model and $hwver, add the space
  5. to the beginning of $hwver, so the resulting string won't end with a space
  6. when $hwver is set to the empty string.
  7. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
  8. Backport of r49106
  9. diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
  10. index e7b3cd2..180a075 100755
  11. --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
  12. +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
  13. @@ -133,7 +133,7 @@ tplink_board_detect() {
  14. hwid=$(tplink_get_hwid)
  15. mid=$(tplink_get_mid)
  16. hwver=${hwid:6:2}
  17. - hwver="v${hwver#0}"
  18. + hwver=" v${hwver#0}"
  19. case "$hwid" in
  20. "015000"*)
  21. @@ -196,8 +196,8 @@ tplink_board_detect() {
  22. "083000"*)
  23. model="TP-Link TL-WA830RE"
  24. - if [ "$hwver" = 'v10' ]; then
  25. - hwver='v1'
  26. + if [ "$hwver" = ' v10' ]; then
  27. + hwver=' v1'
  28. fi
  29. ;;
  30. "084100"*)
  31. @@ -296,7 +296,7 @@ tplink_board_detect() {
  32. ;;
  33. esac
  34. - AR71XX_MODEL="$model $hwver"
  35. + AR71XX_MODEL="$model$hwver"
  36. }
  37. tplink_pharos_get_model_string() {