ramips 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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-sf-1)
  43. ubootenv_add_uci_config "/dev/mtd0" "0x80000" "0x1000" "0x20000"
  44. ;;
  45. beeline,smartbox-pro|\
  46. tplink,ec330-g5u-v1|\
  47. wifire,s1500-nbn)
  48. idx="$(find_mtd_index u-boot-env)"
  49. [ -n "$idx" ] && \
  50. ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1000" "0x20000"
  51. ;;
  52. buffalo,wsr-1166dhp|\
  53. buffalo,wsr-600dhp|\
  54. kroks,kndrt31r16|\
  55. kroks,kndrt31r19|\
  56. mediatek,linkit-smart-7688|\
  57. samknows,whitebox-v8|\
  58. xiaomi,mi-router-4c|\
  59. xiaomi,miwifi-nano|\
  60. zbtlink,zbt-wg2626|\
  61. zte,mf283plus)
  62. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
  63. ;;
  64. asus,rt-ax53u|\
  65. asus,rt-ax54|\
  66. belkin,rt1800|\
  67. h3c,tx1800-plus|\
  68. h3c,tx1801-plus|\
  69. h3c,tx1806|\
  70. jcg,q20|\
  71. linksys,e7350|\
  72. netgear,eax12|\
  73. netgear,wax202|\
  74. zyxel,wsm20)
  75. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
  76. ;;
  77. haier,har-20s2u1|\
  78. sim,simax1800t)
  79. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
  80. ubootenv_add_uci_sys_config "/dev/mtd1" "0x40000" "0x40000" "0x20000"
  81. ;;
  82. hootoo,ht-tm05|\
  83. ravpower,rp-wd03)
  84. idx="$(find_mtd_index u-boot-env)"
  85. [ -n "$idx" ] && \
  86. ubootenv_add_uci_config "/dev/mtd$idx" "0x4000" "0x1000" "0x1000"
  87. ;;
  88. beeline,smartbox-flash|\
  89. linksys,ea6350-v4|\
  90. linksys,ea7300-v1|\
  91. linksys,ea7300-v2|\
  92. linksys,ea7500-v2|\
  93. linksys,ea8100-v1|\
  94. linksys,ea8100-v2|\
  95. mts,wg430223)
  96. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000"
  97. ;;
  98. snr,snr-cpe-me1|\
  99. snr,snr-cpe-me2-sfp|\
  100. snr,cpe-w4n-mt)
  101. idx="$(find_mtd_index uboot-env)"
  102. [ -n "$idx" ] && \
  103. ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1000" "0x1000"
  104. ;;
  105. xiaomi,miwifi-mini)
  106. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
  107. ubootenv_add_uci_sys_config "/dev/mtd9" "0x0" "0x4000" "0x10000"
  108. ;;
  109. xiaomi,mi-router-3g-v2|\
  110. xiaomi,mi-router-4a-gigabit|\
  111. xiaomi,miwifi-3c)
  112. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
  113. ubootenv_add_uci_sys_config "/dev/mtd2" "0x0" "0x4000" "0x10000"
  114. ;;
  115. xiaomi,mi-router-3g|\
  116. xiaomi,mi-router-3-pro|\
  117. xiaomi,mi-router-4|\
  118. xiaomi,mi-router-ac2100|\
  119. xiaomi,redmi-router-ac2100)
  120. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000"
  121. ubootenv_add_uci_sys_config "/dev/mtd2" "0x0" "0x4000" "0x20000"
  122. ;;
  123. zyxel,lte3301-plus)
  124. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x80000"
  125. ;;
  126. zyxel,lte5398-m904|\
  127. zyxel,nr7101)
  128. idx="$(find_mtd_index Config)"
  129. [ -n "$idx" ] && \
  130. ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1000" "0x80000"
  131. ;;
  132. bolt,arion|\
  133. xiaomi,mi-router-cr6606|\
  134. xiaomi,mi-router-cr6608|\
  135. xiaomi,mi-router-cr6609)
  136. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x20000"
  137. ;;
  138. esac
  139. config_load ubootenv
  140. config_foreach ubootenv_add_app_config
  141. exit 0