32-Bit UEFI Boot Support

Ubuntu 15.10 supports 32-bit EFI. The 32-bit version will, in fact, automatically install a 32-bit EFI bootloader. Unfortunately, Canonical doesn't offer a bootable 32-bit ISO that has an EFI bootloader in the DVD image. So, we must create the install disk ourselves.

Other instructions try getting 64-bit Ubuntu to run and install. This probably comes from a misconception that EFI requires a 64-bit OS. This is false. In fact, the bitness of the EFI is meant to be tied to the bitness of the OS. Most PCs are designed for 64-bit OSes and therefore have 64-bit EFIs. However, cheap PCs designed for a 32-bit OS have 32-bit EFI.

Keep in mind, however, that Ubuntu (or rather, its Linux kernel) doesn't fully support the hardware in the systems which typically ship with 32-bit EFI BIOSes (cheap Intel Atom SoCs). WiFi, sound, and power management often do not work. Patched third-party kernels that fix some of the issues do exist, such as those made available here.

To prepare an Ubuntu 32-bit install drive with an EFI bootloader:

  • Download both 32bit and 64bit Ubuntu ISOs. (Tested with Ubuntu 15.10)
  • Download a multi-arch Debian ISO. (Tested with Debian 8.2.0 netinst ISO)

  • Format your USB disk as FAT and mount it

    • In Gnome Disks, select the USB drive in the left list, go to the "Hamburger Menu" in the upper-right corner, choose Format Disk, select MSR/DOS partitioning, and Format. Then click '+' and accept defaults which should create a FAT partition. Finally, click the "play" triangle to mount it.
  • Extract installation files from the Ubuntu 32-bit ISO while copying the contents of the symlinks
    • In Gnome Disks, open the Disks menu (up where File and Edit normally are), choose Attach Disk Image, select ubuntu-15.10-desktop-i386.iso, and mount the biggest partition.
    • In Terminal, rsync -rL --exclude=/ubuntu <path to Ubuntu 32-bit install disk>/ <path to usb disk>/
      • Replace <placeholders> with the correct paths
      • Don't forget the slash at the end of the source path
  • Copy /boot and /EFI directories from an Ubuntu 64-bit ISO
    • Mount the iso
    • rsync -r <path to Ubuntu 64-bit install disk>/boot/ <path to usb disk>/boot/
    • rsync -r <path to Ubuntu 64-bit install disk>/EFI/ <path to usb disk>/EFI/
      • Again, the slashes at the end are significant
  • Copy 32-bit GRUB from a Debian multi-arch ISO
    • Mount the iso
    • cp <path to Debian multi-arch install disk>/efi/boot/bootia32.efi <path to usb disk>/EFI/BOOT/
    • rsync -r <path to Debian multi-arch install disk>/boot/grub/i386-efi <path to usb disk>/boot/grub/
      • Watch those slashes (this time the source doesn't end in a slash)
  • Rename vmlinuz to vmlinuz.efi
    • mv <path to usb disk>/casper/vmlinuz <path to usb disk>/casper/vmlinuz.efi
  • Unmount everything
  • Disable Secure Boot on target system and boot from the USB drive.
  • Install Ubuntu! (I've tested with "Erase disk and encrypt it with LVM" option and the install works automatically--unless the kernel doesn't support the flash chips in the device.)
  • System should be "ready." It will boot, but actually it may not be very functional due to lack of drivers (as of Ubuntu 16.04). Check out this Google+ group for more advice and latest patched kernels.

Broadly speaking, if you need to install Ubuntu (or any other Linux distribution) on a computer with a 32-bit EFI and no BIOS/CSM/legacy-mode boot support, the way to do it is:

  1. Use unetbootin or something similar to prepare an installation USB flash drive. (It's possible to get it to work with a CD-R, but this takes more work.)
  2. Choose an EFI-mode boot loader for Linux. I recommend ELILO, Fedora's patched GRUB Legacy, rEFInd, or gummiboot because they're relatively easy to set up manually. GRUB 2 is far too difficult to configure manually, and SYSLINUX is too new.
  3. Research your chosen boot loader's configuration file format and its needs in terms of kernel location.
  4. Check the original CD image to find its boot loader configuration. You need to know what options are being passed to the kernel by the boot loader.
  5. Add an EFI/BOOT directory to a FAT partition on the USB flash drive that now holds your Linux image. Ideally, this partition should be an ESP (that is, have a "boot flag" set in parted or have a type code of EF00 in gdisk if the disk uses GPT; or have a type code of 0xEF in fdisk if the disk uses MBR), but some ESPs can cope without that. If the disk doesn't have a FAT partition, you'll need to create one
  6. Copy your chosen boot loader's binary file (with a name that ends in .efi) to the EFI/BOOT directory on the USB flash drive, and rename it to bootia32.efi -- that is, it should be EFI/BOOT/bootia32.efi. Be sure to copy the 32-bit version of the boot loader!
  7. Install any support files that the boot loader needs, such as drivers, images, modules, and configuration files. In some cases (such as ELILO and gummiboot), you'll need to copy your kernel and initrd file to the FAT partition that holds the boot loader.
  8. Edit the configuration file(s) for your boot loader so that it can launch the kernel with the options you identified earlier by examining the BIOS-mode boot loader's configuration.
  9. Reboot to test the boot loader.

With any luck it will work and you'll be able to install everything. I can't guarantee that Ubuntu will install a 32-bit EFI boot loader, though. If not, you'll need to boot an emergency system and set that up manually, too. You may also need to debug something, particularly if unetbootin (or whatever you use) doesn't set up the flash drive in the optimal way.

Of course, this description is fairly vague about the critical detail of configuring the boot loader. This is because I haven't done it recently (although I have in the past), and the details vary depending on what boot loader you choose.