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