1#!/bin/sh
2#
3# Copyright (C) 2011-2014 OpenWrt.org
4#
5
6[ -e /etc/config/ubootenv ] && exit 0
7
8touch /etc/config/ubootenv
9
10. /lib/ar71xx.sh
11. /lib/uboot-envtools.sh
12. /lib/functions.sh
13
14board=$(ar71xx_board_name)
15
16case "$board" in
17alfa-ap120c | \
18all0258n | \
19cap324 | \
20cap4200ag | \
21carambola2 | \
22cr3000 | \
23cr5000 | \
24eap300v2 | \
25hornet-ub | \
26hornet-ub-x2 | \
27mr1750 | \
28mr1750v2 | \
29mr600 | \
30mr600v2 | \
31mr900 | \
32mr900v2 | \
33nbg6716 | \
34om5p-an | \
35om5p-ac | \
36om5p-acv2 | \
37om5p | \
38tube2h | \
39wndr3700)
40	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000"
41	;;
42alfa-ap96 | \
43all0315n | \
44om2p | \
45om2pv2 | \
46om2p-hs | \
47om2p-hsv2 | \
48om2p-hsv3 | \
49om2p-lc)
50	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x40000"
51	;;
52wzr-hp-ag300h)
53	ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x10000" "0x10000"
54	;;
55qihoo-c301)
56	ubootenv_add_uci_config "/dev/mtd9" "0x0" "0x10000" "0x10000"
57	;;
58esac
59
60config_load ubootenv
61config_foreach ubootenv_add_app_config ubootenv
62
63exit 0
64