ramips 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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-nano|\
  36. zbtlink,zbt-wg2626|\
  37. zte,mf283plus)
  38. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
  39. ;;
  40. hootoo,ht-tm05|\
  41. ravpower,rp-wd03)
  42. idx="$(find_mtd_index u-boot-env)"
  43. [ -n "$idx" ] && \
  44. ubootenv_add_uci_config "/dev/mtd$idx" "0x4000" "0x1000" "0x1000"
  45. ;;
  46. jcg,q20)
  47. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
  48. ;;
  49. linksys,ea7300-v1|\
  50. linksys,ea7300-v2|\
  51. linksys,ea7500-v2|\
  52. linksys,ea8100-v1|\
  53. linksys,ea8100-v2|\
  54. xiaomi,mi-router-3g|\
  55. xiaomi,mi-router-3-pro|\
  56. xiaomi,mi-router-4|\
  57. xiaomi,mi-router-ac2100|\
  58. xiaomi,redmi-router-ac2100)
  59. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000"
  60. ;;
  61. zyxel,nr7101)
  62. idx="$(find_mtd_index Config)"
  63. [ -n "$idx" ] && \
  64. ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1000" "0x80000"
  65. ;;
  66. esac
  67. config_load ubootenv
  68. config_foreach ubootenv_add_app_config ubootenv
  69. exit 0