BootstrappingDistributions
From Mactel-Linux
NOTE: The author(s) of this document are not responsible for any damage to your computer based on these instructions! You are ultimately responsible for any damage caused as a result of these instructions.
This document covers bootstrapping various Linux distributions onto an Intel Mac, from start to finish, but assumes some existing level of knowledge of things like formatting partitions and mounting devices.
Note that these instructions include removing the current installation of OSX. You will lose any data currently stored on the involved machine. It does provide a provision for providing dual-boot, but, even so, this involves removing the existing operating system.
Contents |
What (hardware) you will need
- An existing Linux system with firewire.
- An Intel Mac (system B)
- A firewire cable.
What (software) you will need
- rEFIt
- Linux Kernel and ELILO
- MacOS X is recommended (on *any* Mac, even an PPC machine)
A 10-step guide to installation
1. Modify the original ReFIT disk image, adding the Linux kernel, and ELILO underneath "efi/linux/". Burn this image to a CD or write it to a USB key. Note that this may be easiest done under Mac OSX as to retain the blessed executables on this filesystem, the author has not tried this under Linux (yet)
The Linux kernel and elilo can be downloaded from [[http://www.mactel-linux.org/ the mactel-linux webpage]], please note that *currently* one will need to compile their own kernel to support the Minis.
2. Connect systems A and B with a firewire cable and start the Intel Mac (system B) in target disk mode. This can be accomplished by booting with the letter 'T' held.
3. Assuming that system A sees system B's disk as '/dev/sda' (check 'dmesg' if you're not certain), execute the following command to backup the existing EFI partition -- just in case:
dd if=/dev/sda1 of=/usr/src/efi.backup.img
4. Use 'parted' to modify the partitions on the Mac's disk, removing partition #2 (Mac OSX) and creating new partitions for the EFI boot loader (#2), Linux swap (#3), and the root FS (#4). DO NOT delete or modify partition #1 (minor 1). You may create a 5th partition for Mac OSX if you wish, but you will need to perform a fresh installation from the OSX cds.
Example, removing default OSX partition and adding a 128mb boot partition, a 1024mb swap partition, and finally filling the rest of the (60gb) disk with an ext3 filesystem - % parted /dev/sda (parted) rm 2 (parted) mkpart primary 200.020 328 (parted) mkpart primary 328 1352 (parted) mkpart primary 1352 57103.542 (parted) quit
5. Format and mount the root FS onto /mnt/target, format the swap partition.
Example: % mkfs.ext3 /dev/sda4 % mkswap /dev/sda3
6. Bootstrap your OS into the partitioned space.
For RPM Based Systems: * Download and install [rpmstrap] * Execute: "rpmstrap --arch i386 [suite] /mnt/target" Use the suite 'stentz' for Fedora FC4, or 'centos4' for CentOS 4. A full list of suites can be found by executing "rpmstrap --list-suites"; The rpmstrap program supports installation of Fedora Core 2, Fedora Core 3, Fedora Core 4, CentOS 3, CentOS 4, Mandriva and Scientific Linux systems.
For Debian Based Systems: FIXME Provide instructions for using debootstrap and/or cdebootstrap. current recommendation is for users to locate independent documentation.
For Gentoo: A stage-3 Gentoo installation should be fairly straight-forward from this point. At least for as straight-forward as Gentoo installations can be... Please refer to [this chapter] of the Gentoo Handbook
7. Unmount /mnt/target/proc and /mnt/target
8. Cross your fingers.
9. Press the power button on the Mac to leave Target Disk Mode.
10. Power up the Mac! (connecting USB key or CDROM created in step 1)
Homework: OPTIONAL & UNTESTED: Use dd to write the disk image created in step 1 to the EFI boot loader partition (#2) created in step 4. Note that this should NOT be copied to the first partition (#1), but to a new partition that should have been created.
Troubleshooting
My system is hanging after successfully mounting the root device
You've likely installed a 64-bit OS onto the system, which has a 32-bit processor. Make sure to download and install an 'i386' OS.
My Mac no longer boots, even with the MacOS X Install CD
This answer is a theory -- I haven't yet, and don't plan to try this personally...
Two options: 1. Take the hard drive out of the machine, connect it to another Intel Mac... and run Disk Utility. 2. Take the harddrive out of the machine, connect it to a Linux machine... use 'parted' to create new partitions, use 'dd' to restore the efi.backup.img file created earlier.
Idea : put an efi.backup.img for poor people having transformed their mac into a brick without having made this backup (bad bad boys...)
My video is garbled
Edit the elilo.conf file to specify the correct video driver. Choose from: i17, i20, and mini.
Authors
- Eric Windisch (ewindisch) - Original author
Special Thanks
- Gimli and the rest of the mactel-linux.org crew for developing the kernel changes to make this all possible.

