arc/files/p1/boot/grub/grub.cfg
AuxXxilium d9c71d453a tree: rework
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-08 19:10:03 +01:00

200 lines
4.5 KiB
INI

insmod search
insmod echo
insmod terminal
insmod test
insmod font
insmod loadenv
insmod serial
insmod usb_keyboard
insmod linux
insmod gzio
insmod fat
insmod ext2
insmod ata
insmod btrfs
insmod ntfs
insmod part_msdos
insmod part_gpt
set default="boot"
set timeout="5"
set timeout_style="menu"
set vesa_mode=1
if [ -s $prefix/grubenv ]; then
load_env
fi
if [ "${next_entry}" ]; then
set default="${next_entry}"
unset next_entry
save_env next_entry
fi
if [ "${vesa_mode}" ]; then
set vesa_mode=${vesa_mode}
fi
function load_video {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}
load_video
if loadfont unicode; then
insmod gfxterm
set gfxmode=1024x768
set gfxpayload=auto
terminal_output gfxterm
insmod gfxmenu
loadfont ${prefix}/theme/dejavu_bold_14.pf2
loadfont ${prefix}/theme/dejavu_mono_12.pf2
insmod png
set theme=${prefix}/theme/theme.txt
export theme
fi
if serial --unit=0 --speed=115200; then
terminal_input --append serial_com0
terminal_output --append serial_com0
fi
function set_gfxpayload {
if [ ${vesa_mode} -eq 1 ]; then
set gfxpayload=keep
else
set gfxpayload=text
fi
}
set menu_color_normal=white/black
set menu_color_highlight=white/red
set color_normal=white/black
set ARC_CMDLINE="earlyprintk earlycon=uart8250,io,0x3f8,115200n8 console=ttyS0,115200n8 root=/dev/ram rootwait net.ifnames=0 panic=5 split_lock_detect=off pcie_aspm=off intel_pstate=disable"
search --set=root --label "ARC3"
if [ -s /zImage-dsm -a -s /initrd-dsm ]; then
if [ "${default}" = "direct" ]; then
set timeout="1"
menuentry 'DSM Direct Mode' --id direct {
set_gfxpayload
echo "Loading DSM Kernel..."
linux /zImage-dsm ${dsm_cmdline}
echo "Loading DSM Initramfs..."
initrd /initrd-dsm
echo "Booting..."
echo "Access http://find.synology.com/ to connect the DSM via web."
}
fi
menuentry 'Arc DSM Mode' --id boot {
set_gfxpayload
echo "Loading Arc Kernel..."
linux /bzImage-arc ${ARC_CMDLINE} ${arc_cmdline}
echo "Loading Arc Initramfs..."
if [ -e /initrd-user ]; then
initrd /initrd-arc /initrd-user
else
initrd /initrd-arc
fi
echo "Booting..."
}
fi
if [ -e /automated ]; then
menuentry 'Arc Automated Mode' --id automated {
set_gfxpayload
echo "Loading Arc Kernel..."
linux /bzImage-arc ${ARC_CMDLINE} ${arc_cmdline} automated_arc
echo "Loading Arc Initramfs..."
if [ -e /initrd-user ]; then
initrd /initrd-arc /initrd-user
else
initrd /initrd-arc
fi
echo "Booting..."
}
fi
menuentry 'Arc Config Mode' --id config {
set_gfxpayload
echo "Loading Arc Kernel..."
linux /bzImage-arc ${ARC_CMDLINE} ${arc_cmdline} force_arc
echo "Loading Arc Initramfs..."
if [ -e /initrd-user ]; then
initrd /initrd-arc /initrd-user
else
initrd /initrd-arc
fi
echo "Booting..."
}
if [ -s /zImage-dsm -a -s /initrd-dsm ]; then
menuentry 'Arc Update Mode' --id update {
set_gfxpayload
echo "Loading Arc Kernel..."
linux /bzImage-arc ${ARC_CMDLINE} ${arc_cmdline} update_arc
echo "Loading Arc Initramfs..."
if [ -e /initrd-user ]; then
initrd /initrd-arc /initrd-user
else
initrd /initrd-arc
fi
echo "Booting..."
}
menuentry 'DSM Recovery Mode' --id recovery {
set_gfxpayload
echo "Loading Arc Kernel..."
linux /bzImage-arc ${ARC_CMDLINE} ${arc_cmdline} recovery
echo "Loading Arc Initramfs..."
if [ -e /initrd-user ]; then
initrd /initrd-arc /initrd-user
else
initrd /initrd-arc
fi
echo "Booting..."
}
menuentry 'DSM Reinstall Mode' --id junior {
set_gfxpayload
echo "Loading Arc Kernel..."
linux /bzImage-arc ${ARC_CMDLINE} ${arc_cmdline} force_junior
echo "Loading Arc Initramfs..."
if [ -e /initrd-user ]; then
initrd /initrd-arc /initrd-user
else
initrd /initrd-arc
fi
echo "Booting..."
}
fi
menuentry 'Enter BIOS Setup' --id bios {
fwsetup
}
menuentry 'Start Memtest86+' --id memtest {
echo "Loading memtest86+..."
linux ${prefix}/memtest
}
if [ ${vesa_mode} = 1 ]; then
menuentry 'Change Vesa to Text Output' --id videomode {
set vesa_mode=0
save_env vesa_mode
configfile ${prefix}/grub.cfg
}
else
menuentry 'Change Text to Vesa Output' --id videomode {
set vesa_mode=1
save_env vesa_mode
reboot
configfile ${prefix}/grub.cfg
}
fi