dd8c2d36d7562824920d26c6d9e20f1a63c5e93c
[openwrt/openwrt.git] / package / boot / uboot-envtools / files / ath79
1 #!/bin/sh
2 #
3 # Copyright (C) 2011-2014 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,ap121f|\
17 alfa-network,ap121fe|\
18 alfa-network,n2q|\
19 alfa-network,n5q|\
20 alfa-network,pi-wifi4|\
21 alfa-network,r36a|\
22 allnet,all-wap02860ac|\
23 arduino,yun|\
24 buffalo,bhr-4grv2|\
25 devolo,magic-2-wifi|\
26 engenius,eap300-v2|\
27 engenius,ecb1200|\
28 engenius,ecb1750|\
29 engenius,enh202-v1|\
30 engenius,ens202ext-v1|\
31 etactica,eg200|\
32 glinet,gl-ar750s-nor|\
33 glinet,gl-ar750s-nor-nand|\
34 librerouter,librerouter-v1|\
35 netgear,ex6400|\
36 netgear,ex7300|\
37 netgear,wndr4300-v2|\
38 netgear,wndr4500-v3|\
39 netgear,wnr1000-v2|\
40 netgear,wnr2000-v3|\
41 netgear,wnr2200-8m|\
42 netgear,wnr2200-16m|\
43 netgear,wnr612-v2|\
44 ocedo,koala|\
45 ocedo,raccoon|\
46 openmesh,om5p-ac-v2|\
47 samsung,wam250|\
48 ubnt,nanostation-m|\
49 yuncore,a770|\
50 yuncore,a782|\
51 yuncore,xd4200|\
52 zyxel,nbg6616)
53 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000"
54 ;;
55 buffalo,wzr-hp-ag300h)
56 ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x10000" "0x10000"
57 ;;
58 domywifi,dw33d)
59 ubootenv_add_uci_config "/dev/mtd4" "0x0" "0x10000" "0x10000"
60 ;;
61 glinet,gl-ar150)
62 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x8000" "0x10000"
63 ;;
64 glinet,gl-ar300m-lite|\
65 glinet,gl-ar300m-nand|\
66 glinet,gl-ar300m-nor|\
67 glinet,gl-ar300m16)
68 idx="$(find_mtd_index u-boot-env)"
69 [ -n "$idx" ] && \
70 ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x10000"
71 ;;
72 netgear,wndr3700|\
73 netgear,wndr3700-v2|\
74 netgear,wndrmac-v1)
75 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x10000"
76 ;;
77 netgear,wndr3700-v4|\
78 netgear,wndr4300|\
79 netgear,wndr4300tn|\
80 netgear,wndr4300sw)
81 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x20000"
82 ;;
83 qihoo,c301)
84 ubootenv_add_uci_config "/dev/mtd9" "0x0" "0x10000" "0x10000"
85 ;;
86 wallys,dr531)
87 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0xf800" "0x10000"
88 ;;
89 esac
90
91 config_load ubootenv
92 config_foreach ubootenv_add_app_config ubootenv
93
94 exit 0