SantaRosa

Revision 24 as of 2007-09-18 21:27:42

Clear message

Ubuntu on MacBook Pro Santa Rosa

Preface

With the release in June 2007 of the third revision to the MacBook Pro line, several hardware incompatibilities were introduced with Ubuntu.

The primary hardware changes from previous hardware revisions include:

  1. NVIDIA Graphics (GeForce 8600M GT)

  2. Airport Extreme Wi-Fi 802.11b/g/n
  3. Sound

In order to document these incompatibilities and the workarounds a thread was created: http://ubuntuforums.org/showthread.php?t=474144

This wiki page is based of this thread and the contributions made by members in the forum.

Other instructions can be found on this wiki page: https://cbg.dyndns.org/wiki/ReadingCorner/LinuxOnMacbookPro

Before starting please note:

  • If you are new installing Ubuntu on your Intel Mac, you may like to familiarize yourself with the installation process by visiting the generic wiki page for the MacBook Pro or MacBook help page.

  • If you are dual booting, this page presupposes that you will
  • Install the EFI boot menu GUI: rEFIt (http://refit.sf.net)

  • Create a new partition to house your Ubuntu installation on you internal Hard Drive

Installation:

To install Ubuntu on your MacBook Pro Santa Rosa:

Text Installation

  1. Download the Alternate Install CD (32bit or 64bit)
  2. Burn the install CD under OS X/Windows/Linux
  3. Download and install Boot Camp or rEFIt (http://refit.sf.net)

  4. Boot from the Ubuntu CD by holding the 'c' key during boot
  5. Follow the on screen instructions
  6. Install Ubuntu

GUI Installation

  1. Download the Live Install CD
  2. Burn the install CD under OSX/Windows/Linux
  3. Download and install Boot Camp or rEFIt (http://refit.sf.net)

  4. Boot from the Ubuntu CD by holding the 'c' key during boot
  5. Choose "Safe graphics mode" and press F6 to edit the boot parameters
  6. Remove "splash", "quiet" and "--" then add "all_generic_ide"
  7. Boot into the Live environment and install Ubuntu from Ubiquity

Getting Graphics to Work

You will find after installation that you computer will not correctly boot. This is due primarily to the new unsupported graphics.

Change Graphics Drivers

  1. Reboot you Mac and choose the Linux icon from the rEFIt menu
  2. Press Esc when asked

A black screen will be present with text similar to: {{{Ubuntu kernel 2.6.20-15-generic Ubuntu kernel 2.6.20-15-generic (recovery mode) Ubuntu memtest }}} etc...

  1. Select the recovery mode option
  2. Edit the /etc/X11/xorg.conf file

{{{nano /etc/X11/xorg.conf }}}

  1. Search for

{{{Driver "nvidia" }}} and replace with {{{Driver "vesa" }}}

  1. Save and exit nano and start a normal system

{{{telinit 2 }}}

Installing the NVIDIA Driver

If you want to have 3D hardware acceleration (e.g. for a composite desktop like Compiz-Fusion/Beryl, or for games), you will need to install the closed source NVIDIA driver. The drivers in the Ubuntu repositories (nvidia-glx or nvidia-new) do not support the MacBook Pro Santa Rosa.

You will need to install the latest driver available from NVIDIA and patch it prior to installation.

  1. Create a temporary work directory

{{{cd /tmp mkdir nvidia cd nvidia }}}

  1. If you haven't already, install build-essential package so you can build the driver

{{{sudo apt-get install build-essential }}}

  1. Download the NVIDIA driver:

{{{wget http://us.download.nvidia.com/XFree86/Linux-x86/100.14.11/NVIDIA-Linux-x86-100.14.11-pkg1.run }}}

  1. Download the patch

{{{wget https://cbg.dyndns.org/store/config/nv_macbook.diff }}}

  1. Patch the driver

{{{sh NVIDIA-Linux-x86-100.14.11-pkg1.run -x cd NVIDIA-Linux-x86-100.14.11-pkg1/usr/src/ patch -p0 < ../../../nv_macbook.diff cd ../.. }}}

  1. Run the NVIDIA install script

{{{sudo ./nvidia-installer -aN --no-x-check }}}

  1. Follow the onscreen instructions to install the driver.
  2. Press Control + Option (alt) + Delete (backspace) to restart your X session and run with the new driver

Some problems that have been encountered with this method

  • Installing the NVIDIA driver in this way means that after each kernel upgrade you will have to rebuild and install the graphics driver. Follow the same procedure as above from 6.
  • You may need to blacklist the graphics drivers.
  • Edit the default modules configuration file

{{{gksudo gedit /etc/default/linux-restricted-modules-common }}}

  1. Disable the nv and nvidia_new modules by changing:

{{{DISABLED_MODULES="" }}} to {{{DISABLED_MODULES="nv nvidia_new" }}}

Install Wireless

  1. Prepare to build the drivers

{{{sudo apt-get install build-essential }}}

  1. Create a temporary work directory

{{{cd /tmp mkdir madwifi cd madwifi }}}

  1. Download the snapshot of madwifi drivers

{{{wget http://snapshots.madwifi.org/madwifi-ng/madwifi-ng-r2372-20070525.tar.gz }}}

  1. Build and install the madwifi drivers

{{{tar -xzf madwifi-ng-r2372-20070525.tar.gz cd madwifi-ng-r2372-20070525 make sudo make install sudo modprobe ath_pci }}}

Getting Sound

  1. Install Alsa dependencies

{{{sudo apt-get install automake autotools-dev autoconf }}}

  1. Create a temporary work directory

{{{cd /tmp mkdir alsa cd alsa}}}

  1. Download the latest alsa source which includes a patch for the MacBook Pro Santa Rosa

{{{cd /usr/src/modules/ rsync -avz --delete rsync://alsa.alsa-project.org/hg/alsa-driver alsa rsync -avz --delete rsync://alsa.alsa-project.org/hg/alsa-kernel alsa }}}

  1. Build and install the driver

{{{cd ../alsa-driver ./hgcompile --with-cards=hda-intel make sudo make install sudo /etc/init.d/alsasound stop }}}

  1. Then load the driver module

{{{sudo modprobe snd-hda-intel }}}

Controlling backlight and Keyboard Light

The system used to control backlight on Mac laptops is a proprietary Apple implementation under Mac OS X and has been implemented under Linux by pommed. To install latest version of pommed (1.9):

  1. Install the dependencies

{{{sudo apt-get install dpkg-dev build-essential }}}

  1. Create a temporary directory

{{{cd /tmp mkdir pommed cd pommed }}}

  1. Download the files

{{{wget http://ftp.debian.org/debian/pool/main/p/pommed/pommed_1.9~dfsg.orig.tar.gz wget http://ftp.debian.org/debian/pool/main/p/pommed/pommed_1.9~dfsg-1.diff.gz wget http://ftp.debian.org/debian/pool/main/p/pommed/pommed_1.9~dfsg-1.dsc }}}

  1. Build the package

{{{dpkg-source -x pommed_1.9~dfsg-1.dsc cd pommed_1.9~dfsg sudo dpkg-buildpackage -d cd .. }}}

  1. Install the package

{{{sudo dpkg -i *.deb }}}

Getting CD/DVD Drive

The CD/DVD Drive doesn't work out-of-the-box, but some people reported that this simple manipulation can make it work: {{{sudo modprobe piix }}} And then discs are automounted, and can be ejected using the eject key if you have pommed installed.

X.org adjustments

Here is a sample X.org configuration file that provides two-finger right click and scrolling, and three-finger middle click for the TrackPad, as well as right Apple key behave like the Alt key under Mac OS X (equivalent of AltGr on PCs).

  1. Make a backup of the file

{{{sudo mv /etc/X11/xorg.conf /etc/X11/xorg.conf.bak }}} If there a problem with the new configuration, you can restore the old one easily: {{{sudo mv /etc/X11/xorg.conf.bak /etc/X11/xorg.conf }}}

  1. Open the file

{{{gksudo gedit /etc/X11/xorg.conf }}}

  1. Copy the following configuration

{{{Section "ServerLayout"

EndSection

Section "Files"

  • # path to defoma fonts

    FontPath "/usr/share/fonts/X11/misc" FontPath "/usr/share/fonts/X11/cyrillic" FontPath "/usr/share/fonts/X11/100dpi/:unscaled" FontPath "/usr/share/fonts/X11/75dpi/:unscaled" FontPath "/usr/share/fonts/X11/Type1" FontPath "/usr/share/fonts/X11/100dpi" FontPath "/usr/share/fonts/X11/75dpi" FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"

EndSection

Section "Module"

  • Load "i2c" Load "bitmap" Load "ddc" Load "extmod" Load "freetype" Load "glx" Load "int10" Load "vbe"

EndSection

Section "InputDevice"

EndSection

Section "InputDevice"

  • Identifier "Configured Mouse" Driver "mouse"

    Option "CorePointer" Option "Device" "/dev/input/mice" Option "Protocol" "ImPS/2" Option "ZAxisMapping" "4 5" Option "Emulate3Buttons" "true"

EndSection

Section "InputDevice"

EndSection

Section "Monitor"

EndSection

Section "Device"

  • Identifier "nVidia Corporation NVIDIA Default Card" Driver "nvidia" Option "AddARGBGLXVisuals" "True"

EndSection

Section "Screen"

EndSection

Section "Extensions"

  • Option "Composite" "Enable"

EndSection }}} I tested many configurations for the TrackPad and I'm almost satisfied. I'll do more tests and post my final configuration here once finished.