Thursday, January 1, 2009

Installing Ubuntu 8.10 on a Macbook Santa Rosa (4.1)

Section 1 - Preparatory Steps:
Check to see if your Macbook is a Santa Rosa 4.1:
In Mac OS X go to the Mac Menu (apple logo) and choose "About this Macbook" and it will show the "Model Identifier" in the "More Info..." window.

Preparing the Hard Drive:
Start the Boot Camp assistant (under Applications-->Boot Camp Assistant).
If it says the system is not up to date do the following:
  1. Run system update and download all updates available
  2. Go to Applications-->Utilities-->Disk Utilities.
  3. Select your hard drive
  4. Click the large green "Enable Journaling" button on the top bar.
  5. Re-launch boot camp (after any reboots due to updates)
From the bootcamp menu create a partition for windows. I suggest about 30GB of storage space, but you can do with less.
Cancel the boot camp assistant after creating the partition, no need to create a disk of drivers.

Installing rEFIt:
Note: you can skip rEFIt and use the option key to choose between Mac OS X and "Windows" (the Ubuntu partition created by boot camp), but I prefer rEFIt.
First, download a disk image from here: http://refit.sourceforge.net/
Double click the dmg file that you've downloaded, and launch the rEFIt.mpkg file.
Follow the instructions on the screen, and select your Mac OS X installation volume.
Download an Ubuntu LiveCD:
Go to http://www.ubuntu.com/getubuntu/download and download a liveCD of Ubuntu 8.10 Intrepid Ibex. You can choose either 32 or 64 bit, though I have only installed a 32 bit version (this was before Adobe released a native 64bit client).
Once downloaded, insert a blank CD and start Disk Utility (Applications-->Utilities-->Disk Utilities).
Then go to File-->Open Disk Image and select the image you've downloaded.
This disk image will now appear in the left-hand column. Select it.
Click "Burn" and follow the instructions that appear.

Section 2 - Installation:
Booting to the Ubuntu Install CD:
Insert the Ubuntu LiveCD and reboot, and then while it is starting press and hold the "c" key to boot to the CD.
Once the CD menu has loaded, choose the language you wish to use, and then choose "Try Ubuntu" (the top menu choice).
Wait for the system to load, and for the Ubuntu user to login.

Installing Ubuntu:
Once the system has loaded, there will be an "install" icon on the desktop, double-click it. Once the ubiquity installer has loaded, follow the initial steps until you arrive at the partitioning screen.
The partitioning should be step 4.



Once at this screen choose "manual" and hit "next". A new window will load.


From this menu choose the last partition (it will be either FAT or NTFS as a filesystem type). In it's place create a partition of ext3 with mountpoint "/" (without quotes (see NB)). Continue with the install, and tell the installer to proceed without a swap partition (we will create a swapfile (see NB2) later).

On the last screen of the installation, it will display details on what you've configured it to do. Here you need to select the "advanced" button and change the location of GRUB to the filesystem you created in the partitioning screen (the name will be listed on that screen as well, so you need only choose the correct /dev/sdaX value).







Once the install is complete, reboot the macbook, and at the rEFIt boot screen, choose the second icon on the second row (should look like a hard disk). It will then ask you if you want it to re-write the MBR as it was modified. Type in "y" (without the quotes) and wait for it to finish. Then reboot, and choose the Tux icon in the rEFIt boot menu to load Ubuntu. Sign in using your username and password that you set up during install.

NB You may be able to set up Ubuntu with a / filesystem and a /home filesystem, though I don't know this for sure, as I didn't try it. Don't own a Macbook either, so I won't be able to find that out for the time being. There is a limit to partitions you can create.

NB2: A swap file is like virtual memory in Windows, and can be used when the RAM is full.

Section 3 - Post-Installation:
Adding a Swap file:
First create the swap file with 1024MB (1024 x 1024 = 1048576)
sudo dd if=/dev/zero of=/swapfile1 bs=1024 count=1048576

Setup Linux swap and turn it on
sudo mkswap /swapfile1
sudo swapon /swapfile1

Edit the /etc/fstab
sudo gedit /etc/fstab

and add this line to your /etc/fstab
/swapfile1 swap swap defaults 0 0

Wireless Card
Insert an ethernet cable to your Macbook, and wait until it connect. Then, go to System--
>Administration-->Hardware Drivers. There should be a Broadcom driver listed. Select it and choose "activate". Enter your password and wait for it to download and install the drivers. A reboot will be required to have it working.
iSight
To enable the MacBook's built-in webcam, simply follow these steps:
1. Mount your Mac OS X partition
2. Install the isight-firmware-tools package and direct it to your iSight firmware on the Mac OS X partition (just confirm the default when mounted to /MacOSX)
3. Restart HAL
The Code:
sudo mkdir /MacOSX && sudo mount /dev/sda2 /MacOSX
sudo aptitude install isight-firmware-tools
sudo invoke-rc.d hal restart
You can then test your iSight with e.g. cheese (sudo aptitude install cheese && cheese).

Touchpad:

Here we will create an fdi file for HAL to use, in order to enable two finger scrolling and two-finger tapping for right click.
sudo gedit /etc/hal/fdi/policy/appletouch.fdi

then enter the following into the file (blogspot wants to render the xml, so I have to put it up as a picture):



Microphone:
  1. Open Volume Control by right clicking on the volume icon and selecting "Open Volume Control".
  2. Click on Preferences and enable Capture, enable Mic Boost, and then close Preferences.
  3. In the Recording tab of Volume Control, raise the Capture level.
  4. In the Playback tab of Volume Control, raise the Mic Boost level.
  5. Under System > Preferences > Sound choose "HDA Intel ALC885 Analog (ALSA)" for Audio
  6. Conferencing / Sound capture
  7. Test it by running gnome-sound-recorder. Ensure that "Capture" is selected in the "Record from input" dropdown.
More Information:
https://wiki.ubuntu.com/MacBook/SantaRosa
(The configuration steps were taken from this site, as it was what I used)

7 comments:

Unknown said...

Great tutorial, one problem though.....I followed your instructions to the letter, however, after rebooting the Macbook after installing Ubuntu, I didn't get the rEFIt boot screen, the Mac just booted right into OS X, and the bootcamp partition is no longer available (understandable since it is now a Linux partition...)

SO....any thoughts/ideas?

Lswest said...

Hmm, the only reason that could be (that I know of) is that when installing rEFIt you chose the wrong hard drive for installation. Could you give me some more info about your partitions and setup?

You can try re-installing, but remove rEFIt first using these instructions: http://refit.sourceforge.net/doc/c1s3_remove.html

Lswest said...

Also, you can try to boot ubuntu and forgoing rEFIt by holding the option key down on boot, and choosing to boot "Windows" (which is the Ubuntu drive, but boot camp calls it windows since that's what it was designed for).

Unknown said...

Well, figured it out. Turns out I actually forgot to do a software update in OS X before installing rEFIt and Ubuntu. Once I realized this, and ran the update, everything worked fine.
Thanks again for the tutorial, got my Mac up and running on Ubuntu. There are a few glitches, primarily the isight camera not working despite my trying to extract the firmware...but I can live with that for the time being. The wireless keeps disconnecting quite often as well, but that could just be my network (though I never had the problem in OS X.) Just wish I could do away with the OS X partition all together.....

Lswest said...

Well, I have had a few issues with the wl and WPA networks, but I solved that by going into gconf-editor, then finding system-->networking-->connections-->1 [may be different for you]-->802-11-auth and deleting any reference to anything other than ccmp, tkip, wpa-psk and wpa in those fields. I'm glad the tutorial worked for you, and for the isight camera, have a look here: http://www.mactel-linux.org/wiki/Isight

Hope you enjoy Ubuntu!

Anonymous said...

Awesome tutorial

Lswest said...

Haha, thanks!