Linux on MacBook Pro (Late 2008) - Unibody

Many UNIX users might want to have linux alongside Mac OS X to enjoy the complete freedom and some, like me, would like to make use of the full hardware power of MacBook Pro without paying some extra ransom to Apple!!

As Mac OS X being a UNIX platform, it offers a almost rock solid OS. But, the sad news for those who are considering to move from Linux is that, no freedom as in terms of source code and customizability is nowhere can be compared with Linux.
As one might see, Leopard is, in reality, a 32 bit operating system which runs in a 64 bit architecture (using an emulator). That is how, it could able to run in Intel's core 2 duo processor.
Having linux alongside Mac OS X is really a very useful stuff for people like me, who runs intensive simulations and number crunching programs. On the other side, despite GNU open source programs are available for Mac platform, usually, does not matches with the latest release of the same for Linux one. This intrigues, any geek, to go for Linux.
Installing Linux on Mac: Choice of the Linux flavour!
As one might say, if Linux is considered as an ice-cream, there comes a vast many flavours of it. Which one to choose, as Apple's MBPs packed with the industries cutting edge technologies!
In my perspective (I wanted to have Linux in my MBP to run quantum mechanical (GAMESS), molecular mechanical (GROMACS, NAMD...) and some of my own programs) any Linux distro that could enable me to optimize it to run my programs as much faster would be much sought. While considering Linux distros, one, should not only pay attention to eye candy stuff and multimedia stuff rich Linux distros, assuming installing Linux in Mac for mere computer intensive simulation purposes and not for any other purpose. Another main thing is, good number of community users, using the same in MBP or atleast MB... It is just to make you feel comfortable as you have support from other users.
Why Gentoo?
I have been using Linux, way back since 2005. And, have some experience with Debian (Kubuntu, Ubuntu, Lenny) and RedHat (Fedora, CentOS, RHEL4) lineages. All these are major linux distros these days and many might well aware of these... But, when I started my search for a suitable distro for a MBP, I came across Gentoo, which offers customizability starting from its core. It is a metadistribution, that could ultimately can manifested as a secured server, desktop or laptop distro. Another thing I considered is, the user group. As I was safariying!! thorough net, I have found many of those who has a Linux distro on their Mac Notebook is Gentoo... (equally ubuntu, as one might debate!). And comes portage, an excellent (so far I have not seen any such package management, offers you such an avenue for customizability) package management system.
Installation:
Before any trial or new attempt, Sincere suggestion is that, back your system up completely. I had to wipe my whole partition, since I already had 4 primary partitions and all were used by Leopard. The reason is that, rEFI, does not support anything more than 4 primary partitions. The reason is something to do with much techy about GPT and MBR. Will get back to it later.
So, I decided to have Leopard in just one partition and have two partitions for Linux and one is for rEFI, which is must, and should be the first primary partition. Download and installrEFIt, the latest available version. In my case, what I did is, I first wiped my hard drive completely and then partitioned using Mac's disk utility, suitable for my needs. Here, an important thing is that, while partition and format the disk in which Linux is planned to be installed should be formatted in DOS format and not HFS or HFS (journaled).
Remember your partition format and ready for the take off. Most of the installation steps are to be followed straightaway from Gentoo linux manual, as it differs slightly in installing and configuring grub and some extra hardware like iSight camera... sound daemon... But, anyway, it is advisable to read the manual completely once are twice before starting the installation process.
I have used Ubuntu-9.04 amd64 kernel, for my install. I have a working ethernet connection at my home. So things were little easy in installing gentoo...
Once liveCD is ready, boot the MBP using liveCD. hold down the "c" button when MBP boots. after initial setup, will have ubuntu desktop. Open the terminal, and type the following,
> sudo su -
> mkdir -p /mnt/gentoo
>mount /dev/sdaX /mnt/gentoo
Here is little different for those want to have Linux in just one partition. I have a separate home partition and / partition, where the /boot partition lies...
Then, install stage as it is mentioned in Gentoo manual, otherwise one could follow these steps,
> wget http://gentoo.osuosl.org/release/amd64/2008.0/stages/stage3-amd64-2008.0.tar.bz2
One could use any other mirror as well.
> tar -xvjf stage3-amd64-2008.0.tar.bz2
> cp /etc/resplv.conf /mnt/gentoo/etc
Remember you have just mounted your partition under ubuntu...
Now,
> mount -t proc proc /mnt/gentoo/proc
> chroot /mnt/gentoo
Now you are in the gentoo environment as root!!
> emerge --sync
This might take a while depending on your internet connection speed.
Downlaod the kernel as follows,
>emerge grub >=vanilla-sources-2.6.30-rc4 dhcpcd
This installs the kernel sources in /usr/src/linux under your chrooted environment.
Hereon you can follow the gentoo installation manual for setting up fstab file and password for the root user. Failing this you might not be able to boot in to gentoo!
Kernel configuration
The followings are the important things to remember while you compile the kernel.
1. Enable MTRR device support (for nVidia chips)
2.Disable nVidia framebuffer support and nVdia riva support
3.Enable Broadcom BCM4322 802.11 a/b/g/n wireless support
4.Enable I2C/DDC (helps in obtaining widescreen information for X11
5.Enable applemouse toucpad and ps2 as well.
If anybody needs my .config file drop me your mail id.
Short note on kernel compilation
> make menuconfig
After choosing your options and saving
> make && make modules_install
here I would suggest to pay attention to gentoo manual,a s it explains about alternative method of compilation.
Now install grub.
> emerge grub
> grub install /dev/sdaX Where you decided to install grub.
cp the compiled kernel to the /boot directory and edit your grub.conf
Add the following line, as the bootparameter.
video=1440x900@70-32:uvesafb:mtrr:3:ywrap.
Once you could boot, then you are done!!
Configure the system how you want it to be and Enjoy Linux on MacBook Pro!!

Here is my screen-shot.


I will keep updating this post, as I go further!!

Comments