0083-ar71xx-simplify-model-detection-for-TP-Link-Pharos-devices.patch 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. From: Matthias Schiffer <mschiffer@universe-factory.net>
  2. Date: Sun, 11 Dec 2016 17:54:49 +0100
  3. Subject: ar71xx: simplify model detection for TP-Link Pharos devices
  4. This also makes the detection more flexible, as it doesn't need to check
  5. for each model explicitly.
  6. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
  7. diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
  8. index 83be32908027ce03269fbf382ef986eb91342016..5e93ba628e4644eedbad98cf7a7766775a088f14 100755
  9. --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
  10. +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
  11. @@ -329,24 +329,10 @@ tplink_pharos_get_model_string() {
  12. tplink_pharos_board_detect() {
  13. local model_string="$(tplink_pharos_get_model_string | tr -d '\r')"
  14. local oIFS="$IFS"; IFS=":"; set -- $model_string; IFS="$oIFS"
  15. - local model
  16. - case "$1" in
  17. - 'CPE210(TP-LINK|UN|N300-2)')
  18. - model='TP-Link CPE210'
  19. - ;;
  20. - 'CPE220(TP-LINK|UN|N300-2)')
  21. - model='TP-Link CPE220'
  22. - ;;
  23. - 'CPE510(TP-LINK|UN|N300-5)')
  24. - model='TP-Link CPE510'
  25. - ;;
  26. - 'CPE520(TP-LINK|UN|N300-5)')
  27. - model='TP-Link CPE520'
  28. - ;;
  29. - esac
  30. + local model="${1%%\(*}"
  31. - [ -n "$model" ] && AR71XX_MODEL="$model v$2"
  32. + AR71XX_MODEL="TP-Link $model v$2"
  33. }
  34. gl_inet_board_detect() {