setenv bootlabel	"Ubuntu Installer - Ubuntu 20.04 (Focal Fossa)"

setenv display_autodetect	"true"
setenv devtype		"mmc"
setenv ramdisk_addr_r	0x03080000
setenv kernel_addr_load 0x04000000
setenv fdt_addr_r	0x20000000

if load ${devtype} ${devnum}:${partition} ${loadaddr} preseed.ini; then env import -t ${loadaddr}; fi
if test "${display_autodetect}" = "true"; then hdmitx edid; fi

setenv bootargs		"root=UUID=10EB-A1D6 console=tty0 no_console_suspend quiet clk_ignore_unused ramoops.pstore_en=1 ramoops.record_size=0x8000 ramoops.console_size=0x4000 anna/no_kernel_modules=true"

if test "${di_auto}" = "true"; then
	setenv bootargs	"${bootargs} auto=true netcfg/get_hostname=${di_hostname} netcfg/get_domain=${di_domain} passwd/user-fullname=${di_user_fullname} passwd/username=${di_username} passwd/user-password=${di_user_password} passwd/user-password-again=${di_user_password} partman-auto/disk=${disk}"
fi

if test "${di_profile}" = ""; then
	di_profile="default"
fi

setenv bootargs "${bootargs} mirror/codename=focal mirror/suite=focal preseed/url=http://ppa.linuxfactory.or.kr/installer/preseed/focal/${di_profile}.cfg"

load ${devtype} ${devnum}:${partition} ${kernel_addr_load} /install.a64/Image.gz \
&& unzip ${kernel_addr_load} ${kernel_addr_r} \
&& load ${devtype} ${devnum}:${partition} ${fdt_addr_r} /install.a64/dtbs/amlogic/meson64_odroid${variant}.dtb \
&& load ${devtype} ${devnum}:${partition} ${ramdisk_addr_r} /install.a64/initrd.gz \
&& echo "Booting Debian ${fk_kvers} from ${devtype} ${devnum}:${partition}..." \
&& echo ${bootargs} \
&& booti ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r}
