Mandriva 2009.1 on MacBookPro 5.1
Installing Mandriva 2009.1 on a MacBook Pro 5,1 (Unibody, Late 2008)
This describes the steps and solutions I used to install Mandriva 2009.1 (Spring) on a late 2008 MacBook Pro (also referred to as "Unibody" MBP or "Aluminium" MBP); for Mandriva 2009.0 see the old instructions. 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. While this page is specifically about Mandriva, users of other RPM based distros such as Fedora, PC Linux, etc should find some useful information here too, including being able to use the provided RPM's.
Distro used: I installed Mandriva Linux Free 2009.1 x86_64.
The basic setup is described is described in various places around the web. Basically it consists of the following steps:
-
install rEFIt (version 0.12 or later) under Mac OS X.
-
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).
-
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.
-
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 make sure you add and enable the non-free repositories too.
Wireless
Install the proprietary driver (the free one does not support the built-in wireless chipset yet), broadcom-wl-kernel-desktop-latest.
Video Driver
Install the NVidia proprietary driver, nvidia-current-kernel-desktop-latest. 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 "Custom" for the "Graphic Card", then "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 207Touchpad
Install x11-driver-input-synaptics (I recommend version 1.1.2 from cooker, as it feels noticeably better) and gsynaptics.
Download dkms-bcm5974-1.1.1-1 and install with
rpm --install dkms-bcm5974-1.1.1-1.noarch.rpmThe bcm5974 module is the driver for the touchpad; this version here contains updates for this MacBook (Pro) 5,1 model.
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.fdiE.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
- add to /etc/modprobe.conf :
options snd_hda_intel power_save=1 model=mbp3Try 'rmmod snd_hda_intel ; modprobe snd_hda_intel'; otherwise reboot.
- start volume-control
- select "HDA Nvidia (Alsa mixer)" device
- click on Preferences and select "Channel Mode" and "Speaker"
- go to "Options" tab and change the channel mode to "6ch"
- go to "Switches" tab and make sure speaker is enabled.
- 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.
There are a couple problems on suspend/resume, which can be fixed as follows. Download 20pulseaudio and 15alsa put them in /etc/pm/sleep.d/ . Make sure they have appropriate execute permissions:
chmod 755 /etc/pm/sleep.d/15alsa /etc/pm/sleep.d/20pulseaudio20pulseaudio suspends and resumes pulseaudio to avoid the audio becoming stuck after a resume; note that this doesn't use the RESTORE_SOUND functionality from pm-utils because that kills and restarts the pulseaudio daemon which causes the volume hotkeys to stop functioning. The 15alsa script switches the channel mode to 2ch and back to 6ch which seems to be necessary after a resume in order for the internal speaker to work.
Skype
- downloaded RPM from skype website
- 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).
- run as 'soundwrapper skype'
- 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.26.1-10.1mbp1mdv2009.1.
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 0See also the discussion on the Ubuntu Forums.
Exposé and Dashboard Hotkeys
While the kernel generates keycodes for these keys, they are not mapped to any symbols in X11. To do this run
xmodmap -e 'keycode 128 = F15' -e 'keycode 212 = F16'(I put this into a gnome startup application). This will cause Exposé to be mapped to F15 and Dashboard to be mapped to F16, and you can for instance now use these keys when configuring compiz.
Gnome Sensors Applet
The shipped gnome-sensors-applet RPM is built to link against lib64lm_sensors3 (i.e. lm_sensors 2.10.8), but I had trouble seeing any of the applesmc sensors with that. I therefore rebuilt (no code or spec changes) the package to link against lib64lm_sensors4 (i.e. lm_sensors 3.0.3): gnome-sensors-applet .
The only temp* I'm sure of is that temp8 is the GPU; if anybody else has further info, please let me know.
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:
- touchpad palmdetect is not very good, as it will still trigger a mouse event every so often while typing; syndaemon seems to do a better job.
- external speakers don't work properly (right or sub-woofer only)
- keyboard light not automatically dimmed
- External VGA displays (using the mini-DisplayPort → VGA adapter) either do not display at all or are heavily distorted.
Things That Work Out of the Box
- Both suspend (suspend-to-ram) and hibernate (suspend-to-disk) work well; just make sure you don't have any usb disks mounted when you suspend, or the suspend may hang at the end.
- Built in iSight camera.
- USB.
- Bluetooth
- External DVI displays (using the mini-DisplayPort → Dual-DVI adapter and NVidia Display Settings).
- CD/DVD playback and burning.
- Playback, Speaker, and Eject hotkeys.
Untested Features
- Firewire
- Remote Control (IR)
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 RPM's and tar-balls for the various RPM's 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.26.1-10.1mbp1mdv2009.1.src.rpm
Note that I don't have any explicit source RPM for the mbp_nvidia_bl package, as I used dkms mkrpm to build that; but it contains 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.