Karmic Koala on a MacBook 5,2

I have Karmic (9.10) successfully installed on my macbook 5,2 (5.2). I've got sound and graphics acceleration and function keys (except brightness) and wireless. I've also got the grub-efi working so don't have to boot with acpi=off. This gives you both cores of your processor and gives your correct battery reading (and it seems it reduced brightness on my screen to a tolerable level ++ ++ ).

I followed the writeups for installing Karmic and Jaunty on a 5,1 macbook.
https://help.ubuntu.com/community/MacBook (follow the links on the right side - read Karmic and Jaunty writeups for 5,1 and Karmic for 5,2)

This got me sound. And this writeup was also used for the config file for the touchpad. You can use the enable laptop mode and fan setting in the writeup as well.

1) Install rEFIT in OSX. It's necessary. It's easy. Google rEFIT and install. Easy.

2) Run bootcamp in OSX and carve out a partition (I did 20g - 16g for ubuntu and 4g for swap). You'll make the swap partition in gparted in the ubuntu install. Bootcamp only makes 1 partition.

3) Download the ubuntu amd64 iso and burn to DVD or CD.

4) Reboot the CPU with the CD/DVD in the drive. Hold down C to boot from disk
***make sure you've got an ethernet cable and its already plugged in to your modem or router - wireless don't work outta the box***

5) When the install menu comes up and AFTER you select english as the language press F6. Check off acpi=off and hit ESC. Now chose install (don't bother with trying the livecd)

6) Run the advanced partition setup and double click on the partition that bootcamp made. This will popup a window that allows you to resize and format the partition as ext3. Don't use ext4. Make sure you mount it at /

7) Leave enough space for a swap partition. (twice your RAM - no less).

Continue with the install after all this is done. After the install - or just before I can't remember, you'll be presented with a screen with an ADVANCED button in the lower right corner. Click advanced and put GRUB in the UBUNTU partition - not on hd0,0 - it'll most likely be hd0,3 for you.

9) finish install and reboot. The CD/DVD will eject. Remove it. Continue reboot INTO OSX. Again. Reboot into OSX. This blesses the UBUNTU partition automagically. After that, reboot again - this time into UBUNTU from rEFIT.

10) If it doesn't boot the GRUB menu - do a hard restart (hold down power button). Both times I installed, I had to do a hard restart at this point. This is the only time you should have too.

11) At the GRUB menu that starts after rEFIT, press E. This brings up a command list. Add acpi=off at the end of line that has your kernel version.

Looks something like this:
/boot/vmlinuz-2.6.31-14-generic root=/dev/sda3

12) Press ctrl+X to boot with this new parameter.

13) Ubuntu now boots.

14) At this point add medibuntu and mactel repositories. Do a search on the forum or in google for how to add the mactel repositories. ubuntuguide.org has the process for adding medibuntu.

15) After adding those repositories - do:
sudo apt-get update

16) By this time, the hardware driver icon should have popped up in your notification tray. Double-click this icon or chose System > Administration > Hardware Drivers. You'll see 4 available. Activate Broadcom STA and NVIDIA 185.

17) run:
sudo apt-get install pommed
sudo apt-get install nvidia-bl-dkms
sudo apt-get install ubuntu-restricted-extras
sudo apt-get install build-essential
sudo apt-get install grub-efi (see below as this will pop an error but will give you the correct package name to install)

1 There is a thread for configuring grub-efi the hard way (compiling from scratch). In Karmic you can install grub-efi for your platform. (I am using amd64). Just do:

sudo install grub-efi. This will pop an error most likely and give the package for your platform (i386 or amd64). sudo install that package. CD into /usr/lib/grub

You'll see a directory with your package (i386/amd64). CD into that directory. Then run grub-mkimage as root and pass the necessary options.

sudo grub-mkimage -d . -o grub.efi part_gpt hfsplus fat ext2 normal sh chain boot configfile

The above works great and will generate a grub.efi file in the directory /usr/lib/grub/whateveryourplatformis
Open up gedit as root:
sudo gedit grub.cfg

Copy and paste the following into that file (modify for your kernel version)
menuentry "UBUNTU 2.6.31-14" {
# Set the root device for Linux.
fakebios
root=(hd0,3)
# Load the loader. - other options: video=vesafb noefi
linux /boot/vmlinuz-2.6.31-14-generic root=/dev/sda3 video=efifb acpi=force
initrd /boot/initrd.img-2.6.31-14-generic
}

menuentry "MacOSX" {
# Search the root device for Mac OS X's loader.
search --set /usr/standalone/i386/boot.efi
# Load the loader.
chainloader /usr/standalone/i386/boot.efi
}

menuentry "Boot from MBR" {
appleloader HD
}
menuentry "Boot from CD" {
appleloader CD
}
#keymapping: remeber these keys when you boot, they can be helpful!!!
#F1 = ctrl-x
#F2 = ctrl-a
#F3 = ctrl-e

save and close that.

19) Copy that ENTIRE folder onto a USB drive. I accomplished this by chmod -R 777 /usr/lib/grub/whateveryourdirectoris and then using the GUI 'finder' window to drag and drop the directory onto the USB drive.

20) Restart the computer. Boot into OSX this time.

21) Open finder and copy the directory from the USB drive into the /efi folder. The /efi folder is visible after clicking on Go > Computer.

22) Reboot

23) In rEFIT you should (will) have the new grub-efi available as bootable (the icon looks like 3 blocks stacked). Chose that and boot.

24) The new grub menu pops up. Chose linux and boot (first choice - just hit enter).

25) Ubuntu will boot. You'll have wireless (check the icon in the top right notification tray) You might need to chose your wireless network. Enter your password if needed.

Follow the rest of the steps for activating sound in the writeups for installing Ubuntu on macbook 5,1. (All I did was change the /etc/modeprob.d/options.conf to include mbp=3 -- a reboot was required). I haven't tried patching alsa yet. I might. It works - so I'll probably leave it be. You'll also find a great config file for the touchpad and instructions on where to put that. This gives you a very functional touchpad. You can tweak speed/acceleration/sensitivity to your liking.

If I left anything out, or you have questions - fire away. I'll try and hash it out.

**I've yet to try iSight built-in camera. Will find a way to test it soon.**
** I can also shutdown no problems. I've not tried to sleep / resume yet. Not to concerned if that works.**

UPDATE

Hoborider's tip to make sound work is wrong, in order for analog sound to work you have to change /etc/modprobe.d/alsa-base.conf adding "model=mbp3" to the line that states "options snd-hda-intel power_save=10 power_save_controller=N", IE:

Code:
options snd-hda-intel power_save=10 power_save_controller=N

...must become...

 

Code:
options snd-hda-intel power_save=10 power_save_controller=N model=mbp3

 

The "MacOSX" entry in grub.cfg didn't work for me, instead it works this way...

 

Code:
menuentry "MacOSX" {
 root=(hd0,2)
 chainloader /usr/standalone/i386/boot.efi
}

I post the complete, slightly modified grub.cfg I'm using since it may be useful for someone (autoloads ubuntu after 10 seconds wait, adds "splash", adds a "recovery mode" entry)

 

Code:
default=0
timeout=10
## questo qua sotto non funziona, forse bisogna mettere il modulo direttamente
## nell'immagine?
#insmod png

menuentry "Ubuntu Linux 2.6.31-15-generic" {
# Set the root device for Linux.
 fakebios
 root=(hd0,3)
# Load the loader. - other options: video=vesafb noefi
 linux /boot/vmlinuz-2.6.31-15-generic root=/dev/sda3 video=efifb acpi=force splash
 initrd /boot/initrd.img-2.6.31-15-generic
}

menuentry "Ubuntu Linux 2.6.31-15-generic, recovery mode" {
# Set the root device for Linux.
 fakebios
 root=(hd0,3)
# Load the loader. - other options: video=vesafb noefi
 linux /boot/vmlinuz-2.6.31-15-generic root=/dev/sda3 video=efifb acpi=force single
  initrd /boot/initrd.img-2.6.31-15-generic
}

menuentry "MacOSX" {
 root=(hd0,2)
 chainloader /usr/standalone/i386/boot.efi
# Search the root device for Mac OS X's loader.
#  search --set /usr/standalone/i386/boot.efi
# Load the loader.
#  chainloader /usr/standalone/i386/boot.efi
}

menuentry "Boot from CD" {
 appleloader CD
}
#keymapping: remember these keys when you boot, they can be helpful!!!
#F1 = ctrl-x
#F2 = ctrl-a
#F3 = ctrl-e

Note that I removed the "Boot from MBR" entry given in hoborider's post since it didn't work on my system (it started osx in "text mode", but it crashed after a while), while the osx "normal" entry above works for me.

 

Also note that once you have grub booting linux and osx correctly you can get rid of refit by simply disabling it. This way you have grub soon starting up at boot and you can have linux boot automatically (see the grub.cfg above, "default" and "timeout" options at its beginning). With refit you can't have linux boot automatically: it defaults on osx, and the "legacyfirst" option in /efi/refit/refit.conf doesn't work here since we're using an "efi boot".

 

To disable refit without uninstalling it: in osx, just move the "refit" subdir which is inside the "/efi" dir somewhere outside of "efi", then move the "rEFItBlesser" subdir which is inside "/Library/StartupItems" somewhere outside "/Library/StartupItems", then bless your "grub-efi" dir by issuing:

 

Code:
bless --folder "/efi/your grub-efi dir" --file "/efi/your grub-efi dir/grub.efi" --setBoot

 

Regarding the question "why not use ext4" posted by vibe3, I suppose it's because grub's support for ext4 is not very stable yet and often gives problems.

 

The following "xorg.conf" works for me in order to have only my external monitor working, with the macbook's one off, as I needed:

 

Code:
Section "Module"
    Load           "dbe"
    Load           "extmod"
    Load           "glx"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce 9400M"
    Option  "NvAgp" "1"
    Option  "NoLogo" "on"
    Option  "UseDisplayDevice" "DFP-1"
EndSection

(

 

The "magic" line is this:

 

Code:
Option  "UseDisplayDevice" "DFP-1"

)

 

One other tip: if you have nautilus working very slow and eating a lot of cpu and memory, as I had, it could be because it has a problem when Desktop dir contains lots of files (even in its subdirs)

and/or

if the "XDG_DOCUMENTS_DIR" (and maybe the other "non desktop" dirs) specified in your homedir ".config/user-dirs.dir" file are subdirs one of each other... Well I'm not sure what was the issue, anyway I have my "documents" dir inside my Desktop one and it contains lots of files, and I had the problem; I managed to workaround it by editing "~/.config/user-dirs.dir" so that it states...

 

Code:
XDG_DESKTOP_DIR="$HOME/Desktop"
XDG_DOWNLOAD_DIR="$HOME"
XDG_TEMPLATES_DIR="$HOME"
XDG_PUBLICSHARE_DIR="$HOME"
XDG_DOCUMENTS_DIR="$HOME"
XDG_MUSIC_DIR="$HOME"
XDG_PICTURES_DIR="$HOME"
XDG_VIDEOS_DIR="$HOME"

(Btw as far as I've experienced this doesn't affect gnome's usability at all).

 

Hope this helps.

© 2002-2012 Jeroen Diederen. Drupal theme by Kiwi Themes.