ee2d95115c2de6c16503e90ca1c308d67ab34638
[openwrt/staging/mkresin.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 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x1000"
22 ;;
23 allnet,all0256n-4m|\
24 allnet,all0256n-8m|\
25 allnet,all5002)
26 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000"
27 ;;
28 buffalo,wsr-1166dhp|\
29 buffalo,wsr-600dhp|\
30 mediatek,linkit-smart-7688|\
31 samknows,whitebox-v8|\
32 xiaomi,mi-router-3g-v2|\
33 xiaomi,mi-router-4a-gigabit|\
34 xiaomi,mi-router-4c|\
35 xiaomi,miwifi-nano|\
36 zbtlink,zbt-wg2626|\
37 zte,mf283plus)
38 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
39 ;;
40 hootoo,ht-tm05|\
41 ravpower,rp-wd03)
42 idx="$(find_mtd_index u-boot-env)"
43 [ -n "$idx" ] && \
44 ubootenv_add_uci_config "/dev/mtd$idx" "0x4000" "0x1000" "0x1000"
45 ;;
46 jcg,q20)
47 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
48 ;;
49 linksys,ea7300-v1|\
50 linksys,ea7300-v2|\
51 linksys,ea7500-v2|\
52 xiaomi,mi-router-3g|\
53 xiaomi,mi-router-3-pro|\
54 xiaomi,mi-router-4|\
55 xiaomi,mi-router-ac2100|\
56 xiaomi,redmi-router-ac2100)
57 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000"
58 ;;
59 zyxel,nr7101)
60 idx="$(find_mtd_index Config)"
61 [ -n "$idx" ] && \
62 ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1000" "0x80000"
63 ;;
64 esac
65
66 config_load ubootenv
67 config_foreach ubootenv_add_app_config ubootenv
68
69 exit 0