Blog /Fedora 19 on a White MacBook

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

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
White/2.16/2x1G/120/SD/AP/BT-NLD
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:

1.
2.
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/boot.cat -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.

Comments

chrisfargen
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).

tz
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).

Daniel
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.

Nico
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"

Nico
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 :-)

Rob
27 Oct 2019, 4:04 p.m.  | 

Hello Daniel, thank you for the tutorial; it got me at least to the point I can start booting the macbook from the DVD.

Anyway, I got stuck a little further down the road: I try to install Linux Mint which is Ubuntu-based. Followed your tutorial from within Virtualbox with Linux Mint 19.2 Cinnamon 64-Bit and burned a DVD that actually starts booting on my Macbook (2007).

BUT: During the boot-process I get the error message "(initramfs) Unable to find a medium containing a live file system".

I googled this and got the info that it means SATA drivers would be missing from the install-DVD…?!

I am lost here – if you have any hints, it'd be great!!

Best regards from Germany, Rob

Daniel Quinn
28 Oct 2019, 12:53 p.m.  | 

Hi Rob, I'm not exactly a pro when it comes to this stuff. As you can see, this post is rather old and I've long (responsibly) discarded the Macbook --they're more trouble than they're worth.

With that said, a message like (initramfs) Unable to find a medium containing a live file system sounds like your temporary boot environment is looking for a filesystem with a proper OS. So I'd start looking at your partitioning scheme:

  • Can you boot off a USB stick and mount your OS partition?
  • Is it marked bootable in fdisk?
  • Some rescue USB sticks will let you boot from a partition already on the system. Does this work?
  • Is there a rule about partitioning scheme for Macs? I know the new UEFI-based systems require that you partition with GPT instead of MSDOS for example.

...outside of that, I suggest you ask StackOverflow or ServerFault. You'll find more qualified people there.

Good luck!

Name required
26 May 2021, 5:29 p.m.  | 

I know this is a bit late, Rob, but the solution is editing the boot options with root=(path to squashfs) rootfstype=squashfs.

Example: I'm booting Zorin Lite live CD image, which has the main disc image found at /casper/filesystem.squashfs, so my boot options are (... boot=casper root=/casper/filesystem.squashfs rootfstype=squashfs --- initrd=...)

Hope this helps someone, this is the most comprehensive guide I've managed to find for booting an Ubuntu LiveCD on old 32-bit EFI iMacs/Macbooks.

Post a Comment of Your Own

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