set default=3
set timeout=-1

if loadfont $prefix/font.pf2 ; then
	set gfxmode=640x480
	set gfxpayload=keep
	insmod vbe
	insmod gfxterm
	terminal_output gfxterm
fi

insmod png
if background_image $prefix/splash.png ; then
	set color_normal=white/black
	set color_highlight=black/white
else
	set menu_color_normal=cyan/blue
	set menu_color_highlight=white/blue
fi

insmod play
play 960 440 1 0 4 440 1

menuentry "Debian GNU/Hurd installer boot menu" {
	true
}

menuentry "" {
	true
}

function boot_one {
	echo "Loading ..."
	set root=$cd
	multiboot $prefix/gnumach.gz $options
	module --nounzip /boot/${gtk}initrd.gz initrd '$(ramdisk-create)'
	module /boot/kernel/ext2fs.static ext2fs \
			--multiboot-command-line='${kernel-command-line}' \
			--host-priv-port='${host-port}' \
			--device-master-port='${device-port}' \
			--exec-server-task='${exec-task}' -T typed gunzip:device:rd0 \
			'$(task-create)' '$(task-resume)'
	module /boot/kernel/exec.static exec '$(exec-task=task-create)'
}

menuentry "Text install (Mach console)" {
	set options="TERM=mach-gnu-color"
	boot_one
}

menuentry "Pseudo-graphical install (Hurd console)" {
	set options="GTK_NOVESA=1 VGA_OPTIONS=--font-width=9"
	boot_one
}

menuentry "Pseudo-graphical install with CJK support (Hurd console)" {
	set options="GTK_NOVESA=1 VGA_OPTIONS=--font-width=8"
	boot_one
}

menuentry "Graphical install" {
	set options=""
        set gtk="gtk/"
	boot_one
}

menuentry "Automated install" {
	set options="auto=true priority=critical TERM=mach-gnu-color"
	boot_one
}

menuentry "Expert install" {
	set options="priority=low TERM=mach-gnu-color"
	boot_one
}

menuentry "Rescue mode" {
	set options="rescue/enable=true"
	boot_one
}
