
set root=(http,$SERVER_IP$)
set pxe_http_port=$HTTP_PORT$
set prefix=(http,$SERVER_IP$)/uis_loader/grub2

uds_func_install_mods
#uds_func_set_gfx


onie_version=master-04230117-dirty
onie_vendor_id=25506
onie_build_machine=tencent_tcs81-120f
onie_machine_rev=0
onie_arch=x86_64
onie_build_platform=x86_64-tencent_tcs81-120f-r0
onie_config_version=1
onie_build_date="2020-04-23T01:17+00:00"
onie_partition_type=gpt
onie_kernel_version=4.9.95
onie_firmware=auto
onie_switch_asic=bcm
onie_skip_ethmgmt_macs=no
onie_grub_image_name=grubx64.efi
onie_uefi_boot_loader=grubx64.efi
onie_uefi_arch=x64
#  Copyright (C) 2014,2015,2017 Curt Brune <curt@cumulusnetworks.com>
#  Copyright (C) 2014 david_yang <david_yang@accton.com>
#  Copyright (C) 2014 Stephen Su <sustephen@juniper.net>
#
#  SPDX-License-Identifier:     GPL-2.0

if [ "yes" == "yes"  ] ; then
  serial --port=0x3f8 --speed=115200 --word=8 --parity=no --stop=1
  terminal_input serial
  terminal_output serial
  CONSOLE_CMDLINE_LINUX="console=tty0 console=ttyS0,115200n8"
  export CONSOLE_CMDLINE_LINUX
fi
set timeout=3

function onie_entry_start {
  if [ "${grub_platform}" != "efi" ] ; then
    acpi
  fi
}

function onie_entry_end {
  echo "Platform  : $onie_build_platform"
  echo "Version   : $onie_version"
  echo "Build Date: $onie_build_date"
}

ONIE_CMDLINE_LINUX="quiet ${CONSOLE_CMDLINE_LINUX}  boot_env=recovery"
set default="0"

menuentry "ONIE: Rescue" --class gnu-linux --class onie {
  echo    "ONIE: Rescue Mode ..."
  onie_entry_start
  linux   $HTTP_IMG_ROOT$/vmlinuz $ONIE_CMDLINE_LINUX boot_reason=rescue
  initrd  $HTTP_IMG_ROOT$/initrd.xz
  onie_entry_end
}

menuentry "ONIE: Embed ONIE" --class gnu-linux --class onie {
  echo    "ONIE: Embedding ONIE ..."
  onie_entry_start
  linux   $HTTP_IMG_ROOT$/vmlinuz $ONIE_CMDLINE_LINUX boot_reason=embed install_url=file:///lib/onie/onie-updater
  initrd  $HTTP_IMG_ROOT$/initrd.xz
  onie_entry_end
}
