ramips 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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-4c|\
  37. xiaomi,miwifi-nano|\
  38. zbtlink,zbt-wg2626|\
  39. zte,mf283plus)
  40. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
  41. ;;
  42. hootoo,ht-tm05|\
  43. ravpower,rp-wd03)
  44. idx="$(find_mtd_index u-boot-env)"
  45. [ -n "$idx" ] && \
  46. ubootenv_add_uci_config "/dev/mtd$idx" "0x4000" "0x1000" "0x1000"
  47. ;;
  48. jcg,q20)
  49. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
  50. ;;
  51. beeline,smartbox-flash|\
  52. linksys,ea6350-v4|\
  53. linksys,ea7300-v1|\
  54. linksys,ea7300-v2|\
  55. linksys,ea7500-v2|\
  56. linksys,ea8100-v1|\
  57. linksys,ea8100-v2|\
  58. mts,wg430223)
  59. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000"
  60. ;;
  61. xiaomi,mi-router-3g-v2|\
  62. xiaomi,mi-router-4a-gigabit|\
  63. xiaomi,miwifi-3c)
  64. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
  65. ubootenv_add_uci_sys_config "/dev/mtd2" "0x0" "0x4000" "0x10000"
  66. ;;
  67. xiaomi,mi-router-3g|\
  68. xiaomi,mi-router-3-pro|\
  69. xiaomi,mi-router-4|\
  70. xiaomi,mi-router-ac2100|\
  71. xiaomi,redmi-router-ac2100)
  72. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000"
  73. ubootenv_add_uci_sys_config "/dev/mtd2" "0x0" "0x4000" "0x20000"
  74. ;;
  75. zyxel,nr7101)
  76. idx="$(find_mtd_index Config)"
  77. [ -n "$idx" ] && \
  78. ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1000" "0x80000"
  79. ;;
  80. bolt,arion|\
  81. xiaomi,mi-router-cr6606|\
  82. xiaomi,mi-router-cr6608|\
  83. xiaomi,mi-router-cr6609)
  84. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x20000"
  85. ;;
  86. esac
  87. config_load ubootenv
  88. config_foreach ubootenv_add_app_config ubootenv
  89. exit 0