Thread available [http://lists.debian.org/debian-devel/2006/07/msg00008.html here]

Debian Etch on a MacBook HOWTO (triple-boot) at:

Boot process described is rEFIt to LILO to Linux (as discussed in above-linked thread.)

Relevant information elsewhere on this wiki: MacMiniIntel and MacBookPro.

Partitioning (via OS X)

Before being able to install Debian, you need to repartition the disk; supposing you want to reserve 20Gb for your OS X partition, run the following command from a terminal (Applications -> Utility -> Terminal):

Mac OS X $ sudo diskutil resizevolume disk0s2 20G
Started resizing on disk disk0s2 Macintosh HD
Verifying
Resizing Volume
Adjusting Partitions
Finished resizing on disk disk0s2 Macintosh HD
WARNING: You must now reboot!

Support for the resizevolume verb was added in Mac OS X 10.4.6. If you have an earlier version, you'll need to upgrade.

Preparing to dual boot (via OS X): rEFIt

Now [http://refit.sourceforge.net/ Download] and install rEFIt (the following example is done with disk image):

sudo cp -r /Volumes/rEFIt/efi /efi
cd /efi/refit
./enable.sh

it's now possible to proceed installing Debian.

Install Debian

Grab and burn an image from the [http://www.debian.org/devel/debian-installer/ d-i website]; for example a daily [http://cdimage.debian.org/cdimage/daily-builds/daily/arch-latest/i386/iso-cd/debian-testing-i386-netinst.iso netinst]

Boot from the CD (hold down C while booting) and proceed with installation. When you reach the "Install the GRUB boot loader on a hard disk" step, switch to the second virtual console by pressing ctrl-option-F2, press return to start the shell, and then enter

 chroot /target apt-get install refit
 /target/sbin/gptsync /dev/sda

and enter y at the prompt.

Switch back to the first virtual console by pressing ctrl-option-F1 and select <Go back> in response to the "Install the GRUB boot loader to the master boot record". Choose "Install the LILO boot loader on a hard disk" from the main menu and choose /dev/sda3 for the LILO installation target.

Gigabit Ethernet

Your kernel must have support for the Yukon Gigabit Ethernet driver known as sky2. See [http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=378521 #378521]

Wireless

apt-get install madwifi-source madwifi-tools module-assistant

Finally,

# m-a prepare
# m-a a-i madwifi
# depmod -a
# modprobe ath_pci

See [http://madwifi.org/wiki/UserDocs/Distro/Debian/MadWifing madwifi wiki] for more details.

Keyboard

Configure right apple key to alt-gr adding the "?XkbOptions" line below

Section "InputDevice"
        Identifier      "Generic Keyboard"
        Driver          "kbd"
        Option          "CoreKeyboard"
        Option          "XkbRules"      "xorg"
        Option          "XkbModel"      "pc105"
        Option          "XkbLayout"     "it"
        Option          "XkbOptions"    "lv3:rwin_switch"
EndSection

Screenshots:

Alternatively you can work around with xmodmap and xkbset. xkbset is useful for emulating mouse buttons with keyboard.

xmodmap -e "keycode 115 = Alt_L"
xmodmap -e "keycode 116 = Zenkaku_Hankaku" # right-apple
xmodmap -e "keycode 108 = Pointer_Button3" # KP-ENTER
xmodmap -e "keycode 204 = Pointer_Button2" # eject
xkbset m

Has anyone made the fn key work? I can't so to get Page Up and Down I use:

xmodmap -e "keycode 116 = Page_Up" # Right-Apple
xmodmap -e "keycode 108 = Page_Down" # KP-Enter

[http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=379789 #379789] has been filed to track down a problem with keymap

Video

The video chipset shipped with Macbook is 945GM; to get video to work properly, you need to adjust the resolution using the [http://packages.debian.org/unstable/x11/915resolution 915resolution] package

apt-get install 915resolution
915resolution -c 945 54 1280 800

then edit /etc/default/915resolution

#
# 915resolution default
#
# find free modes by  /usr/sbin/915resolution -l
# and set it to MODE
# e.g. use MODE=54 
MODE=54
#
# and set resolutions for the mode.
# e.g. use XRESO=1024 and YRESO=768
XRESO=1280
YRESO=800
#
# We can also set the pixel mode.
# e.g. use BIT=32
# Please note that this is optional,
# you can also leave this value blank.
BIT=32

Adjust the Monitor section of /etc/X11/xorg.conf

Section "Monitor"
        Identifier      "Color LCD"
        Option          "DPMS"
        HorizSync       28-64
        VertRefresh     43-60
        Modeline "1280x800@60" 83.91 1280 1312 1624 1656 800 816 824 841
EndSection

and make sure the Screen sections uses "1280x800" as default resolution in the Modes lines and finally

/etc/init.d/915resolution start

See also an [http://sourceforge.net/mailarchive/forum.php?thread_id=20229481&forum_id=47881 xorg.conf file] which enables use of an external monitor.

Sound

ALSA driver snd_hda_intel seems to work for playback as of 2.6.18-rc1.

With kernel 2.6.16-2 and 2.6.17-1 available in the Debian archives, no sound comes out of the speakers.

cpufreq

CPU frequency scaling is governed by SPEEDSTEP_CENTRINO kernel module. Enable that module, and install cpufreq package for CPU frequency scaling.

USB

usual EHCI, UHCI stuff

infra red receiver

Just usual HID device, kernel patch available as of 2006-07-17.

iSight

iSight works with linux-uvc drivers with patches. It is installable with

# apt-get install linux-uvc-source linux-uvc-modules 

Once source and tools are installed, then:

# m-a prepare
# m-a a-i linux-uvc
# mount -t hfsplus /dev/sda2 /mnt/mac/
# macbook-isight-firmware-loader /mnt/mac/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS/AppleUSBVideoSupport
# modprobe uvcvideo

Test it with ekiga.

# apt-get install ekiga libpt-plugins-v4l2
$ ekiga

Hardware Sensors

MacBook contains the 82801G (ICH7 Family) and [http://www.lm-sensors.org/wiki/SupportedDevices ICH7 is supported by lm_sensors since sensors 2.9.0] by the [http://www.lm-sensors.org/browser/lm-sensors/trunk/doc/busses/i2c-i801 i2c-i801 kernel driver] which has been in the kernel since 2.6.11.

# sensors-detect revision 1.413 (2006/01/19 20:28:00)

...
Probing for PCI bus adapters...
Use driver `i2c-i801' for device 00:1f.3: Intel ICH7
Probe succesfully concluded.

We will now try to load each adapter module in turn.
Module `i2c-i801' already loaded.
If you have undetectable or unsupported adapters, you can have them
scanned by manually loading the modules before running this script.

 To continue, we need module `i2c-dev' to be loaded.
 If it is built-in into your kernel, you can safely skip this.
 i2c-dev is not loaded. Do you want to load it now? (YES/no): yes
 Module loaded succesfully.

 We are now going to do the adapter probings. Some adapters may hang halfway
 through; we can't really help that. Also, some chips will be double detected;
 we choose the one with the highest confidence value in that case.
 If you found that the adapter hung after probing a certain address, you can
 specify that address to remain unprobed. That often
 includes address 0x69 (clock chip).

Next adapter: SMBus I801 adapter at efa0
Do you want to scan it? (YES/no/selectively):
Client found at address 0x08
Client found at address 0x38
Probing for `Philips Semiconductors SAA1064'... Failed!
Client found at address 0x3a
Probing for `Philips Semiconductors SAA1064'... Failed!
Client found at address 0x44
Probing for `Maxim MAX6633/MAX6634/MAX6635'... Failed!
Client found at address 0x50
Probing for `SPD EEPROM'... Success!
    (confidence 8, driver `eeprom')
Probing for `DDC monitor'... Failed!
Probing for `Maxim MAX6900'... Failed!
Client found at address 0x52
Probing for `SPD EEPROM'... Success!
    (confidence 8, driver `eeprom')
Client found at address 0x69


....

Driver `eeprom' (should be inserted):
  Detects correctly:
  * Bus `SMBus I801 adapter at efa0'
    Busdriver `i2c-i801', I2C address 0x50
    Chip `SPD EEPROM' (confidence: 8)
  * Bus `SMBus I801 adapter at efa0'
    Busdriver `i2c-i801', I2C address 0x52
    Chip `SPD EEPROM' (confidence: 8)


I will now generate the commands needed to load the I2C modules.

To make the sensors modules behave correctly, add these lines to
/etc/modules:

#----cut here----
# I2C adapter drivers
i2c-i801
# I2C chip drivers
eeprom
#----cut here----

# uname -a
Linux coreduo 2.6.18-rc1dancer #2 SMP Sun Jul 9 09:57:01 JST 2006 i686 GNU/Linux

A GPL program called [http://speedit.increw.org/trac.cgi/wiki/SpeedIt ?SpeedIt] is apparently able to provide CPU temperature under OS X. Perhaps it could be adapted to work under GNU/Linux.

Devices to be confirmed

Resources