c0873c6e0d7f34383e5b7aa19c8da6d9562efff2
[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 allnet,all-wap02860ac|\
18 arduino,yun|\
19 buffalo,bhr-4grv2|\
20 devolo,magic-2-wifi|\
21 engenius,ecb1750|\
22 etactica,eg200|\
23 glinet,gl-ar750s-nor|\
24 glinet,gl-ar750s-nor-nand|\
25 librerouter,librerouter-v1|\
26 netgear,ex6400|\
27 netgear,ex7300|\
28 netgear,wndr4300-v2|\
29 netgear,wndr4500-v3|\
30 netgear,wnr1000-v2|\
31 netgear,wnr2000-v3|\
32 netgear,wnr2200-8m|\
33 netgear,wnr2200-16m|\
34 netgear,wnr612-v2|\
35 ocedo,koala|\
36 ocedo,raccoon|\
37 openmesh,om5p-ac-v2|\
38 ubnt,nanostation-m|\
39 yuncore,a770|\
40 yuncore,a782|\
41 yuncore,xd4200|\
42 zyxel,nbg6616)
43 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000"
44 ;;
45 buffalo,wzr-hp-ag300h)
46 ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x10000" "0x10000"
47 ;;
48 domywifi,dw33d)
49 ubootenv_add_uci_config "/dev/mtd4" "0x0" "0x10000" "0x10000"
50 ;;
51 glinet,gl-ar150)
52 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x8000" "0x10000"
53 ;;
54 glinet,gl-ar300m-lite|\
55 glinet,gl-ar300m-nand|\
56 glinet,gl-ar300m-nor|\
57 glinet,gl-ar300m16)
58 idx="$(find_mtd_index u-boot-env)"
59 [ -n "$idx" ] && \
60 ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x10000"
61 ;;
62 netgear,wndr3700|\
63 netgear,wndr3700-v2|\
64 netgear,wndrmac-v1)
65 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x10000"
66 ;;
67 netgear,wndr3700-v4|\
68 netgear,wndr4300|\
69 netgear,wndr4300tn|\
70 netgear,wndr4300sw)
71 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x20000"
72 ;;
73 qihoo,c301)
74 ubootenv_add_uci_config "/dev/mtd9" "0x0" "0x10000" "0x10000"
75 ;;
76 esac
77
78 config_load ubootenv
79 config_foreach ubootenv_add_app_config ubootenv
80
81 exit 0