Skip to content

Instantly share code, notes, and snippets.

@schmonz
Last active December 3, 2022 21:45
Show Gist options
  • Save schmonz/b1c7fe7c8f784f07de117a08412e3268 to your computer and use it in GitHub Desktop.
Save schmonz/b1c7fe7c8f784f07de117a08412e3268 to your computer and use it in GitHub Desktop.
64-bit Ubuntu on MacBook2,1 with 32-bit EFI

A year later, I think (but can't be sure I'm remembering correctly) that I did this with Ubuntu 21.10.

Prepare

  1. Download Ubuntu install 2. Using Rufus for Windows, write it to a USB stick
  2. Remove rEFInd from the old Mac
  3. Download bootable-CD rEFInd 2. Using Rufus for Windows, write it to a USB stick
  4. Download a special bootia32.efi
    • Copy it into the Ubuntu installer's /EFI/BOOT
  5. On target Mac, boot OS X:
    • Mute internal speaker
    • Make recovery disk

Install OS

  1. Insert both USB sticks
  2. Reboot, holding down Option
    1. Choose "EFI Boot" for rEFInd
    2. Choose "bootia32.efi" for GRUB
    3. Choose "Install Ubuntu" from GRUB
  3. Install Ubuntu to the internal drive
    • "Guided - use entire disk"
    • Installing GRUB to /dev/sda will fail, no biggie

Make it bootable

  1. Reboot, holding down Option
    1. Choose "EFI Boot" for rEFInd
    2. Choose "bootia32.efi" for GRUB
    3. In GRUB:
      • linux /boot/vmlinuz«tab».efi.signed root=UUID=«the UUID of the drive with /boot»
      • initrd /boot/initrd«tab»
  2. Prepare: 7. sudo add-apt-repository ppa:detly/mactel-utils 7. sudo apt-get update 7. sudo apt-get install mactel-boot hfsprogs gdisk grub-efi-ia32
  3. Reformat EFI partition: 7. sudo umount /dev/sda1 # Replace /dev/sda1 with your EFI partition node! 7. sudo gdisk /dev/sda - d - 1 - n - 1 - <accept defaults - AF00 - w 7. sudo mkfs.hfsplus /dev/sda1 -v Ubuntu
  4. Update /etc/fstab 7. Remove any lines about /boot/efi 7. sudo bash -c 'echo $(blkid -o export -s UUID /dev/sda1) /boot/efi auto defaults 0 0 >> /etc/fstab'
  5. Remount EFI partition: 7. sudo mount /boot/efi
  6. Install GRUB:
    • sudo mkdir -p "/boot/efi/EFI/$(lsb_release -ds)/"
    • sudo bash -c 'echo "This file is required for booting" > "/boot/efi/EFI/$(lsb_release -ds)/mach_kernel"'
    • sudo bash -c 'echo "This file is required for booting" > /boot/efi/mach_kernel'
    • sudo grub-install --target i386-efi --boot-directory=/boot --efi-directory=/boot/efi --bootloader-id="$(lsb_release -ds)"
    • sudo hfs-bless "/boot/efi/EFI/$(lsb_release -ds)/System/Library/CoreServices/boot.efi"
    • sudo update-grub
  7. Replace bootloader icon:
    • sudo apt-get install mactel-boot-logo
    • sudo cp /usr/share/mactel-boot-logo/ubuntu.icns /boot/efi/.VolumeIcon.icns
  8. Remove any old bootloader entries and set 0-second timeout:
    • sudo efibootmgr
    • sudo efibootmgr -t 0
    • sudo efibootmgr -b 0000 -B
    • sudo efibootmgr -b 0080 -B
    • sudo efibootmgr -o 0001

Enjoy

Power on, load 32-bit EFI, boot right into the internal EFI partition's GRUB.


Primary source: https://ubuntuforums.org/showthread.php?t=2287767
Secondary: https://heeris.id.au/2014/ubuntu-plus-mac-pure-efi-boot/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment