0024-ar71xx-detect-GL.iNet-model.patch 1007 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. From: Matthias Schiffer <mschiffer@universe-factory.net>
  2. Date: Fri, 13 Mar 2015 11:59:58 +0100
  3. Subject: ar71xx: detect GL.iNet model
  4. There are two versions of the GL.iNet, the 6408A and the 6416A. The only
  5. difference is the flash size.
  6. diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
  7. index 61a7936..a698ce5 100755
  8. --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
  9. +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
  10. @@ -262,6 +262,19 @@ tplink_pharos_board_detect() {
  11. [ -n "$model" ] && AR71XX_MODEL="$model v$2"
  12. }
  13. +gl_inet_board_detect() {
  14. + local size="$(mtd_get_part_size 'firmware')"
  15. +
  16. + case "$size" in
  17. + 8192000)
  18. + AR71XX_MODEL='GL-iNet 6408A v1'
  19. + ;;
  20. + 16580608)
  21. + AR71XX_MODEL='GL-iNet 6416A v1'
  22. + ;;
  23. + esac
  24. +}
  25. +
  26. ar71xx_board_detect() {
  27. local machine
  28. local name
  29. @@ -380,6 +393,7 @@ ar71xx_board_detect() {
  30. ;;
  31. *"GL-CONNECT INET v1")
  32. name="gl-inet"
  33. + gl_inet_board_detect
  34. ;;
  35. *"EnGenius ESR1750")
  36. name="esr1750"