f7f4821cef861b4d0e519ea0b93b9204b7cd228a
[openwrt/openwrt.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,esr600h|\
21 sitecom,wlr-4100-v1-002)
22 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x1000"
23 ;;
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 ampedwireless,ally-00x19k|\
31 ampedwireless,ally-r1900k)
32 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000" "4"
33 ;;
34 beeline,smartbox-giga)
35 ubootenv_add_uci_config "/dev/mtd0" "0x80000" "0x1000" "0x20000"
36 ;;
37 buffalo,wsr-1166dhp|\
38 buffalo,wsr-600dhp|\
39 mediatek,linkit-smart-7688|\
40 samknows,whitebox-v8|\
41 xiaomi,mi-router-4c|\
42 xiaomi,miwifi-nano|\
43 zbtlink,zbt-wg2626|\
44 zte,mf283plus)
45 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
46 ;;
47 h3c,tx1800-plus|\
48 h3c,tx1801-plus|\
49 h3c,tx1806|\
50 jcg,q20|\
51 netgear,wax202)
52 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
53 ;;
54 hootoo,ht-tm05|\
55 ravpower,rp-wd03)
56 idx="$(find_mtd_index u-boot-env)"
57 [ -n "$idx" ] && \
58 ubootenv_add_uci_config "/dev/mtd$idx" "0x4000" "0x1000" "0x1000"
59 ;;
60 beeline,smartbox-flash|\
61 linksys,ea6350-v4|\
62 linksys,ea7300-v1|\
63 linksys,ea7300-v2|\
64 linksys,ea7500-v2|\
65 linksys,ea8100-v1|\
66 linksys,ea8100-v2|\
67 mts,wg430223)
68 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000"
69 ;;
70 xiaomi,mi-router-3g-v2|\
71 xiaomi,mi-router-4a-gigabit|\
72 xiaomi,miwifi-3c)
73 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
74 ubootenv_add_uci_sys_config "/dev/mtd2" "0x0" "0x4000" "0x10000"
75 ;;
76 xiaomi,mi-router-3g|\
77 xiaomi,mi-router-3-pro|\
78 xiaomi,mi-router-4|\
79 xiaomi,mi-router-ac2100|\
80 xiaomi,redmi-router-ac2100)
81 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000"
82 ubootenv_add_uci_sys_config "/dev/mtd2" "0x0" "0x4000" "0x20000"
83 ;;
84 zyxel,lte3301-plus)
85 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x80000"
86 ;;
87 zyxel,nr7101)
88 idx="$(find_mtd_index Config)"
89 [ -n "$idx" ] && \
90 ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1000" "0x80000"
91 ;;
92 bolt,arion|\
93 xiaomi,mi-router-cr6606|\
94 xiaomi,mi-router-cr6608|\
95 xiaomi,mi-router-cr6609)
96 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x20000"
97 ;;
98 esac
99
100 config_load ubootenv
101 config_foreach ubootenv_add_app_config
102
103 exit 0