chill@will

Journey to Santa Rosa

by on Dez.03, 2007, under yellow

Finally my new macbook has arrived, it was overdue since the iBook 2,2 with 700MHz has become pretty slow and of course, is now well supported by Linux. Therefore everything worked and I couldn’t fiddle around with it any longer and actually had to do some work with it ;-P

This of course is also the case with Apples Leopard on the new one, but with Linux I’ve to start from scratch again since several key aspects have changed like cpu (now inhell), no more openfirmware (but EFI), different network card, different wifi-card, different graphics card and even sound doesn’t work out-of-the-box in Debian Lenny AMD64. Lots of fun ahead.

wiki.debian.org/MacBook has all the relevant details, but obviously not for the 3,1 MacBook revision.

Thus I followed the installation hints as far as the hardware was correct:

1.) First some rather embarrassing issue: I cannot find the Bootcamp Harddisk-Manager on OS X 10.5.1 installed or on the install media 🙁 Therefore: Install rEFIt (I hope for enlightenment here, soon)

2.) Shrink OS X partition with Apple’s diskutil: sudo diskutil resizevolume disk0s2 55G

3.) Reboot and, in rEFIt, choose Disk Partitioning and synchronise (Press ‚z‘ for ‚y‘ on a german keyboard)

4.) Reboot, hold c pressed and boot Debian network install CD: debian-testing-amd64-netinst.iso

5.) Create Linux partitions, e.g. if you are lazy: „Automatically partition free space with separate /home“ and afterwards it might look like this:

Number Start End Size File system Name Flags
1 20.5kB 210MB 210MB fat32 EFI system partition boot
2 210MB 59.1GB 58.9GB hfs+ Customer
3 59.1GB 64.7GB 5600MB ext3 boot
4 64.7GB 65.4GB 708MB linux-swap
5 65.4GB 80.0GB 14.6GB ext3

Relevant partitions are:

/dev/sda2 is OSX, mounted read-only (with journaling still on) under /media/osx
/dev/sda3 is the Linux root partition with ext3 filesystem
/dev/sda4 is the swap partition
/dev/sda5 is /home with ext3 filesystem (ext2/3 can be mounted in OS X)

and install Debian up to the boot-loader question of ‚grub2‘. But don’t install it!

Because new partitions have been created during the setup, the MBR and GPT are not in sync and they need to be, in order to be able to write the boot-loader. In AMD64 there is no user-land refit package, therefore a reboot is needed:

6.) instead of installing grub2, choose go back and Continue without boot-loader

7.) Finish the installation and reboot the computer.

8.) In rEFIt select again: Disk Partitioning and synchronise .. yes (by pressing ‚z‘ on a german keyboard).

9.) Now the Linux bootloader can be written: Reboot, hold c pressed and boot the Debian network install CD again.

10.) Press enter for all setup questions up to partitioning: Select manual, let setup detect the partitions and then go back

11.) Switch to the second console with ALT+F2 and:

mkdir /mnt/sda3
mount /dev/sda3 /mnt/sda3
mount /proc/ /mnt/sda3/proc
chroot /mnt/sda3

12.) Urgs, there is no lilo package installed. aptitude install lilo already works but liloconfig fails because /dev is empty (no udev running in chroot)

13.) Create the needed device nodes with mknod:

mknod sda b 8 0
mknod sda1 b 8 1
mknod sda2 b 8 2
mknod sda3 b 8 3
mknod sda4 b 8 4
mknod sda5 b 8 5

14.) create an /etc/lilo.conf:

boot=/dev/sda3
root=/dev/sda3
delay=20
map=/boot/map
vga=0x317 # (otherwise the console stays black)
default=Linux
image=/vmlinuz
label=Linux
initrd=/initrd.img
read-only
append="quiet"

image=/vmlinuz.old
label=old
initrd=/initrd.img.old
read-only
append="quiet"
optional

image=/vmlinuz
label=safe-mode
initrd=/initrd.img
read-only
append="single"

15.) Write the lilo bootloader to the partition (not the MBR!):

macbook:~# lilo
Added Linux *
Skipping /vmlinuz.old
Added safe-mode


16.) Exit the chroot und unmount the partition: Ctrl+d, umount /mnt/sda3/proc, umount /mnt/sda3

17.) Switch back to the setup screen with ALT+F1 and Reboot … now you have a choice between OS X and Linux 😉

System-Hardware setup

Now lets see what already works:

  • X.org – 915resolution package no longer needed, for DRI Install libgl1-mesa-dri and add to xorg.conf:


Section "Device"
Option "XAANoOffscreenPixmaps" "true"
Option "DRI" "true"
EndSection
Section "Extensions"
Option "Composite" "Enable"
EndSection
Section "ServerLayout"
Option "AIGLX" "true"
EndSection

  • Gigabit networkcard works with „sky2“ driver

Well, that’s better than for instance the latest ASUS R50 Laptop I recently set up, where no network at all was available 🙂 (thanks to Attansic Gigabit Ethernet and Broadcom Wireless w/o firmware)

Works

  • Everything fine with hddtemp
  • smartmontools: in /etc/smartd.conf comment the „DEVICESCAN“ line and uncomment further below: „/dev/sda -a -d sat“
  • Sound gets going with the hint about options snd_hda_intel model=mbp3 in /etc/modprobe.d/options
  • The wireless card is a Broadcom Corporation Unknown device 4328 (rev 03) and searching revealed this page, which describes how to get the card going with ndiswrapper and the bcmwl5 driver: bcmwl5 : driver installed, device (14E4:4328) present

Doesn’t work

  • Touchpad stuff doesn’t work out of the box, yet. One has to patch appletouch.c in the kernel for the MacBook 3,1 Therefore I decided to be lazy for now and wait for the next kernel 😉
  • iSight camera activation works as far as loading the firmware, where the firmware-loader complains: „Sha1sum check on firmware file failed“.

System-Software setup

  • Java (ia32-sun-java6-bin), Flash (flashplugin-nonfree), Google Earth (googleearth-package) work nicely.
  • Skype has to be convinced:

aptitude install ia32-libs lib32asound2 lib32ncurses5 ia32-libs-sdl ia32-libs-gtk lib32stdc++6 linux32

  • Copy /usr/lib/libXss.so.1.0.0 from a 32-bit installation on a different machine to /usr/lib32 and link it to libXss.so.1 in the same directory. Then force the installation of the 32-Bit Skype Binary:

dpkg --force-architecture -i skype-debian_2.0.0.13-1_i386.deb
ldd /usr/bin/skype

should not report any missing libraries and skype should run

  • Same procedure with the opera browser (complains about libqt-mt.so.3: wrong ELF class: ELFCLASS64):
  • Copy libqt-mt.so.3.3.7 from a 32-bit installation to /usr/lib/opera/<version>-<date> and link it:

ln -s libqt-mt.so.3.3.7 libqt-mt.so
ln -s libqt-mt.so.3.3.7 libqt-mt.so.3
ln -s libqt-mt.so.3.3.7 libqt-mt.so.3.3

  • then opera should run fine
:, ,

Comments are closed.

fortune cookie

BOFH excuse #237:

Plate voltage too low on demodulator tube

,


Apparent:
Pressure:
Humidity: %
Winds:
Sunrise:
Sunset:
More forecast...
 

,


Apparent:
Pressure:
Humidity: %
Winds:
Sunrise:
Sunset:
More forecast...