#
# ### !!! WARNING - READ ME !!! ###
#
# DO NOT edit this file. This file has been generated automatically by the loader generator.
# If you were asked to use a pre-made image and asked by someone to edit this file DO NOT do it. The only
# supported method of obtaining the loader image is generating it using the loader generator provided.
#

terminal_output console
if serial --unit=0 --speed=115200; then
    terminal_input --append serial_com0
    terminal_output --append serial_com0
fi

set default="0"
set timeout="5"
set timeout_style="menu"

if [ -s $prefix/grubenv ]; then
    load_env --file $prefix/grubenv --skip-sig
    set has_env="1"
    if [ -n "${saved_entry}" ]; then
        set default="${saved_entry}"
    fi
else
    set has_env="0"
    echo "WARN: failed to load env. Default choice will NOT be saved!"
fi


function savedefault {
    saved_entry="${chosen}"
    save_env --file $prefix/grubenv saved_entry
}


insmod usb_keyboard
insmod part_msdos
insmod ext2
insmod fat
insmod linux
insmod gzio

set gfxmode=auto
insmod vbe
insmod vga

# UEFI
insmod efi_gop
insmod efi_uga

insmod font
if loadfont ${prefix}/unicode.pf2
then
    insmod gfxterm
    set gfxmode=auto
    set gfxpayload=keep
    terminal_output gfxterm
fi

@@@MENU_ENTRIES@@@
