Fedora 8 on a Apple MacBook

Last changes: 25.05.2008

If one has any further questions about my machine or my configuration, I will try to answer them. I cannot guarantee, that my answers will solve any of your problems wink. My email adress is adalbert.prokop@gmx.de.

If you are searching for information about other notebook models you should have a look on http://www.linux-on-laptops.com/ or http://tuxmobil.org/mylaptops.html.

Overview

[Front view with open display] [rEFIt boot screen] The measure stated by Apple are 325×227×27,5 mm. The weight is 2,27 kg.

More information about the MacBook can be found on Apple's MacBook page. There you will also find the specifications.

On the display's upper edge there is the iSight Webcam and the built-in microphone. Both of them work just fine.


Hardware

Type Apple MacBook
CPU Intel Core 2 Duo 2GHz (64bit)
BIOS EFI
Memory 2GB, shared with the graphic card. (144MB)
Display 13,3" TFT display (33,78cm) with a ratio of 16:10
Resolution 1280×800 pixels
External: up to 1920×1200 pixels, mini-DVI connector
Graphics Intel GMA X3100, 144MB DDR2 SDRAM (shared with RAM)
Audio Intel Corporation 82801G (ICH7 Family)
Network Gigabit LAN Marvell 88E8053
Atheros WLAN a/b/g/n
Media Hard drive: 160GB Fujitsu MHW2160BHPL
Interfaces
  • 1× mini-DVI
  • 1× Ethernet LAN 10/100/1000 Mbit (Marvell 88E8053 [sky2])
  • 1× FireWire (IEEE 1394)
  • 2× USB 2.0
  • 1× earphones (wired or optical), 1× microphone
  • 1× Infrared receiver
  • no PC-Card (PCMCIA) slot
  • no modem
  • no S-Video or composite connector
  • no serial interface
  • no parallel interface

BIOS/EFI

There is no BIOS. A BIOS is a leftover from the 80's which stubbornly persists on PCs. wink The MacBook has an EFI. For the user it is irrelevant how the system boots, as long as it does. But for Linux we need BIOS emulation, because it was originally designed for PCs and that's (now) the only way to initialize all components correctly. To be honest that is not entirely true but close enough to the truth.

It manifests itself most clearly if you look at the partitioning scheme.

Linux installation

Distribution

Because I have grown up with RedHat and Fedora I have chosen Fedora 8. I have installed the 32 bit (i386) version, to avoid some problems like compiler libraries, missing browser plugins, etc. But you can also install the 64 bit (x86_64) version - at least the installer made no objections. Fedora was installed along with MacOS 10.4.

Partitioning

A BIOS knows 4 primary partions, EFI up to 128. If you want to use MacOS along with Linux you are limited to 4 partitions. If you create more partitions with MacOS Linux will not see them. If you create extended partition with Linux (which are living within a primary partition) MacOS will not see them. To complicate things MacOS already uses two partitions for own purposes, so there are only two of them left for our purposes. Some alternatives are:

I have chosen the last one.

Basically I only followed the instructions on Anleitung auf MacTech (german). You may find similar information if you look for the keywords "linux macos triple boot". The installation does not require boot camp. An absolutely necessary application is rEFIt, a boot manager which keeps EFI and MBR partition synchronous.

After installing rEFIt on MacOS one can also create all needed partitions with MacOS. It can be done with the command

diskutil resizeVolume disk0s2 100G Linux Swap 4G Linux Fedora 46G

This will resize the MacOS partition to 100GB and create a 4GB partition intended for swap and a 46GB partition intended for Linux.

The tool diskutil has the option resizeVolume since MacOS 10.4.7. The man pages of diskutil claim not to know anything about resizeVolume, but diskutil resizevolume should give you a short syntax summary. Obviously the partition sizes have to be adjusted to match your hard disk capacity.

After the partitions have been created you can boot from the CD or DVD. The installation goes as usual. When the system asks for a partitioning scheme do not choose the automatic one. Choose manual partitioning and tell the installer on which partition it may install Fedora. After the installation it may be necessary to synchronise both partition tables (EFI and MBR) by rEFIt - it can be done from the rEFIt boot menu.

Caution: The bootloader must not be installed in the MBR, but goes to the same partition on which Fedora will be installed.

Linux can read Apple's HFS+ partitions and even write on them, but only without Journaling. Writing is still considered experimental and is not recommended.

Graphics

If you encounter problems with your X-Server you should reconfigure it. Therefor enter on the command line system-config-display --reconfigure. The reconfigure option advises this tool to create a completely new config file. Afterwards you still can change it manually. Here you will find my config file xorg.conf

iSight Webcam

Yeah, it works! smile You will need the uvcvideo driver which can be downloaded from the Linux UVC homepage. You also will need the iSight Firmware Tools to extract the firmware from MacOS camera driver. Because of licensing reasons one cannot offer it for download directly. If your MacOS partition is mounted at /mnt/macos you will find the driver at

/mnt/macos/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS/AppleUSBVideoSupport

The extracted firmware goes to /lib/firmware where it can be found by the driver. Once the driver module is loaded the webcam's firmware has to be loaded into the cam (ift-load). It can be done manually, by rules in /etc/modprobe.conf or by UDEV rules. I have decided to use UDEV rules.

Create a file /etc/udev/rules.d/isight.rules with the following content.

ACTION=="add", SYSFS{idVendor}=="05ac", SYSFS{idProduct}=="8300", RUN+="/usr/local/lib/udev/ift-load --firmware /lib/firmware/isight.fw"
ACTION=="add", SYSFS{idVendor}=="05ac", SYSFS{idProduct}=="8501", RUN+="/usr/local/lib/udev/ift-load --firmware /lib/firmware/isight.fw", MODE="0666"

Now the firmware can be loaded with modprobe uvcvideo. If everything is correct, you will see a new log entry in syslog about a new video device. To test the camera you can use mplayer.

mplayer -tv driver=v4l2:device=/dev/video:fps=25:outfmt=uyvy:width=320:height=240 -vf mirror,screenshot tv://

A window with the camera's view should appear. The option screenshot makes mplayer a "PhotoBooth" - you can save a picture by pressing s. Unfortunatelly mplayer from Freshrpms would not cooperate. I had to install mplayer from Livna repositories.

The camera also works together with Skype.

Sound

ALSA works just fine.

Ethernet

The sky2 module was loaded atomatically.

WLAN

WLAN does not work out-of-the-box, but can be easily refitted from the FreshRPMS repository. All you have to do is to install the madwifi package.

Important! The madwifi package from Livna.org did not work. YMMV.

Bluetooth

First it seemed that bluetooth will not be available. I found this odd because many people reported bluetooth was working fine on their MacBooks. After an extensive search I found the right hint on a BSD related site. This MacBook has the newest firmware (as recommended by rEFIt). Bluetooth is operating in HID mode first, to support bluetooth keyboards and mice. To switch to the ("normal") HCI mode you have to issue the command

hid2hci --tohci

You can put it in /etc/rc.d/rc.local to switch the mode on every boot.

Keyboard

(Does not apply to US layouts)

The keyboard was the greatest problem. Mac's keyboard's layout differs significantly from a PC's keyboard's layout and it was impossible to write some important symbols like | (pipe), [ ] (brackets) or { } (braces). Unfortunatelly Fedora is missing a proper keyboard mapping for a german MacBook. After only several hours of inquest I learned that Debian does have a german mapping. I've extracted the mapping from Debian's sources. In this mapping the keys for > and ^ were interchanged, which I have corrected.

The right mapping for Fedora (for german users mac-macbook-de.map.gz) must be copied to /lib/kbd/keymaps/mac/all/. Then you have to change /etc/sysconfig/keyboard

KEYBOARDTYPE="mac"
KEYTABLE="mac-macbook-de"

On next reboot you will have german keyboard mapping.

Many of the MacBook's functions can only be accessed by function keys. By default those keys change notebook settings. To send the key event F1 you have to press Fn-F1. Those who like it the other way round (F-keys send key events, notebook settings are changed by combination with Fn) can append this line in /etc/rc.d/rc.local:

echo -n 2 > /sys/module/hid/parameters/pb_fnmode

For fuctions which are not directly connected with MacBook's hardware you will need a software which captures the unused keycodes and assigns to them meaningful actions, e.g. lineak (Linux Easy Access Keyboard, http://lineak.sourceforge.net/). This program is a part of Fedora and can be installed with the package manager yum along with some additional plugins.

Here is my configuration filelineakkb.def which describes the mapping from keycodes to actions. The file lineakd.conf describes the mapping from actions to user-defined commands.

With Xorg it was much easier to get the corret keyboard mapping for german layout, see section Keyboard0 in xorg.conf.

Sensors

The MacBook has a variety of thermal and fan sensors. You need the module applesmc to query them, for example with gkrellm. Create a file /etc/sysconfig/modules/applesmc.modules and insert this content

#!/bin/sh
echo -n "Loading Apple SMC module..."
if /sbin/modprobe applesmc; then
        echo "SUCCESS"
else
        echo "FAILURE"
fi

Remote control

The MacBook has a infrared receiver. This means it cannot communicate over IR. It cat only receive signals from a remote, but cannot send. The signals from the included remote control can be interpreted by Lirc. The support for the receiver is integrated since kernel 2.6.24. For versions below you need a patch.

Lirc in version 0.8.2 from Fedora repositories does not work with the receiver. It is necessary to install LIRC from ATrpms.net (version 0.8.3). I have found a very good manual on http://www.mactel-linux.org/wiki/Fedora8OnMacBookSantaRosa which describes the LIRC installation along with other very interesting details.

To install LIRC create a new repository description at /etc/yum.repos.d/atrpms.repo

[atrpms]
name=Fedora Core $releasever - $basearch - ATrpms
baseurl=http://dl.atrpms.net/f$releasever-$basearch/atrpms/stable
gpgkey=http://ATrpms.net/RPM-GPG-KEY.atrpms
gpgcheck=1
enabled=0

The entry enabled=0 disables this repository on default, so it won't mess up your installation. The command

yum --enablerepo=atrpms update lirc lirc-lib

temporarily activates this repository and installs LIRC. Now we have to configure it. To do this we have to edit /etc/sysconfig/lircd and make sure it contains the following line.

LIRCD_OPTIONS="-H macmini -d /dev/hiddev0 /etc/lircd.conf"

Now we need the remote's key codes. The codes from LIRC's homepage for the A1156 remote did not work for me. I have created my own configuration file with irrecord - here is my lircd.conf - copy it to /etc/lircd.conf.

When you start the LIRC service with service lirc start you should see a short success message in /var/log/messages. We are almost ready. Now we still lack configuration for several programs, e.g. mplayer or audacious. They want to know which action is connected to which button. Here is my config file lircrc - copy it to /etc/lircrc (for system wide configuration) or to ~/.lircrc (for user specific configuration). It contains configuration for both previously mentioned programs.

If your are satisfied with your work, you can enable the LIRC service permanently

chkconfig lirc on

Touchpad

The touchpad was a little problematic and refused to operate directly. The touchpad gets a different device file on every boot, depending on other USB devices, e.g. mice, which might be present. But it can be referenced by a symbolic link which is created by Fedora 8 in

/dev/input/by-id/usb-Apple_Computer_Apple_Internal_Keyboard_._Trackpad-mouse

Have a look at my xorg.conf to see how the configuration has to look like. This touchpad has some cool features - double and tripple finger taps are recognized and act as the second and third mouse button, circular scrolling, etc.

FireWire

Not tested.

USB

Works.

Externer Bildschirm

Not tested.

Specials

The fan gets quite loud on heavy processor load.

It's a beautiful notebook. MacOS is also very nice - but Linux is for fun. wink

Interesting links

Last changes on: Sunday, 5. October 2008, 22:48:51