This assumes you have a currently installed working linux on another partition or disk.
In the MacOS installation as root:
diskutil mount disk0s1
ls /Volumes
in /Volumes
there should be a new mount called EFI or something like that. It could also be called NO NAME
... regardless its interior folder structure will look like this:
/Volumes/EFI
├── EFI
│ ├── Boot
│ └── GRUB
└── grub
├── fonts
├── locale
├── themes
│ └── starfield
└── x86_64-efi
Create a folder named Boot in /Volumes/EFI/EFI
mkdir /Volumes/EFI/EFI/Boot
Somewhere in /Volumes/EFI/EFI
there should be a grubx64.efi file, perhaps in a subdirectory folder named GRUB or whatever linux distro it was installed by. Copy grubx64.efi to /Volumes/EFI/EFI/Boot
. In the new folder, it needs to be renamed to 'bootx64.efi'.
cp /Volumes/EFI/EFI/GRUB/grubx64.efi /Volumes/EFI/EFI/Boot/bootx64.efi
Optionally, you can use an iconset (.icns file) to make the menu items for the boot options have logos. There's a common set many people use at https://sourceforge.net/projects/mac-icns which might be the same ones used in boot managers like rEFInd or rEFIt. Place the .icns you want in /Volumes/EFI
as .VolumeIcon.icns
Don't forget to unmount the volume:
diskutil umount disk0s1
Reboot into the boot menu.