212 lines
5.0 KiB
INI
212 lines
5.0 KiB
INI
|
|
set timeout="5"
|
|
set timeout_style="menu"
|
|
|
|
if [ -s ${prefix}/grubenv ]; then
|
|
load_env --skip-sig
|
|
fi
|
|
|
|
if [ "${next_entry}" ]; then
|
|
set default="${next_entry}"
|
|
unset next_entry
|
|
save_env next_entry
|
|
else
|
|
set default="boot"
|
|
fi
|
|
|
|
if [ "${linux_gfx_mode}" ]; then
|
|
save_env linux_gfx_mode
|
|
else
|
|
set linux_gfx_mode=keep
|
|
save_env linux_gfx_mode
|
|
fi
|
|
|
|
if [ x"${feature_menuentry_id}" = xy ]; then
|
|
menuentry_id_option="--id"
|
|
else
|
|
menuentry_id_option=""
|
|
fi
|
|
|
|
export menuentry_id_option
|
|
|
|
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
|
|
}
|
|
|
|
set menu_color_normal=white/black
|
|
set menu_color_highlight=white/red
|
|
set color_normal=white/black
|
|
|
|
if [ x"${feature_default_font_path}" = xy ]; then
|
|
font=unicode
|
|
else
|
|
font=${prefix}/fonts/unicode.pf2
|
|
fi
|
|
|
|
if loadfont ${font}; then
|
|
if [ "${grub_platform}" = "efi" ]; then
|
|
set gfxmode=auto
|
|
else
|
|
set gfxmode=1024x768
|
|
fi
|
|
load_video
|
|
insmod 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
|
|
|
|
terminal_output gfxterm
|
|
|
|
if serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1; then
|
|
terminal_input --append serial
|
|
terminal_output --append serial
|
|
fi
|
|
|
|
function gfxmode {
|
|
set gfxpayload="${linux_gfx_mode}"
|
|
if [ "${linux_gfx_mode}" = "keep" ]; then
|
|
set vt_handoff=vt.handoff=7
|
|
else
|
|
set vt_handoff=
|
|
fi
|
|
}
|
|
|
|
set ARC_CMDLINE="earlyprintk earlycon=uart8250,io,0x3f8,115200n8 console=ttyS0,115200n8 root=/dev/ram rootwait intremap=off amd_iommu_intr=legacy net.ifnames=0 panic=5 split_lock_detect=off pcie_aspm=off intel_pstate=disable amd_pstate=disable nox2apic nomodeset"
|
|
|
|
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' ${menuentry_id_option} direct {
|
|
gfxmode
|
|
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' ${menuentry_id_option} boot {
|
|
gfxmode
|
|
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' ${menuentry_id_option} automated {
|
|
gfxmode
|
|
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' ${menuentry_id_option} config {
|
|
gfxmode
|
|
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' ${menuentry_id_option} update {
|
|
gfxmode
|
|
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' ${menuentry_id_option} recovery {
|
|
gfxmode
|
|
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' ${menuentry_id_option} junior {
|
|
gfxmode
|
|
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 UEFI Setup' ${menuentry_id_option} uefi {
|
|
fwsetup
|
|
}
|
|
|
|
menuentry 'Start Memtest86+' ${menuentry_id_option} memtest {
|
|
echo "Loading memtest86+..."
|
|
linux ${prefix}/memtest
|
|
}
|
|
|
|
menuentry 'Poweroff' ${menuentry_id_option} poweroff {
|
|
echo "System is powering off..."
|
|
halt
|
|
}
|
|
|
|
if [ ${vesa_mode} = 1 ]; then
|
|
menuentry 'Change Vesa to Text Output' ${menuentry_id_option} videomode {
|
|
set vesa_mode=0
|
|
save_env vesa_mode
|
|
configfile ${prefix}/grub.cfg
|
|
}
|
|
else
|
|
menuentry 'Change Text to Vesa Output' ${menuentry_id_option} videomode {
|
|
set vesa_mode=1
|
|
save_env vesa_mode
|
|
reboot
|
|
configfile ${prefix}/grub.cfg
|
|
}
|
|
fi |