2013-07-02 23:08:19 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2014-06-26 10:14:14 +00:00
|
|
|
# Copyright (C) 2013-2014 OpenWrt.org
|
2013-07-02 23:08:19 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
[ -e /etc/config/ubootenv ] && exit 0
|
|
|
|
|
|
|
|
touch /etc/config/ubootenv
|
|
|
|
|
|
|
|
. /lib/uboot-envtools.sh
|
|
|
|
. /lib/functions.sh
|
|
|
|
|
2017-05-12 20:36:07 +00:00
|
|
|
board=$(board_name)
|
2013-07-02 23:08:19 +00:00
|
|
|
|
|
|
|
case "$board" in
|
2015-10-10 12:34:45 +00:00
|
|
|
*gw5*)
|
|
|
|
if [ -c /dev/mtd1 ]; then
|
|
|
|
# board boots from NAND
|
|
|
|
ubootenv_add_uci_config /dev/mtd1 0x0 0x20000 0x40000
|
|
|
|
ubootenv_add_uci_config /dev/mtd1 0x80000 0x20000 0x40000
|
|
|
|
else
|
|
|
|
# board boots from microSD
|
|
|
|
ubootenv_add_uci_config /dev/mmcblk0 0xb1400 0x20000 0x20000
|
|
|
|
ubootenv_add_uci_config /dev/mmcblk0 0xd1400 0x20000 0x20000
|
|
|
|
fi
|
|
|
|
;;
|
2016-12-13 21:30:11 +00:00
|
|
|
wandboard)
|
2013-07-02 23:08:19 +00:00
|
|
|
ubootenv_add_uci_config "/dev/mmcblk0" "0x60000" "0x2000" "0x2000"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
config_load ubootenv
|
|
|
|
config_foreach ubootenv_add_app_config ubootenv
|
|
|
|
|
|
|
|
exit 0
|