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

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

Trible boot (inc. Debian Etch) 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.

Installation

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] or [http://cdimage.debian.org/cdimage/etch_di_rc1/i386/iso-cd/debian-testing-i386-netinst.iso etch i386 RC1] or [http://cdimage.debian.org/cdimage/etch_di_rc1/amd64/iso-cd/debian-testing-amd64-netinst.iso etch amd64 RC1] for the Dual 2 Core ?MacBooks).

Boot from the CD (hold down C while booting) and proceed with installation.

If you have strange keyboard problems (double keypresses) or other problems while booting from the install CD, use the following command line on the boot prompt:

install noapic irqpoll acpi=force

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. (This syncs the [http://en.wikipedia.org/wiki/Master_Boot_Record MBR] from the [http://en.wikipedia.org/wiki/GUID_Partition_Table GPT], which were made out of sync by parted)

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. Do not install LILO to the MBR! When the installer asks if you want to make this partition active, choose "No."

Hardware

Work

The following work, either out of the box or (if stated), with work

(See below for more)

Devices to be confirmed

Video

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

This is all that you have to do: 915resolution automatically sets the correct video modes, and X is configured properly (presuming that you selected the 1280x800 mode during install, which it should default to).

This adds the monitor's actual resolution to the Intel 915's video modes. Without this, you will get 1024x768 (the biggest normal size that fits), which is rescaled and fuzzy.

The video chipset shipped with Macbook is 945GM.

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 works for playback as of 2.6.18-rc1.

With (current Etch, as of 2006-11-26) kernel 2.6.16-2 and 2.6.17-1 available in the Debian archives, no sound comes out of the speakers.

Wireless

Add the following to /etc/apt/source.list

# Testing
deb http://ftp.au.debian.org/debian testing main contrib non-free
deb-src http://ftp.au.debian.org/debian testing main contrib non-free

After adding the sources above to source.list do

apt-get update

Then,

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/MadWifi] for more details.

Now that you have the madwifi tools install iwconfig

apt-get install wireless-tools

See [http://www.linuxcommand.org/man_pages/iwconfig8.html] for more details on iwconfig

To start wireless up on boot, add the following to /etc/network/interfaces

# Starts the wireless on boot
auto ath0
iface ath0 inet dhcp

Afterwards reboot or restart networking.

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

cpufreq

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

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-tools 

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

Kernel

CONFIG_FB_IMAC support is for booting from ELILO (EFI). You are most probably using lilo/rEFIt to boot, using IMAC driver will make your screen appear scrambled. Use CONFIG_FB_I810 driver instead.

Helpful guide on compiling a mactel kernel: http://gentoo-wiki.com/HARDWARE_Apple_MacBook

Hardware Sensors

tool available from: http://svn.sourceforge.net/viewvc/mactel-linux/trunk/tools/temperature/

$ sudo ./coretemp.c
CPU 0: 69 C
CPU 1: 69 C

$ sudo hddtemp /dev/sda
/dev/sda: ST98823AS: 38°C

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

Old hardware issues

USB

usual EHCI, UHCI stuff

Gigabit Ethernet

Your kernel must have support for the Yukon Gigabit Ethernet driver known as sky2; this is built-in in 2.6.16 and above.

See [http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=378521 #378521]

Video

915resolution now works automatically; the below (old) instructions show how to do it manually, but this is no longer necessary:

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

Resources


?CategoryLaptop