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