Blog /Fedora 19 on a White MacBook

July 18, 2013 16:24 +0000  |  Apple Linux 10

The end result

The colour is relevant you see. This is how Mac people tell their hardware apart. "Not the grey one that came out in 2010, but the silver one that was released in 2011"... or whatever.

For the sake of those who might search for something like this post, the specs of this particular MacBook are:

Serial No: W872632DYA8
EMC No: 2139

The backstory

I recently acquired an older MacBook as part of an experiment and learning experience. Either that or an attempt at self-flogging. You see, I'm forced to use a Mac at work (though thankfully they let me use Linux on it), but my understanding of how to get Linux installed and working on a Mac is still pretty limited, so I picked up one of these to try to turn it into a simple file server. This post is the result of that torturous process experiment.

So here's the deal: the firmware on the white MacBooks is broken, placing it in a unique and problematic position:

The Problem

blinking question mark

Older CDs that do not support EFI

These will boot on the Macbook, but won't be able to install an EFI-aware bootloader so when you're all finished you end up with a blinking folder with a question mark on it (see image)

Newer CDs that support EFI

These will hang with the super-awesome-and-totally-useless prompt:

Select CD-ROM Boot Type:

Searching for this returns all manner of panicked mac users and clueless Windows users trying to figure out what they did wrong and very little helpful information regarding why an ISO that boots just fine on normal computers will just flake out like this on a mac.

Bootable USB sticks

These just won't boot at all.

My attempts

A lot of the how-tos out there point you to rEFIt, which is now defunct, replaced by rEFInd. Both of these projects aim to allow for dual-booting, which I didn't care about, and neither solves the problem above. All you get is a a dual-boot environment with one of those environments refusing to boot.

It turns out though that if you spend enough days, and enough distributions (I started with Gentoo, then Fedora, then Gentoo again, back to Fedora), you will eventually stumble upon what you need. In my case it was the 22nd comment in a bug report to the Fedora mailing list. It explained that the Macbook firmware was broken, and the only work around is to rebuild the install cd without EFI support, which would force the MacBook to revert to BIOS mode, boot the disc, and from there do what you need to install an EFI-friendly bootloader.

In other words, the MacBook was broken, but Apple didn't care because their software works just fine on broken firmware. If you want to use it anyway, you have to break your software to play along.

That's roughly 7days of pain I've saved you. You're welcome.

The actual solution

So enough with the griping. Here's what I had to do to make this work:

# Download a Fedora ISO and mount it (as root) to somewhere convenient
mount -o loop Fedora-Live-Desktop-x86_64-19-1.iso /mnt/floppy

# Create a temporary place to copy the disk data
mkdir /tmp/image
cp -a /mnt/floppy/* /tmp/image

# Create a new ISO, stripping out all of the stuff that confuses the MacBook
mkisofs -r -b isolinux/isolinux.bin -c isolinux/ -no-emul-boot -boot-load-size 4 -boot-info-table -V Fedora-Live-Desktop-x86_64-19-1 -o /tmp/fedora.img /tmp/image/

# Burn that baby to a new disc
cdrecord /tmp/fedora.img

You may still run into problem where the boot process complains about not being able to find the disk labelled "Fedora-Live-Desktop-x86_64-19-1" or whatever you've downloaded. If this happens, you'll be dumped into an emergency shell where you can find out what the CD is calling itself these days:

# ls -l /dev/disk/by-label/

You should see the name of your CD in there, take note of it, reboot, and at the very first screen where it asks you if you'd like to install Fedora, hit tab to edit the options, and change the relevent portion of the command to use the appropriate disk name.

And that's it. I now have Fedora running on my MacBook, which isn't ideal, since I would have preferred Gentoo, but since this is already 7days of my life I won't get back, I'm going to stop here and be happy.


11 Nov 2013, 2:09 p.m.  | 

Exactly what I needed for my Macbook 2,1, which is white and came out in 2007. Thanks for taking the time to document the solution.

Dan Weber
11 Jan 2014, 10:51 p.m.  | 

So the problem with this is that the commands need to be run from a linux machine. If your machine already has OSX on it & you are just trying to utilize an old machine, but don't have another machine running linux (only other Macs in my case), this method fails. So basically you end up having to install linux as a virtual machine, running these commands & then installing Linux again.

Daniel Quinn
13 Jan 2014, 2:09 p.m.  | 

@Dan Webber actually, these commands should work in any *nix environment including on a Mac. You'll need to have the tools installed though, specifically mkisofs and cdrecord. On a Linux system, these are usually part of the same package, and on a Mac, you can probably get these via Homebrew or even MacPorts.

Diego E
2 Feb 2014, 2:11 a.m.  | 

Daniel it seems that mounting the image on OSX uses the HFS visible partitions, which I understand is part of the trick to have EFI+BIOS hybrid images.

Maybe you could describe the contents you saw after mounting the ISO (to make sure we are doing the same thing).

3 Feb 2014, 4:12 p.m.  | 

The "label" is given in the /EFI/BOOT./grub.cfg command line, with root=LABEL=Fedora-whateveritis

You might be able to edit that to say "root=/dev/sr0" instead of the label stuff (paralleling the uuid v.s. /dev/sdN for disks).

3 Feb 2014, 4:18 p.m.  | 

@Diego sorry dude, it's been nearly 7months, and I have little memory of what was in there. As best I can recall it was your basic *nix root: bin, boot, usr, etc.

@tz That's a pretty good idea. Next time I blow away that laptop and reinstall something (probably Gentoo), I'll give that a shot.

Diego E
4 Feb 2014, 4:11 a.m.  | 

Thanks for the reply Daniel, I finally recalled how the heck I got it working a few months ago.

I only had to use the Startup Disk panel on System Settings. I'm on a MacBook3,1 (black, late 2007) so YMMV.

Wrote about it: link

Thanks for your post, hope we are not the only ones who meet success on this "historic journey" :-P.

4 Jul 2016, 5:38 a.m.  | 

Lifesaver! Thanks a lot.

A minor comment: On the mkisofs command it should be -V (capital V) not lower case v, as -v is "verbose" whereas "-V" is "volume label"

4 Jul 2016, 5:38 a.m.  | 

Also, if you want to check the label of the previously downloaded ISO you can do with isoinfo -d -i /path/to/file.iso

Daniel Quinn
4 Jul 2016, 3:06 p.m.  | 

Thanks Nico! Fixed :-)

Post a Comment of Your Own

Markdown will work here, if you're into that sort of thing.