ramips 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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. jcg,q20|\
  72. linksys,e7350|\
  73. netgear,eax12|\
  74. netgear,wax202|\
  75. zyxel,wsm20)
  76. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
  77. ;;
  78. haier,har-20s2u1|\
  79. sim,simax1800t)
  80. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
  81. ubootenv_add_uci_sys_config "/dev/mtd1" "0x40000" "0x40000" "0x20000"
  82. ;;
  83. hootoo,ht-tm05|\
  84. ravpower,rp-wd03)
  85. idx="$(find_mtd_index u-boot-env)"
  86. [ -n "$idx" ] && \
  87. ubootenv_add_uci_config "/dev/mtd$idx" "0x4000" "0x1000" "0x1000"
  88. ;;
  89. beeline,smartbox-flash|\
  90. linksys,ea6350-v4|\
  91. linksys,ea7300-v1|\
  92. linksys,ea7300-v2|\
  93. linksys,ea7500-v2|\
  94. linksys,ea8100-v1|\
  95. linksys,ea8100-v2|\
  96. mts,wg430223)
  97. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000"
  98. ;;
  99. snr,snr-cpe-me1|\
  100. snr,snr-cpe-me2-sfp|\
  101. snr,cpe-w4n-mt)
  102. idx="$(find_mtd_index uboot-env)"
  103. [ -n "$idx" ] && \
  104. ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1000" "0x1000"
  105. ;;
  106. xiaomi,miwifi-mini)
  107. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
  108. ubootenv_add_uci_sys_config "/dev/mtd9" "0x0" "0x4000" "0x10000"
  109. ;;
  110. xiaomi,mi-router-3g-v2|\
  111. xiaomi,mi-router-4a-gigabit|\
  112. xiaomi,miwifi-3c)
  113. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
  114. ubootenv_add_uci_sys_config "/dev/mtd2" "0x0" "0x4000" "0x10000"
  115. ;;
  116. xiaomi,mi-router-3g|\
  117. xiaomi,mi-router-3-pro|\
  118. xiaomi,mi-router-4|\
  119. xiaomi,mi-router-ac2100|\
  120. xiaomi,redmi-router-ac2100)
  121. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000"
  122. ubootenv_add_uci_sys_config "/dev/mtd2" "0x0" "0x4000" "0x20000"
  123. ;;
  124. zyxel,lte3301-plus)
  125. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x80000"
  126. ;;
  127. zyxel,lte5398-m904|\
  128. zyxel,nr7101)
  129. idx="$(find_mtd_index Config)"
  130. [ -n "$idx" ] && \
  131. ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1000" "0x80000"
  132. ;;
  133. bolt,arion|\
  134. xiaomi,mi-router-cr6606|\
  135. xiaomi,mi-router-cr6608|\
  136. xiaomi,mi-router-cr6609)
  137. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x20000"
  138. ;;
  139. esac
  140. config_load ubootenv
  141. config_foreach ubootenv_add_app_config
  142. exit 0