ramips 3.6 KB

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