Ubuntu on MacBook Pro Notes

As it appies to MaBook Pro 8,2 and Kubuntu 12.04 Precise Pandolin

Making it work by patching the stock kernel

Get the build prerequisites

sudo apt-get install fakeroot build-essential crash kexec-tools makedumpfile kernel-wedge
sudo apt-get build-dep linux
sudo apt-get install git-core libncurses5 libncurses5-dev libelf-dev asciidoc binutils-dev kernel-package 

get the kernel

git clone git:// ....

or get it from ubuntu

sudo apt-get build-dep --no-install-recommends linux-image-$(uname -r)
apt-get source linux-image-$(uname -r)

Make scripts runnable

chmod -R u+x debian/scripts/*

Get your current config

cp /boot/config-3.2.0-24-generic .config

Change the following settings:

sed -i s/CONFIG_RTS5139=m/CONFIG_RTS5139=n/ .config
sed -i s/CONFIG_DRM_I915=m/CONFIG_DRM_I915=y/ .config

CONFIG_DRM_I915_KMS should already be set to y Patch it

patch -p1 < ../lvds_dual_channel.patch 
patch -p1 < ../apple_bl.patch 

Build and install

debian/rules updateconfigs
sudo make-kpkg --initrd --jobs 8 --append_to_version +efi kernel_image
sudo dpkg -i ../''your'' ''kernel'' ''package''.deb

EFI grub

mount /dev/sda1 /media/temp
vi /media/temp/EFI/grub/grub.cfg 

make it look something like the following (use your normal BIOS /boot/grub/grub.cfg for reference)

menuentry 'Ubuntu via EFI' --class ubuntu --class gnu-linux --class gnu --class os {
   set gfxpayload=keep
   insmod gzio
   insmod part_gpt
   insmod ext2
   set root='(hd0,gpt5)'
   # switch gmux to IGD
   outb 0x728 1
   outb 0x710 2
   outb 0x740 2
   #powers down ATI
   outb 0x750 0
   search --no-floppy --fs-uuid --set=root 34503a1a-98a8-45fc-966d-4679d8cb4a59
   echo    'Loading Ubuntu'
   linux   /boot/vmlinuz-3.2.14+efi root=UUID=34503a1a-98a8-45fc-966d-4679d8cb4a59 ro i915.lvds_channels=2 reboot=pci acpi_backlight=vendor
   initrd  /boot/initrd.img-3.2.14+efi

Configuring backlight

Get the gmux module from

sudo add-apt-repository ppa:sforshee/apple-bl-gmux
sudo apt-get update
sudo apt-get install apple-gmux-dkms

Reboot or

sudo modprobe -r apple_gmux
sudo modprobe apple_gmux

Get the max value for your brightness (mine was 82311)

cat /sys/class/backlight/gmux_backlight


echo options apple_bl use_gmux=1 max_brightness=''your'' ''max'' ''brightness'' ''value'' ''here'' | sudo tee /etc/modprobe.d/apple.conf

Reboot or

modprobe -r apple_bl
modprobe apple_bl

@TechnicalNotes @Linux @Apple