How to add chainload binary entry to GRUB2 boot menu?

I’m using Ubuntu 22.04 LTS, which came with memtest86+ v5 that does not support UEFI.

I’m trying to install memtest86+ v6 on Ubuntu 22.04 LTS and I downloaded its binary here.

I moved memtest64.efi to the EFI partition and added the following to /etc/grub.d/40_custom

menuentry 'Memtest86+ v6' {
  insmod part_gpt
  insmod fat
  set root="hd0,gpt1"
  chainloader (\$root)/EFI/memtest64.efi
}

Then ran update-grub. The entry showed on boot menu, but when I enter it:

Error: No Server is Specified

From GRUB console, I’m certain that hd0,gpt1 is the EFI partition.

Alternatively, I want GRUB to boot Memtest86+ from /boot folder, but I have no idea how to make GRUB find /boot.

To keep things neat, I’d prefer everything done inside /etc/grub.d/40_custom

Read more here: Source link