X-Git-Url: https://git.grml.org/?p=grml-live.git;a=blobdiff_plain;f=templates%2Fboot%2Fgrub%2Faddons.cfg;h=34ae54c97c0ffcbb4a6129ca73e7582f81d7b635;hp=86f117fb68442d65fd2430b0e77f733bda67bdb7;hb=HEAD;hpb=1f1d65742021bb7f7fd237c98ab0823df4a0cb04 diff --git a/templates/boot/grub/addons.cfg b/templates/boot/grub/addons.cfg index 86f117f..5aea931 100644 --- a/templates/boot/grub/addons.cfg +++ b/templates/boot/grub/addons.cfg @@ -1,10 +1,56 @@ submenu "Addons ->" --class=submenu { +# EFI: +if [ "${grub_platform}" == "efi" ] ; then + # arm64 doesn't provide the cpuid command, and we also + # don't have any memtest* efi files available, so only + # run on architectures other than arm64 (amd64 + i386) + if [ "${grub_cpu}" != "arm64" ] ; then + # try to detect amd64 by checking whether CPU supports 64-bit (long) mode + if cpuid -l ; then + if test -e /boot/addons/memtest86+x64.efi ; then + menuentry "Memory test (memtest86+x64.efi)" { + chainloader /boot/addons/memtest86+x64.efi + } + fi + else # assume i386 + if test -e /boot/addons/memtest86+ia32.efi ; then + menuentry "Memory test (memtest86+ia32.efi)" { + chainloader /boot/addons/memtest86+ia32.efi + } + fi + fi + fi +fi + +# BIOS/non-EFI: if [ "${grub_platform}" != "efi" ] ; then - menuentry "Memory test (memtest86+)" { + # try to detect amd64 by checking whether CPU supports 64-bit (long) mode + if cpuid -l ; then + if test -e /boot/addons/memtest86+x64.bin ; then + menuentry "Memory test (memtest86+x64.bin)" { + insmod linux16 + linux16 /boot/addons/memtest86+x64.bin + } + elif test -e /boot/addons/memtest ; then # fallback to old memtest + menuentry "Memory test (memtest86+)" { insmod linux16 linux16 /boot/addons/memtest - } + } + fi + else # assume i386 + if test -e /boot/addons/memtest86+ia32.bin ; then + menuentry "Memory test (memtest86+ia32.bin)" { + insmod linux16 + linux16 /boot/addons/memtest86+ia32.bin + } + elif test -e /boot/addons/memtest ; then # fallback to old memtest + menuentry "Memory test (memtest86+)" { + insmod linux16 + linux16 /boot/addons/memtest + } + fi + fi fi menuentry "iPXE - boot via network/PXE" { @@ -78,7 +124,12 @@ if [ "${grub_platform}" != "efi" ] ; then fi # efi mode } -menuentry "Boot OS of first partition on first disk" { - set root=(hd0,1) - chainloader +1 +if [ "${grub_platform}" == "efi" ] ; then +menuentry "UEFI Firmware Settings" { + fwsetup +} +fi # efi mode + +menuentry "Boot from next device" { + exit }