#
# ### !!! 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="3"
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="3"
    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

menuentry 'RedPill DS923+ 7.1.1-42962 (USB, Verbose)' {
	savedefault
        search --set=root --fs-uuid 6234-C863 --hint hd0,msdos3
	echo Loading Linux...
	linux /zImage-dsm earlyprintk syno_hw_version=DS923+ console=ttyS0,115200n8 netif_num=1 synoboot2 pid=0xa4a5 earlycon=uart8250,io,0x3f8,115200n8 mac1=00113240AA40 sn=2030SBRJZMK5B SMBusHddDynamicPower=1 vid=0x0525 elevator=elevator loglevel=15 DiskIdxMap=0A00 vender_format_version=2 log_buf_len=32M root=/dev/md0 SataPortMap=58 syno_ttyS1=serial,0x2f8 syno_ttyS0=serial,0x3f8 
	echo Loading initramfs...
	initrd /initrd-dsm /custom.gz
	echo Starting kernel with USB boot
}

menuentry 'RedPill DS923+ 7.1.1-42962 (SATA, Verbose)' {
	savedefault
        search --set=root --fs-uuid 6234-C863 --hint hd0,msdos3
	echo Loading Linux...
	linux /zImage-dsm earlyprintk syno_hw_version=DS923+ console=ttyS0,115200n8 netif_num=1 synoboot2 pid=0xa4a5 earlycon=uart8250,io,0x3f8,115200n8 synoboot_satadom=2 mac1=00113240AA40 sn=2030SBRJZMK5B SMBusHddDynamicPower=1 vid=0x0525 elevator=elevator loglevel=15 DiskIdxMap=0A00 vender_format_version=2 log_buf_len=32M root=/dev/md0 SataPortMap=58 syno_ttyS1=serial,0x2f8 syno_ttyS0=serial,0x3f8 
	echo Loading initramfs...
	initrd /initrd-dsm /custom.gz
	echo Starting kernel with SATA boot
	echo WARNING: SATA boot support on this platform is experimental!
}


menuentry 'Tiny Core Image Build' {
        savedefault
        search --set=root --fs-uuid 6234-C863 --hint hd0,msdos3
        echo Loading Linux...
        linux /vmlinuz64 loglevel=3 cde waitusb=5 vga=791
        echo Loading initramfs...
        initrd /corepure64.gz
        echo Booting TinyCore for loader creation
}
menuentry 'Tiny Core Friend' {
        savedefault
        search --set=root --fs-uuid 6234-C863 --hint hd0,msdos3
        echo Loading Linux...
        linux /bzImage-friend loglevel=3 waitusb=5 vga=791 net.ifnames=0 biosdevname=0 
        echo Loading initramfs...
        initrd /initrd-friend
        echo Booting TinyCore Friend
}
