ramips 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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,ea7300-v1|\
  51. linksys,ea7300-v2|\
  52. linksys,ea7500-v2|\
  53. linksys,ea8100-v1|\
  54. linksys,ea8100-v2|\
  55. xiaomi,mi-router-3g|\
  56. xiaomi,mi-router-3-pro|\
  57. xiaomi,mi-router-4|\
  58. xiaomi,mi-router-ac2100|\
  59. xiaomi,redmi-router-ac2100)
  60. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000"
  61. ;;
  62. zyxel,nr7101)
  63. idx="$(find_mtd_index Config)"
  64. [ -n "$idx" ] && \
  65. ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1000" "0x80000"
  66. ;;
  67. esac
  68. config_load ubootenv
  69. config_foreach ubootenv_add_app_config ubootenv
  70. exit 0