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 if test -e /boot/addons/memtest ; then menuentry "Memory test (memtest86+)" { insmod linux16 linux16 /boot/addons/memtest } fi fi if [ "${grub_platform}" == "efi" ] ; then if test -e /boot/addons/ipxe.efi ; then menuentry "iPXE - boot via network/PXE" { chainloader /boot/addons/ipxe.efi } fi else if test -e /boot/addons/ipxe.lkrn ; then menuentry "iPXE - boot via network/PXE" { insmod linux16 linux16 /boot/addons/ipxe.lkrn } fi fi if [ "${grub_platform}" == "efi" ] ; then if test -e /boot/addons/netboot.xyz.efi ; then menuentry "Netboot.xyz" { chainloader /boot/addons/netboot.xyz.efi } fi else if test -e /boot/addons/netboot.xyz.lkrn ; then menuentry "Netboot.xyz" { insmod linux16 linux16 /boot/addons/netboot.xyz.lkrn } fi fi }