GUIDE: LFS 6.2 and OS X on a Mac Pro.
This guide explains how I installed LFS 6.2 and OS X in a dualboot configuration on a Mac Pro. This is not a 'copy-paste' tutorial and I strongly advice to read all the links that are given before diving head first into trying this.
Certain entries I will mention are explained in detail on the pages I refer to, I will not go into those, except if certain steps are done differently. The other parts of this guide show detailed information about all the software, hardware and .config that was used.
WARNING: The steps taken in this guide will destroy all data on your disk(s). Make sure you have a backup of all that is important to you.
--- Step 1:
Install/Check OS X
- (re-)Install OS X.
I re-installed OS X (a very basic install). The only reason for this is that I'm only going to use OS X to get the firmware updates that come available. It will also save some disk space, which could be important for those with a single, 'small' disk.
OS X should be installed on one single partition (all the space available, this is default when installing OS X) and it should be a mac os extended (journaled)
partition. Re-partitioning, to have partitions for Ubuntu and LFS, is done at a later stage.
- Update OS X and firmware.
- Install Boot Camp.
- Install rEFIt.
After restarting OS X, rEFIt should be present.
--- Step 2:
Re-partition using OS X (part 1)
Show current partition layout after an OS X install:
Use diskutil list
(from a terminal):
/dev/sda1 -> EFI (disk0s1)
/dev/sda2 -> Mac OS X (disk0s2)
Intended partition layout:
/dev/sda1 -> EFI (fixed) (disk0s1)
/dev/sda2 -> Mac OS X (disk0s2)
/dev/sda3 -> LFS (disk0s3)
/dev/sda4 -> Ubuntu (disk0s4) (temporary base for LFS)
Using apple's diskutil, /dev/sda2 - disk0s2 is split ('resized') into 3 partitions:
diskutil resizeVolume /dev/disk0s2 XXG Linux LFS YYG Linux Ubuntu ZZG
Substitute XX, YY and ZZ with the amount of disk space wanted/needed.
Do NOT reformat using diskutil
, reformatting is done at a later stage (during Ubuntu install).
I have 2 disk, so I decided to put the swap partition (and some other partitions) on the second disk and use the Ubunbtu partition as a 'data' partition after LFS is installed and Ubuntu is removed. In theory you can use the Ubuntu partition for swap, after using gparted to resize the LFS partition and the Ubuntu/swap partition. I haven't tried this myself.
Check the new layout (with diskutil list from a terminal).
--- Step 3:
Boot from the Ubuntu livecd.
I used rEFIt to do this, not the 'chime, hold down the C key (to boot from CD)' combo. The end result is probably the same, but I did not try the latter.
After Ubuntu is up and running set up the network
(if needed), a working ethernet is a must.
Format both linux partitions using parted (from the menu, no need to do this from a terminal). I had problems using parted from the installer to format the none OS X partitions. Using parted _before_ starting the installer solved this problem.
When the installer asks for the mount points remove the /mount/EFI entry from the list.
/ should be connected to /dev/sda4. /dev/sda3 isn't used yet, so there's no real need to mount it.
The Ubuntu installer will crash when it tries to install grub. Don't worry this is normal and can be ignored.
The Triple Boot via BootCamp Ubuntu
link can be used for the remainder of the Ubuntu install (Start at: Boot off of the Ubuntu installation disc. The majority of the Ubuntu install.....).
Heads-up: The link provided uses /dev/sda3 for Ubuntu, this guide uses /dev/sda4.
After a reboot you should end up with a dual boot (OS X - Ubuntu) system. I had the same problem as described in the above link (had to boot 2 times into OS X before lilo 'fixed' itself and alowed me to boot into Ubuntu).
To be able to install LFS some extra Ubuntu packages are needed:
install: gawk, bison and build-essential.
--- Step 4:
Installing LFS is straight forward. The only things I encountered where the missing base system packages (gawk, bison and build-essential). After installing those all went like a charm.
Do not install grub and the default kernel (18.104.22.168).
Install LFS 6.2
--- Step 5:
Install bin86 and lilo
Instead of grub, install lilo. Lilo depends on the bin86 package, this package needs to be installed as well.
I encountered some errors (devmapper) when running /sbin/lilo -b /dev/sda3. I decided to ignore these, they did not seem to point to /dev/sdaX errors.
--- Step 6:
Install kernel 22.214.171.124
Unpack the 126.96.36.199 kernel in /usr/src.
chown -R 0:0 <kerneldir>
Enter the newly created directory and execute the following commands:
This was one of the hard parts. It took some 'trail and error' before I had a setup that actually booted. At the end of this guide I've included the complete .config that seems to work.
I personally like my kernels as static as possible (I'm not a big module fan). I'm still working on the kernel so the one at the bottom of this guide is a bit of a mix between static and modular. Adjust to your liking.
cp -v arch/i386/boot/bzImage /boot/lfskernel-188.8.131.52
cp -v System.map /boot/System.map-184.108.40.206
cp -v .config /boot/config-220.127.116.11
ln -s /boot/lfskernel-18.104.22.168 /boot/vmlinuz
ln -s /boot/System.map-22.214.171.124 /boot/System.map
The following commands only need to be executed once:
install -d /usr/share/doc/linux-126.96.36.199 &&
cp -r Documentation/* /usr/share/doc/linux-188.8.131.52
I strongly suggest to copy the working kernel and add an extra entry to lilo.conf so you can always fall back to that one in case something goes wrong when tuning/editing your current kernel.
cp lfskernel-184.108.40.206 lfskernel-220.127.116.11.working
cp System.map-18.104.22.168 System.map-22.214.171.124.working
cp config-126.96.36.199 config-188.8.131.52.working
Add the following part to your lilo.conf:
That's it folks, the other parts of this guide hold information about the software, hardware and .config that was used.
(there seems to be a newer version available, I used 0.8).
OS X 10.4.9: Install disk(s) that came with the box. Full upgrade after install.
Ubuntu (dapper/6.06): Full upgrade after install from Ubuntu livecd, (desktop/6.06)
Ubuntu extra: run LFS's version-check.sh
Bison and 'build-essential' are not in the list, but are both needed.
LFS 6.2: Packages
LFS extra: lilo 22.8
, kernel 184.108.40.206
LFS not used: Grub, kernel 220.127.116.11