ramips: support fw_printenv for Netgear WAX202
[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 buffalo,wsr-1166dhp|\
35 buffalo,wsr-600dhp|\
36 mediatek,linkit-smart-7688|\
37 samknows,whitebox-v8|\
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 netgear,wax202)
52 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
53 ;;
54 beeline,smartbox-flash|\
55 linksys,ea6350-v4|\
56 linksys,ea7300-v1|\
57 linksys,ea7300-v2|\
58 linksys,ea7500-v2|\
59 linksys,ea8100-v1|\
60 linksys,ea8100-v2)
61 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000"
62 ;;
63 xiaomi,mi-router-3g-v2|\
64 xiaomi,mi-router-4a-gigabit|\
65 xiaomi,miwifi-3c)
66 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
67 ubootenv_add_uci_sys_config "/dev/mtd2" "0x0" "0x4000" "0x10000"
68 ;;
69 xiaomi,mi-router-3g|\
70 xiaomi,mi-router-3-pro|\
71 xiaomi,mi-router-4|\
72 xiaomi,mi-router-ac2100|\
73 xiaomi,redmi-router-ac2100)
74 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000"
75 ubootenv_add_uci_sys_config "/dev/mtd2" "0x0" "0x4000" "0x20000"
76 ;;
77 zyxel,nr7101)
78 idx="$(find_mtd_index Config)"
79 [ -n "$idx" ] && \
80 ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1000" "0x80000"
81 ;;
82 bolt,arion|\
83 xiaomi,mi-router-cr6606|\
84 xiaomi,mi-router-cr6608|\
85 xiaomi,mi-router-cr6609)
86 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x20000"
87 ;;
88 esac
89
90 config_load ubootenv
91 config_foreach ubootenv_add_app_config ubootenv
92
93 exit 0