
search --file --set=root /boot/kernel
set default=0
set timeout=10
set timeout_style=menu

set font=($root)/boot/${grub_cpu}/loader/grub2/fonts/unicode.pf2
if [ -f ${font} ];then
    loadfont ${font}
fi
menuentry "Kairos" --class os --unrestricted {
    echo Loading kernel...
    linux ($root)/boot/kernel cdroot root=live:CDLABEL=COS_LIVE rd.live.dir=/ rd.live.squashimg=rootfs.squashfs net.ifnames=1 console=ttyS0 console=tty1 rd.cos.disable vga=795 nomodeset install-mode selinux=0 rd.live.overlay.overlayfs
    echo Loading initrd...
    initrd ($root)/boot/initrd
}

menuentry "Kairos (manual)" --class os --unrestricted {
    echo Loading kernel...
    linux ($root)/boot/kernel cdroot root=live:CDLABEL=COS_LIVE rd.live.dir=/ rd.live.squashimg=rootfs.squashfs net.ifnames=1 console=ttyS0 console=tty1 rd.cos.disable vga=795 nomodeset selinux=0 rd.live.overlay.overlayfs
    echo Loading initrd...
    initrd ($root)/boot/initrd
}

menuentry "kairos (interactive install)" --class os --unrestricted {
    echo Loading kernel...
    linux ($root)/boot/kernel cdroot root=live:CDLABEL=COS_LIVE rd.live.dir=/ rd.live.squashimg=rootfs.squashfs net.ifnames=1 console=ttyS0 console=tty1 rd.cos.disable vga=795 nomodeset install-mode-interactive selinux=0 rd.live.overlay.overlayfs
    echo Loading initrd...
    initrd ($root)/boot/initrd
}

menuentry "Kairos (remote recovery mode)" --class os --unrestricted {
    echo Loading kernel...
    linux ($root)/boot/kernel cdroot root=live:CDLABEL=COS_LIVE rd.live.dir=/ rd.live.squashimg=rootfs.squashfs net.ifnames=1 console=ttyS0 console=tty1 rd.cos.disable vga=795 nomodeset kairos.remote_recovery_mode selinux=0 rd.live.overlay.overlayfs
    echo Loading initrd...
    initrd ($root)/boot/initrd
}

menuentry "Kairos (boot local node from livecd)" --class os --unrestricted {
    echo Loading kernel...
    linux ($root)/boot/kernel cdroot root=live:CDLABEL=COS_LIVE rd.live.dir=/ rd.live.squashimg=rootfs.squashfs net.ifnames=1 console=ttyS0 console=tty1 kairos.boot_live_mode vga=795 nomodeset selinux=0 rd.live.overlay.overlayfs
    echo Loading initrd...
    initrd ($root)/boot/initrd
}

menuentry "Kairos (debug)" --class os --unrestricted {
    echo Loading kernel...
    linux ($root)/boot/kernel cdroot root=live:CDLABEL=COS_LIVE rd.live.dir=/ rd.live.squashimg=rootfs.squashfs net.ifnames=1 console=tty0 rd.debug rd.shell rd.cos.disable rd.immucore.debug vga=795 nomodeset selinux=0 rd.live.overlay.overlayfs
    echo Loading initrd...
    initrd ($root)/boot/initrd
}

if [ "${grub_platform}" = "efi" ]; then
    hiddenentry "Text mode" --hotkey "t" {
        set textmode=true
        terminal_output console
    }
fi
