ramips 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #
  2. # Copyright (C) 2011-2012 OpenWrt.org
  3. #
  4. [ -e /etc/config/ubootenv ] && exit 0
  5. touch /etc/config/ubootenv
  6. . /lib/uboot-envtools.sh
  7. . /lib/functions.sh
  8. board=$(board_name)
  9. case "$board" in
  10. alfa-network,ac1200rm|\
  11. alfa-network,awusfree1|\
  12. alfa-network,quad-e4g|\
  13. alfa-network,r36m-e4g|\
  14. alfa-network,tube-e4g|\
  15. engenius,esr600h|\
  16. sitecom,wlr-4100-v1-002)
  17. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x1000"
  18. ;;
  19. allnet,all0256n-4m|\
  20. allnet,all0256n-8m|\
  21. allnet,all5002)
  22. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000"
  23. ;;
  24. ampedwireless,ally-00x19k|\
  25. ampedwireless,ally-r1900k)
  26. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000" "4"
  27. ;;
  28. buffalo,wsr-1166dhp|\
  29. buffalo,wsr-600dhp|\
  30. mediatek,linkit-smart-7688|\
  31. samknows,whitebox-v8|\
  32. xiaomi,mi-router-3g-v2|\
  33. xiaomi,mi-router-4a-gigabit|\
  34. xiaomi,mi-router-4c|\
  35. xiaomi,miwifi-3c|\
  36. xiaomi,miwifi-nano|\
  37. zbtlink,zbt-wg2626|\
  38. zte,mf283plus)
  39. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
  40. ;;
  41. hootoo,ht-tm05|\
  42. ravpower,rp-wd03)
  43. idx="$(find_mtd_index u-boot-env)"
  44. [ -n "$idx" ] && \
  45. ubootenv_add_uci_config "/dev/mtd$idx" "0x4000" "0x1000" "0x1000"
  46. ;;
  47. jcg,q20)
  48. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
  49. ;;
  50. linksys,ea6350-v4|\
  51. linksys,ea7300-v1|\
  52. linksys,ea7300-v2|\
  53. linksys,ea7500-v2|\
  54. linksys,ea8100-v1|\
  55. linksys,ea8100-v2|\
  56. xiaomi,mi-router-3g|\
  57. xiaomi,mi-router-3-pro|\
  58. xiaomi,mi-router-4|\
  59. xiaomi,mi-router-ac2100|\
  60. xiaomi,redmi-router-ac2100)
  61. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000"
  62. ;;
  63. zyxel,nr7101)
  64. idx="$(find_mtd_index Config)"
  65. [ -n "$idx" ] && \
  66. ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1000" "0x80000"
  67. ;;
  68. esac
  69. config_load ubootenv
  70. config_foreach ubootenv_add_app_config ubootenv
  71. exit 0