ramips 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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,epg600|\
  16. engenius,esr600h|\
  17. linksys,re7000|\
  18. sitecom,wlr-4100-v1-002|\
  19. zyxel,keenetic-lite-iii-a)
  20. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x1000"
  21. ;;
  22. arcadyan,we420223-99)
  23. ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x1000" "0x1000"
  24. ;;
  25. allnet,all0256n-4m|\
  26. allnet,all0256n-8m|\
  27. allnet,all5002|\
  28. yuncore,ax820)
  29. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000"
  30. ;;
  31. ampedwireless,ally-00x19k|\
  32. ampedwireless,ally-r1900k)
  33. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000" "4"
  34. ;;
  35. beeline,smartbox-giga|\
  36. beeline,smartbox-turbo|\
  37. etisalat,s3|\
  38. rostelecom,rt-sf-1)
  39. ubootenv_add_uci_config "/dev/mtd0" "0x80000" "0x1000" "0x20000"
  40. ;;
  41. buffalo,wsr-1166dhp|\
  42. buffalo,wsr-600dhp|\
  43. kroks,kndrt31r16|\
  44. kroks,kndrt31r19|\
  45. mediatek,linkit-smart-7688|\
  46. samknows,whitebox-v8|\
  47. xiaomi,mi-router-4c|\
  48. xiaomi,miwifi-nano|\
  49. zbtlink,zbt-wg2626|\
  50. zte,mf283plus)
  51. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
  52. ;;
  53. asus,rt-ax53u|\
  54. asus,rt-ax54|\
  55. belkin,rt1800|\
  56. h3c,tx1800-plus|\
  57. h3c,tx1801-plus|\
  58. h3c,tx1806|\
  59. jcg,q20|\
  60. linksys,e7350|\
  61. netgear,wax202|\
  62. zyxel,wsm20)
  63. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
  64. ;;
  65. haier,har-20s2u1|\
  66. sim,simax1800t)
  67. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
  68. ubootenv_add_uci_sys_config "/dev/mtd1" "0x40000" "0x40000" "0x20000"
  69. ;;
  70. hootoo,ht-tm05|\
  71. ravpower,rp-wd03)
  72. idx="$(find_mtd_index u-boot-env)"
  73. [ -n "$idx" ] && \
  74. ubootenv_add_uci_config "/dev/mtd$idx" "0x4000" "0x1000" "0x1000"
  75. ;;
  76. beeline,smartbox-flash|\
  77. linksys,ea6350-v4|\
  78. linksys,ea7300-v1|\
  79. linksys,ea7300-v2|\
  80. linksys,ea7500-v2|\
  81. linksys,ea8100-v1|\
  82. linksys,ea8100-v2|\
  83. mts,wg430223)
  84. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000"
  85. ;;
  86. snr,snr-cpe-me1|\
  87. snr,snr-cpe-me2-sfp|\
  88. snr,cpe-w4n-mt)
  89. idx="$(find_mtd_index uboot-env)"
  90. [ -n "$idx" ] && \
  91. ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1000" "0x1000"
  92. ;;
  93. tplink,ec330-g5u-v1)
  94. idx="$(find_mtd_index u-boot-env)"
  95. [ -n "$idx" ] && \
  96. ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1000" "0x20000"
  97. ;;
  98. xiaomi,mi-router-3g-v2|\
  99. xiaomi,mi-router-4a-gigabit|\
  100. xiaomi,miwifi-3c)
  101. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
  102. ubootenv_add_uci_sys_config "/dev/mtd2" "0x0" "0x4000" "0x10000"
  103. ;;
  104. xiaomi,mi-router-3g|\
  105. xiaomi,mi-router-3-pro|\
  106. xiaomi,mi-router-4|\
  107. xiaomi,mi-router-ac2100|\
  108. xiaomi,redmi-router-ac2100)
  109. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000"
  110. ubootenv_add_uci_sys_config "/dev/mtd2" "0x0" "0x4000" "0x20000"
  111. ;;
  112. zyxel,lte3301-plus)
  113. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x80000"
  114. ;;
  115. zyxel,nr7101)
  116. idx="$(find_mtd_index Config)"
  117. [ -n "$idx" ] && \
  118. ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1000" "0x80000"
  119. ;;
  120. bolt,arion|\
  121. xiaomi,mi-router-cr6606|\
  122. xiaomi,mi-router-cr6608|\
  123. xiaomi,mi-router-cr6609)
  124. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x20000"
  125. ;;
  126. esac
  127. config_load ubootenv
  128. config_foreach ubootenv_add_app_config
  129. exit 0