[30488 views]

[]

Gentoo Linux on iMac

These are my notes on the iMac hardware and running Linux on it.

Hardware

External ports:

BIOS

The Mac has no BIOS, but uses EFI. However EFI support in Linux is not mature enough. Use Bootcamp and rEFIt.

Kernel

Kernel command line: kernel /boot/linux-3.0.1 root=/dev/sda3 rootfstype=ext4 resume=/dev/sda4 snd-hda-intel.model=imac27

Gentoo settings

/etc/make.conf:
USE="aio smp sse sse2 sse3 ssse3 -3dnow -3dnowext"
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -fomit-frame-pointer -pipe"
ALSA_CARDS="hda-intel"
INPUT_DEVICES="evdev keyboard mouse synaptics v4l"
VIDEO_CARDS="radeon vesa fbdev"
LIRC_DEVICES="macmini"

Framebuffer console

Works as of kernel 3.0.1

radeon driver

radeon KMS drives the display panel properly as of 3.0.1. With MESA 7.10, xorg-server 1.10.2, xf86-video-ati 6.14.2 Compositing in KDE works well as of MESA 7.11.2 and xorg-server 1.11.2.

vesa driver

Drives the display at 1400x1050 60Hz. No OpenGL acceleration. Still good enough to watch DVD.

Even though I have added ModeLines for the Full HD resolution neither VESA nor the radeon driver would pick them up. They are discarded during initialization.

fglrx driver

The properitary ATI driver as of 11.3 is able to drive the display at 1920x1080. There are less problems with Compositing here than with old MESA 7.10 and it uses 4 Watts less power than radeon.

Xorg

X works fine as of xf86-video-ati-6.14.4, mesa-7.11.2 with Gallium (see eselect mesa). Here is the xorg.conf.

Bluetooth keyboard

When you first install your computer keep a USB keyboard ready. Otherwise you will not be able to pair your Bluetooth keyboard! OS-X works a lot better here: it detects that there is no keyboard connected, tries to find the Bluetooth one and configures it in boot protocol mode. This way you can use the keyboard even as long as it's not paired yet.

To pair the keyboard, open two root shells. In the first run simple-agent and answer yes to any upcoming authorization requests. Remove and reinsert the batteries from the keyboard. Turn the keyboard on by pressing the side button. The green light should be flashing. In the second shell do:

hcitool scan
Scanning ...
        11:22:33:44:55:66       Apple Wireless Keyboard

hcitool cc 11:22:33:44:55:66
hcitool auth 11:22:33:44:55:66

Type a PIN (any four numbers) followed by Enter on the keyboard. Enter the PIN into simple-agent when prompted in your first shell.

XInput

Here is an Xmodmap file for the keyboard: imac-deCH.modmap. It should be loaded when you startup X.

Note that as of xorg-1.8 the input device configuration resides (again) in xorg.conf.

Remote control

Install lirc with the macmini driver. The infrared port is a USB raw HID device, which will be made available by udev as /dev/usb/hiddev0. You need USB_HIDDEV in your kernel config. In /etc/conf.d/lircd, set:
LIRCD_OPTS="-H macmini -d /dev/usb/hiddev0"
Enable the lirc USE flag. Then configure your ~/.lircrc as you wish, with remote = APPLE_A1156. Snippet for VLC:
# playback pause toggle
begin
        remote = Apple_A1156
        button = PLAY
        prog   = vlc
        config = key-play-pause
end