Installing Mandriva 2009.0 on a MacBook Pro 5,1 (Unibody, Late 2008)

This describes the steps and solutions I used to install Mandriva 2009.0 on a late 2008 MacBook Pro (also referred to as "Unibody" MBP or "Aluminium" MBP). I also created a number of RPM's (mostly based on patches done by the Ubuntu folks) to handle some of this machine's features.

Distro used: I installed Mandriva Linux Free 2009.0 x86_64.

The basic setup is described is described in various places. Basically it consists of the following steps:

  1. install rEFIt (version 0.12 or later) under Mac OS X.

  2. resize and partition your drive (also under Mac OS X), using either Bootcamp or the Disk Utility directly. Remember you'll need at least two partitions for Mandriva (one for swap, one for everything else); and make sure the partition on which /boot will reside is one of the first four (if you don't use a separate partition for /boot then than means your root partition, /, must be one of the first 4 partitions). Typically this means / or /boot will reside on partition 3 or 4 (1 being using for EFI stuff, 2 for Mac OS X).

    If you plan on wiping out Mac OS X completely then you can skip this (though you still need to make sure /boot is on one of the first four partitions).

  3. run the Mandriva installer. Use the manual disk partitioning (Expert?) to make sure the proper partitions are used. Also make sure grub is installed in the partition on which /boot resides - it must not be installed in the MBR.

  4. reboot.

Now for the post-install setup. Note that I've pulled some packages from cooker, so first add the cooker repositories to your urpmi config. Also, if you installed the Mandriva Free DVD then you'll need to add the non-free repositories too.

Kernel

Install a 2.6.28 or later desktop kernel (from cooker); I've successfully run kernel-desktop-2.6.28-1mnb, kernel-desktop-2.6.28.1-1mnb2, kernel-desktop-2.6.28.4-1mnb2, and kernel-desktop-2.6.29.3-1mnb. Also install the matching kernel-desktop-devel package. Reboot into the new kernel.

Wireless

Install the proprietary driver (the free one does not support the built-in wireless chipset yet). This may be the pre-built driver package broadcom-wl-kernel-... (if there is one for the kernel you installed) or the dkms package dkms-broadcom-wl.

Video Driver

Install the NVidia proprietary driver, 180.18 or later. The easiest way to do this is via the drak configuration GUI: go to System -> Administration -> Configure Your Computer, then select Hardware and Set up the graphical server (you can also get here by running XFdrake from the command line).

Now click on "NVIDIA" (the group, not any specific card), and "Ok", and say yes to download/install the proprietary drivers.

The EDID data does not seem to be perfectly accurate, so the DPI gets set to (107, 103) by default; I therefore added the following line to the "Monitor" section of /etc/X11/xorg.conf:

      DisplaySize 332 207

Touchpad

Install x11-driver-input-synaptics and gsynaptics (I'm using 0.99.3 from cooker, together with all xorg from cooker, but I believe the standard ones work fine here).

Download dkms-bcm5974-1.1.1-1; if you're running a 2.6.28 kernel you'll also need dkms-usbhid-0.1-1 (not needed for 2.6.29 or later); install them with

    rpm --install dkms-bcm5974-1.1.1-1.noarch.rpm dkms-usbhid-0.1-1.noarch.rpm

(in that order). If you're installing the dkms-usbhid package then this will rebuild the initrd for your current kernel and you'll need to reboot.

The bcm5974 is the driver for the touchpad; the usbhid package contains a hack prevent it from grabbing the touchpad, thereby letting bcm5974 grab the touchpad instead - as of 2.6.29 the shipped usbhid driver does this correctly and hence the dkms-usbhid package is not needed (and should not be used). Note that usbhid is loaded as part of the initial kernel load, i.e. it is part of the initrd loaded modules.

To modify the default touchpad settings do the following:

    cp /usr/share/hal/fdi/information/20thirdparty/11-xorg-synaptics.fdi /etc/hal/fdi/information/
    vi /etc/hal/fdi/information/11-xorg-synaptics.fdi

E.g. I changed the following:

    <merge key="input.x11_options.PalmDetect" type="string">1</merge>
    <merge key="input.x11_options.TapButton1" type="string">1</merge>
    <merge key="input.x11_options.TapButton2" type="string">3</merge>
    <merge key="input.x11_options.TapButton3" type="string">2</merge>

Other values can be controlled from System -> Preferences -> Touchpad .

Audio

  1. add to /etc/modprobe.conf :
              options snd_hda_intel power_save=1 model=mbp3
    Try 'rmmod snd_hda_intel ; modprobe snd_hda_intel'; otherwise reboot.
  2. start volume-control
  3. select "HDA Nvidia (Alsa mixer)" device
  4. click on Preferences and select "Channel Mode" and "Speaker"
  5. go to "Options" tab and change the channel mode to "6ch"
  6. go to "Switches" tab and make sure speaker is enabled.
  7. go to "Options" tab and set the first "Input Source" to "Front Mic".

Problem: sound on right speaker only (headphones are fine). Master Output in Volume Control shows up as mono only. See also the Ubuntu Forums thread and the alsa bug pages. Also, I seem to need to change the channel mode to 2ch and back 6ch after a resume in order to get sound on the speaker again.

Skype

  1. downloaded rpm from skype website
  2. edit /etc/pulse/daemon.conf and add the following two lines to the end:
              default-fragments = 8
              default-fragment-size-msec = 5
    . (you may need to kill and restart the pulseaudio daemon; can also be accomplished by logging out and back in).
  3. run as 'soundwrapper skype'
  4. In Skype, under Options -> Sound Devices set Sound In, Sound Out, and Ringing to pulse.

Video works, though not picture-in-picture.

Screen/Keyboard Backlight

Download and install dkms-mbp_nvidia_bl-0.19.0-1, hal-applesmc-0.14-1, hal-nvidia-bl-0.1.0-1, and gnome-power-manager-2.24.1-0.2mbp1.1mdv2009.0.

This will enable the hotkeys (F1/F2 and F5/F6) to control the screen and keyboard backlights. The patched gnome-power-manager has some fixes to properly control the screen backlight (though not the keyboard backlight); you will also need to make the following adjustments to its settings:

    gconftool-2 -t int -s /apps/gnome-power-manager/ambient/correction_factor 40
    gconftool-2 -t int -s /apps/gnome-power-manager/ambient/correction_scale 5000
    gconftool-2 -t int -s /apps/gnome-power-manager/ambient/poll_timeout 10
    gconftool-2 -t int -s /apps/gnome-power-manager/keyboard/brightness_ac 0
    gconftool-2 -t int -s /apps/gnome-power-manager/keyboard/brightness_battery 0

See also the discussion. on the Ubuntu Forums.

A Note on Key Mappings

Some keys are mapped in what may be a non-obvious manner:

PC Key MacBook Key(combination)
Page Up FN+UpArrow
Page Down FN+DownArrow
Home FN+LeftArrow
End FN+RightArrow
Backspace Delete
Delete FN+Delete
Insert FN+Return

Outstanding Issues

Not everything is perfect yet:

Things That Work Out of the Box

Untested Features

Acknowledgements

Lots of thanks goes to the Ubuntu folks, as many of the problems were diagnosed and solved there. The rpm's provided here were built using the patches provided in the Ubuntu mactel repository.

Sources

Here are the source rpms and tarballs for the various rpms above:

dkms-bcm5974-1.1.1-1.src.rpm
hal-applesmc-0.14-1.src.rpm
hal-nvidia-bl-0.1.0-1.src.rpm
gnome-power-manager-2.24.1-0.2mbp1.1mdv2009.0.src.rpm

Note that I don't have any explicit source rpm's for the usbhid and mbp_nvidia_bl packages, as I used dkms mkrpm to build those; but those rpm's contain all the necessary sources.

Note for users of Fedora, PC Linux, and other RPM-based distros: you should be able to use the RPM's provided here too, or at least be able to adjust them easily for your distro.

Ronald Tschalär / 30 May 2009 / ronald@innovation.ch.