ramips 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. yuncore,ax820)
  23. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000"
  24. ;;
  25. ampedwireless,ally-00x19k|\
  26. ampedwireless,ally-r1900k)
  27. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000" "4"
  28. ;;
  29. beeline,smartbox-giga)
  30. ubootenv_add_uci_config "/dev/mtd0" "0x80000" "0x1000" "0x20000"
  31. ;;
  32. buffalo,wsr-1166dhp|\
  33. buffalo,wsr-600dhp|\
  34. mediatek,linkit-smart-7688|\
  35. samknows,whitebox-v8|\
  36. xiaomi,mi-router-3g-v2|\
  37. xiaomi,mi-router-4a-gigabit|\
  38. xiaomi,mi-router-4c|\
  39. xiaomi,miwifi-3c|\
  40. xiaomi,miwifi-nano|\
  41. zbtlink,zbt-wg2626|\
  42. zte,mf283plus)
  43. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
  44. ;;
  45. hootoo,ht-tm05|\
  46. ravpower,rp-wd03)
  47. idx="$(find_mtd_index u-boot-env)"
  48. [ -n "$idx" ] && \
  49. ubootenv_add_uci_config "/dev/mtd$idx" "0x4000" "0x1000" "0x1000"
  50. ;;
  51. jcg,q20)
  52. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
  53. ;;
  54. beeline,smartbox-flash|\
  55. linksys,ea6350-v4|\
  56. linksys,ea7300-v1|\
  57. linksys,ea7300-v2|\
  58. linksys,ea7500-v2|\
  59. linksys,ea8100-v1|\
  60. linksys,ea8100-v2|\
  61. mts,wg430223|\
  62. xiaomi,mi-router-3g|\
  63. xiaomi,mi-router-3-pro|\
  64. xiaomi,mi-router-4|\
  65. xiaomi,mi-router-ac2100|\
  66. xiaomi,redmi-router-ac2100)
  67. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000"
  68. ;;
  69. zyxel,nr7101)
  70. idx="$(find_mtd_index Config)"
  71. [ -n "$idx" ] && \
  72. ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1000" "0x80000"
  73. ;;
  74. bolt,arion|\
  75. xiaomi,mi-router-cr6606|\
  76. xiaomi,mi-router-cr6608|\
  77. xiaomi,mi-router-cr6609)
  78. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x20000"
  79. ;;
  80. esac
  81. config_load ubootenv
  82. config_foreach ubootenv_add_app_config ubootenv
  83. exit 0