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