set default=0
set timeout=5
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray

menuentry "Fennix" {
	load_video
	clear
	echo "Loading kernel"
	multiboot2 /fennix.elf --init=/sys/bin/init
	echo "Loading rootfs"
	module2 /rootfs.tar.gz rootfs
	echo "Booting..."
	boot
}

submenu "Advanced Options..." {
	menuentry "Fennix (Linux Subsystem)" {
		load_video
		clear
		echo "Loading kernel in Linux Subsystem mode"
		multiboot2 /fennix.elf --linux=true
		echo "Loading rootfs"
		module2 /rootfs.tar.gz rootfs
		echo "Booting..."
		boot
	}

	menuentry "Fennix (Recovery)" {
		load_video
		clear
		echo "Loading kernel in recovery mode"
		multiboot2 /fennix.elf
		echo "Loading rootfs"
		module2 /rootfs.tar.gz rootfs
		echo "Booting..."
		boot
	}
}

menuentry ' ' {
	exit 1
}

menuentry 'Boot from next volume' {
	exit 1
}

if [ ${grub_platform} == "efi" ]; then
	menuentry 'UEFI Firmware Settings' {
		fwsetup
	}
fi

menuentry "System restart" {
	reboot
}

menuentry "System shutdown" {
	halt
}

function load_video {
	if [ x$feature_all_video_module = xy ]; then
		insmod all_video
	else
		insmod efi_gop
		insmod efi_uga
		insmod ieee1275_fb
		insmod vbe
		insmod vga
		insmod video_bochs
		insmod video_cirrus
	fi
}
