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