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

touch /etc/config/ubootenv

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

board=$(board_name)

case "$board" in
gw,imx8m*|\
gateworks,imx8m*)
	# board boots from emmc boot0 hardware partition
	ubootenv_add_uci_config /dev/mmcblk2boot0 0x3f0000 0x8000
	ubootenv_add_uci_config /dev/mmcblk2boot0 0x3f8000 0x8000
esac

config_load ubootenv
config_foreach ubootenv_add_app_config ubootenv

exit 0
