c153b6a4226ba32ecc3ee9aba011d55b993128a7
[openwrt/openwrt.git] / package / boot / uboot-envtools / files / ramips
1 #!/bin/sh
2 #
3 # Copyright (C) 2011-2012 OpenWrt.org
4 #
5
6 [ -e /etc/config/ubootenv ] && exit 0
7
8 touch /etc/config/ubootenv
9
10 . /lib/uboot-envtools.sh
11 . /lib/functions.sh
12
13 board=$(board_name)
14
15 case "$board" in
16 alfa-network,ac1200rm|\
17 alfa-network,awusfree1|\
18 alfa-network,quad-e4g|\
19 alfa-network,r36m-e4g|\
20 alfa-network,tube-e4g|\
21 engenius,esr600h)
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 buffalo,wsr-1166dhp|\
30 buffalo,wsr-600dhp|\
31 mediatek,linkit-smart-7688|\
32 samknows,whitebox-v8|\
33 xiaomi,mi-router-3g-v2|\
34 xiaomi,mi-router-4a-gigabit|\
35 xiaomi,mi-router-4c|\
36 xiaomi,miwifi-nano|\
37 zbtlink,zbt-wg2626|\
38 zte,mf283plus)
39 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
40 ;;
41 hootoo,ht-tm05|\
42 ravpower,rp-wd03)
43 idx="$(find_mtd_index u-boot-env)"
44 [ -n "$idx" ] && \
45 ubootenv_add_uci_config "/dev/mtd$idx" "0x4000" "0x1000" "0x1000"
46 ;;
47 linksys,ea7300-v1|\
48 linksys,ea7300-v2|\
49 linksys,ea7500-v2|\
50 xiaomi,mi-router-3g|\
51 xiaomi,mi-router-3-pro|\
52 xiaomi,mi-router-4|\
53 xiaomi,mi-router-ac2100|\
54 xiaomi,redmi-router-ac2100)
55 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000"
56 ;;
57 zyxel,nr7101)
58 idx="$(find_mtd_index Config)"
59 [ -n "$idx" ] && \
60 ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1000" "0x80000"
61 ;;
62 esac
63
64 config_load ubootenv
65 config_foreach ubootenv_add_app_config ubootenv
66
67 exit 0