1#!/bin/sh
2#
3# Copyright (C) 2013 OpenWrt.org
4#
5
6[ -e /etc/config/ubootenv ] && exit 0
7
8touch /etc/config/ubootenv
9
10. /lib/cns3xxx.sh
11. /lib/uboot-envtools.sh
12. /lib/functions.sh
13
14board=$(cns3xxx_board_name)
15
16case "$board" in
17laguna)
18	# Laguna uboot env size/erasesize vary depending on NOR vs SPI FLASH
19	size=$(grep mtd1 /proc/mtd | awk '{print $2}')
20	erasesize=$(grep mtd1 /proc/mtd | awk '{print $3}')
21	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x$size" "0x$erasesize"
22	;;
23esac
24
25config_load ubootenv
26config_foreach ubootenv_add_app_config ubootenv
27
28exit 0
29