Ubuntu should install mach_kernel and System directory in boot/EFI like Fedora 24 and fallback.efi for EFI-32

Bug #1647184 reported by Jack Howarth
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
unity (Ubuntu)
New
Undecided
Unassigned

Bug Description

While looking at the various Linux distributions as a replacement OS on a MacBook Pro 2,1 with EFI-32, I was pleasantly surprised that Fedora 24 could produce a bootable system on an internal disk which was partitioned as MBR with just a single spare partition of empty space. The ability to boot the installed Fedora without retaining an OS X partition with rEFind installed is due to Fedora installing their own fake mach_kernel file and populated System directory in the /boot partition. The Fedora 24 installer appears to be implementing the approached described in....

http://askubuntu.com/questions/563401/efi-boot-ubuntu-14-04-on-a-mac-without-refind

automatically for the benefit of Mac owners who have legacy hardware that they wish to repurpose since the OS support has lapsed from Apple itself.

The second issue here is the fact that the x86_64 Fedora 24 is capable of booting on an EFI-32 Mac. This seems likely to be due to the presence of a failback.efi file but I will check with the Fedora developers to confirm that is the fix they used. This would be useful not only to Mac owners but any PC owners who have motherboards with only EFI-32 support.

Revision history for this message
Jack Howarth (jwhowarth) wrote :

FYI, I strongly urge the interested Ubuntu developers to carefully read the following thread in the fedora-devel mailing list where the Fedora developers discuss the specific changes made and known behaviors of booting on EFI-32 with Fedora 25...

https://<email address hidden>/thread/MIEEDTX5QXIK6S6TGIMZNIUMBAJ6PTUT/

I think there are some nuggets in there.

Revision history for this message
Jack Howarth (jwhowarth) wrote :

After struggling this for the better part of a week, the best solution I have found is to abandon the Ubuntu 16.10 installers entirely and use debian-8.6.0-amd64-i386-netinst.iso which works perfectly on a MacBook Pro 3,1. A workable approach I believe is to do as bare-bones an installation as possible in Debian Jessie followed by swapping out the /etc/apt directory for one from Yakkety and then doing an 'apt-get update' and 'apt-get dist-upgrade'. The last step is to manually search for all of the packages installed that not part of the Ubuntu repo and deinstalling them.

For the next release, you seriously need to consider rolling an equivalent installer ISO as the Debian amd64-i386-netinst.iso. In fact, it is only

$ ls -l debian-8.6.0-amd64-i386-netinst.iso
-rw-r--r-- 1 howarth howarth 584056832 Dec 7 18:08 debian-8.6.0-amd64-i386-netinst.iso

so you might consider swapping out the existing Yakkety net installer with a similar multi-arch copy.

Revision history for this message
Jack Howarth (jwhowarth) wrote :

err, that should have been MacBook Pro 2,1

Revision history for this message
Jack Howarth (jwhowarth) wrote :

I finally got this to work. The only real requirement for this to work is the the a boot partition that is FAT32 was exist for the Mac EFI firmware to see and that this partition must contain the fake mach_kernel file and a System/Library/CoreServices/SystemVersion.plist file containing...

<xml version="1.0" encoding="utf-8"?>
<plist version="1.0">
<dict>
    <key>ProductBuildVersion</key>
    <string></string>
    <key>ProductName</key>
    <string>Linux</string>
    <key>ProductVersion</key>
    <string>Arch Linux</string>
</dict>
</plist>

The Fedora installer automatically places those files on their installed /boot partition which is why they produce an installation on Macs which is bootable. I was able to reproduce this with the Debian Jessie multi-arch installer (debian-8.6.0-amd64-i386-netinst.iso) which is required for the MacBook Pro 2,1's EFI-32 firmware. Ubuntu needs to use that approach for their next release. It is described at https://wiki.debian.org/UEFI

Support for mixed-mode systems: 64-bit system with 32-bit UEFI
Some systems have been released containing 64-bit Intel Atom CPUs (such as the Bay Trail), but unfortunately use 32-bit UEFI firmware with no BIOS compatibility mode. Using the 32-bit UEFI x86 support, an i386 installation should be possible on these machines but it won't make the most of the 64-bit hardware.

Debian Jessie (8.0) was the first Linux distribution to include full support for mixed-mode UEFI installation on these machines. The multi-arch installation media (available in netinst and DVD form) include the UEFI boot loaders necessary for both i386 and amd64 boot. By selecting "64-bit install" from the initial boot menu, debian-installer will install a 64-bit (amd64) version of Debian. The system will automatically detect that the underlying UEFI firmware is 32-bit and will install the appropriate version of grub-efi to work with it.

The Debian Jessie required the mach_kernel and file to be placed at /boot/efi however because their installer mounts the FAT32 boot partition at the /boot/efi directory level rather than at the /boot level like Fedora.

Note that there appears to be no require to place a boot.efi file at the System/Library/CoreServices directory level as described elsewhere on the net. I suspect that requirement is only present if you use a HFS+ filesystem for the boot partition. However that approach requires that the System/Library/CoreServices/SystemVersion.plist file be explicitly blessed with hfs-bless from the mactel-boot package. This is and the requirement for Journaling to be disabled on the HFS+ volume for the Apple diskutil program makes it more onerous to implement than the simplier FAT32 approach.

Revision history for this message
Jack Howarth (jwhowarth) wrote :

I have crafted a update-efi-booter script which automates the booting approach described in http://courses.cms.caltech.edu/cs171/materials/pdfs/How_to_Dual-Boot_OSX_and_Ubuntu.pdf where the /boot/efi partition on Macs are kept as HFS+ so that the boot selector can be made aware of the bootable boot.efi stored at /boot/efi/System/Library/CoreServices along side SystemVersions.plist there and /boot/efi/mach_kernel. Hopefully this can find its way into the mactel package set in some form.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.