763f15d4e01adf8838ce6502428282a956452372
[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 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000"
28 ;;
29 ampedwireless,ally-00x19k|\
30 ampedwireless,ally-r1900k)
31 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000" "4"
32 ;;
33 buffalo,wsr-1166dhp|\
34 buffalo,wsr-600dhp|\
35 mediatek,linkit-smart-7688|\
36 samknows,whitebox-v8|\
37 xiaomi,mi-router-3g-v2|\
38 xiaomi,mi-router-4a-gigabit|\
39 xiaomi,mi-router-4c|\
40 xiaomi,miwifi-3c|\
41 xiaomi,miwifi-nano|\
42 zbtlink,zbt-wg2626|\
43 zte,mf283plus)
44 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
45 ;;
46 hootoo,ht-tm05|\
47 ravpower,rp-wd03)
48 idx="$(find_mtd_index u-boot-env)"
49 [ -n "$idx" ] && \
50 ubootenv_add_uci_config "/dev/mtd$idx" "0x4000" "0x1000" "0x1000"
51 ;;
52 jcg,q20)
53 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
54 ;;
55 beeline,smartbox-flash|\
56 linksys,ea6350-v4|\
57 linksys,ea7300-v1|\
58 linksys,ea7300-v2|\
59 linksys,ea7500-v2|\
60 linksys,ea8100-v1|\
61 linksys,ea8100-v2|\
62 xiaomi,mi-router-3g|\
63 xiaomi,mi-router-3-pro|\
64 xiaomi,mi-router-4|\
65 xiaomi,mi-router-ac2100|\
66 xiaomi,redmi-router-ac2100)
67 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000"
68 ;;
69 zyxel,nr7101)
70 idx="$(find_mtd_index Config)"
71 [ -n "$idx" ] && \
72 ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1000" "0x80000"
73 ;;
74 xiaomi,mi-router-cr6606|\
75 xiaomi,mi-router-cr6608|\
76 xiaomi,mi-router-cr6609)
77 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x20000"
78 ;;
79 esac
80
81 config_load ubootenv
82 config_foreach ubootenv_add_app_config ubootenv
83
84 exit 0