[ -e /etc/config/ubootenv ] && exit 0

touch /etc/config/ubootenv

. /lib/uboot-envtools.sh
. /lib/functions.sh

board=$(board_name)

ubootenv_add_mmc() {
	local mmcpart="$(find_mmc_part "${1}")"
	[ -n "$mmcpart" ] && \
		ubootenv_add_uci_config "$mmcpart" "${2}" "${3}" "${4}"
}

case "$board" in
8devices,kiwi-dvk)
	ubootenv_add_mmc "0:APPSBLENV" "0x0" "0x40000" "0x40000"
	;;
esac

config_load ubootenv
config_foreach ubootenv_add_app_config

exit 0
