set timeout=3
set color_normal="light-gray/black"
set color_highlight="light-green/blue"

# The first boot entry in normal boot.
set first_boot="0"

# The default boot entry after the first boot.
set default_boot="0"

function savedefault {
  if [ "${chosen}" ]; then
    next_boot="${chosen}"
    save_env next_boot
  fi
}

if [ -s "${prefix}/grubenv" ]; then
    load_env
fi

if [ "${next_boot}" ]; then
    set default="${next_boot}"
else
    set default="${first_boot}"
    set next_boot="${default_boot}"
    save_env next_boot
fi

if [ -s "${prefix}/efi-secure-boot.inc" ]; then
    source "${prefix}/efi-secure-boot.inc"
fi

if [ -s "${prefix}/boot-menu.inc" ]; then
    source "${prefix}/boot-menu.inc"
fi
