1

I'm wondering how I can manipulate the boot menu on a Mac to add an option for a "Ubuntu ISO". To be 100% clear as I can see the non-answers coming, I am not looking to install Ubuntu, but just boot the ISO from the HD. From what I have researched I need to use efibootmgr from inside a Linux Distro to manipulate the boot options.

For example this would be what I would do with Grub:

sudo nano /etc/grub.d/40_custom && sudo update-grub2
 menuentry "Ubuntu ISO" {
        set isofile="/home/isos/ubuntu.iso"
        loopback loop $isofile
        linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=$isofile noprompt noeject toram
        initrd (loop)/casper/initrd.lz
}

But I need something like:

https://wiki.gentoo.org/wiki/Efibootmgr#Creating_a_boot_entry

efibootmgr -c -d /dev/sda -p 2 -L "Gentoo" -l '\efi\boot\bootx64.efi' -u 'root=/dev/sda3 initrd=\efi\boot\initramfs.img quiet'
FreeSoftwareServers
  • 1,129
  • 1
  • 14
  • 32

1 Answers1

1

Not sure how MacBook works with EFI, but EFI can only boot only specific executable files on EFI partition without parameters. It can not boot from ISO files. Here is the way to use grub to run Ubuntu from ISO files:

  1. Create a 10GB rescue partition.
  2. Format it as ext4. Label and enter name "rescue".
  3. Create the grub.cfg file in Linux

    $HOME/grub.cfg:

    menuentry "Rescue Ubuntu 18.04 LiveCD" 
    {
      set isoname="/ubuntu-18.04.3-desktop-amd64.iso"
      search --label --set rescue rescue
      loopback loop ($rescue)$isoname
      linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isoname quiet splash
      initrd (loop)/casper/initrd
    }
    
  4. Create a standalone grubx64.efi with memdisk and the needed modules

    Creates binary with modules and grub.cfg embedded:

    grub-mkstandalone --modules="minicmd normal search search_fs_file search_fs_uuid search_label ext2 echo cat ls disk part_gpt part_msdos" \
    -o grubx64.efi \
    -O x86_64-efi --compress=xz \
    "/boot/grub/grub.cfg=$HOME/grub.cfg"
    
  5. Create an entry in the EFI boot manager and place grubx64.efi inside the new entry. Add all other files EFI expects (BOOTX64.CSV, shimx64.efi, mmx64.efi).

Eliah Kagan
  • 119,640
huksley
  • 19
  • 1