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

touch /etc/config/ubootenv

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

board=$(board_name)

case "$board" in
cmcc,pz-l8|\
elecom,wrc-x3000gs2|\
iodata,wn-dax3000gr|\
zyxel,scr50axe)
	ubootenv_add_mtd "0:appsblenv" "0x0" "0x40000" "0x20000"
	;;
glinet,gl-b3000)
	ubootenv_add_mtd "0:APPSBLENV" "0x0" "0x40000" "0x20000"
	;;
linksys,mr5500|\
linksys,mx2000|\
linksys,mx5500|\
linksys,mx6200|\
linksys,spnmx56)
	ubootenv_add_mtd "u_env" "0x0" "0x40000" "0x20000"
	;;
xiaomi,ax6000)
	ubootenv_add_mtd "0:appsblenv" "0x0" "0x10000" "0x20000"
	ubootenv_add_sys_mtd "bdata" "0x0" "0x10000" "0x20000"
	;;
yuncore,ax830|\
yuncore,ax850)
	ubootenv_add_mtd "0:APPSBLENV" "0x0" "0x10000" "0x10000"
	;;
esac

config_load ubootenv
config_foreach ubootenv_add_app_config

exit 0
