Languages [http://wiki.Debian.org/MacBook/es spanish],

?TableOfContents

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

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

Triple 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 & install (single boot)

WARNING: you will loose Mac OS X, and all other data on the MacBook if you follow this method.

Methodology: use the bios compatibility method to boot Debian, by erasing the GPT partition table from the disk.

Make sure you've received the latest apple updates in OS X. This is needed, because the latest updates include a BIOS compatibility layer, we are going to use to boot Debian.

Boot from the CD, you might have to hold C while booting. Before setting up partitions in the installer, press ALT+F2. At the prompt, you are going to wipe the whole disk:

# dd if=/dev/zero of=/dev/sda

This clears the whole disk (remember: all data is lost), and most importantly, it deletes the GPT partition table. Switch back to the installer with pressing ALT+F1 and continue installation as normal. Remember to install the boot loader to the MBR (/dev/sda), and not to the partition boot record (like when installing with rEFIt)!

Multiboot (OS X & Debian)

Partitioning (via OS X)

Before you're 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.

Note that wasn't actually partitioning, just shrinking the OS X partition. diskutil can add other partitions too, see than man page. Also note that you only get one chance as it doesn't provide a way to remove partitions...

Preparing to dual boot (via OS X): rEFIt

First install the latest rEFIt from [http://refit.sourceforge.net/ rEFIt homepage]. For the the manual way (which is not needed) read the [http://refit.sourceforge.net/doc/c1s1_install.html rEFIt install documentation].

NOTE: The combination of pre-0.9 rEFIt and GNU parted is known to cause problems: see http://refit.sourceforge.net/doc/c4s5_parted.html. If you install an old version of rEFIt and then install Debian + Lilo, you might not be able to install Grub afterwards. Reinstalling rEFIt 0.9 or greater will fix this problem.

It's now possible to proceed with installing Debian.

Note refit doesn't support making linux the default boot choice in tripple-boot environments, so you might want to look into other options. rEFIt does support making GNU/Linux the default choice when dual-booting. From OS X, edit the /efi/rEFIt/refit.conf file and uncomment/add the line

legacyfirst

Install Debian

Get Debian from [http://www.us.debian.org/distrib/] (you might want an AMD64 edition for the Core 2 Duo ?MacBooks, but it is also possible to install the i386 (32-bit) version and use just 64-bit kernel on them).

Boot from the CD (hold down C while booting) and proceed with the 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

If you cannot type anything in the CD/DVD boot prompt (I found this problem on a MacBook Core 2 Duo), you can fix by using USB-attached keyboard. This problem seems to be related to refit, since disabling it and booting while holding the C button pressed (boots directly from CD) fixes this. (It seems that booting after the real power-off seems to have less problem than reboot with "shutdown -r now". Also it seems to help situation a bit better by not pressing keyboad except when needed.)

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 aptitude 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). On amd64 there is no refit package ([http://bugs.debian.org/383802 bug 383802] which is waiting for [http://bugs.debian.org/383801 bug 383801]). One solution I used is to start the installation, partition your hard disk, reboot and do the gptsync with the refit shell and then install

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."

If you get an error while trying to install lilo :

mkdir /mnt/sda3
mount /dev/sda3 /mnt/sda3
mount /proc/ /mnt/sda3/proc
chroot /mnt/sda3
lilo -b /dev/sda3

The GRUB included with Debian 4.0 Etch (GRUB 0.97-10 or greater) is compatible with MacBook if you configure proper MBR/GPT hybrid. Although it was possible to install GRUB during the initial d-i install with many manual fiddling processes of MBR/GPT synching, I recommend you to install LILO initially as above and install GRUB to /dev/sda3 and/or /dev/sda4 later for the ease of process and ease of updating kernel. "rEFIt " on OS X does not like anything other than MSDOS or HFS+ for file system description in GPT table when executing gptsync to create matching MBR record. So I makeked Linux partitions as MSDOS before executing gptsync. I used both disked for GPT and fdisk for MBR. Once youmark MBR with the proper file system type(eg. 83), GRUB is happy to boot Debian by looking into FS and finding files.) Here is an example of /boot/grub/menu.lst for dual booting 486 and amd64 systems:

(Linux kernel is GPT-aware thus swap partition maybe located places such as /dev/sda7)

Switching to Grub

To switch to grub you first need to change the partition type to linux. You can do this by using sfdisk to dump the partition information to a text file. Editing it to change the partition type, and then using sfdisk to save that to the partition table.

sfdisk -d /dev/sda > sda.out

edit sda.out and change the id to 83 (linux) as in the below

# partition table of /dev/sda
unit: sectors

/dev/sda1 : start=        1, size=   409639, Id=ee
/dev/sda2 : start=   409640, size= 83886080, Id=af
/dev/sda3 : start= 84295720, size= 68953126, Id=83, bootable
/dev/sda4 : start=153248846, size=  3052609, Id=82

Now mount a usb drive if possible in case you made a mistake somewhere so that you can save recovery data.

Warning!!: this next line can wipe out your partition table if you made a mistake. It might be a good time to look at the sfdisk manual if you aren't sure what this does. It may be possible to undue unspeakable damage with the hdd-partition-sectors.save file so long as you can access it, which you might not be able to do if you saved it to the disk you are editing rather than the recommended usb disk.

sfdisk /dev/sda -O /media/usbdisk/hdd-partition-sectors.save < sda.out

In case sfdisk does not work for you (complains about not being able to make the kernel reread the partition table because a partition is mounted, or mismatching start/end partition boundaries) you can alternatively use fdisk to change the partition type. Use "p" to list partitions, "t" to change partition type, and "w" to write the table back to disk.

Then you can install grub "aptitude install grub"

Once grub is installed you need to edit /etc/kernel-img.conf so that when you install a kernel image it doesn't also replace grub with lilo.

As per (zless /usr/share/doc/grub/README.Debian.gz) set to the following.

postinst_hook = /sbin/update-grub
postrm_hook = /sbin/update-grub
do_bootloader = no

Hardware

Work

The following features work

(See below for more)

Devices to be confirmed

s2ram -f -p -m works (for some values of "work") with original macbook (sys_product = "?MacBook1,1" sys_version = "1.0" bios_version = "MB11.88Z.0061.B03.0610121324") kernel 2.6.21.3 and mactel patches rev 126. Resumes with backlight off but can turn back on with pommed (usually...).

Backlight + Volume + CD Eject button

Backlight keys (Fn+F1 and Fn+F2) work using [http://www.technologeek.org Julien Blache's] [http://packages.debian.org/pommed pommed] (there is a new project homepage at [http://alioth.debian.org/projects/pommed/ alioth]); you can even turn off the backlight using the keyboard; pommed also enables the CD Eject button's functionality, Fn behaviour and remote control. Besides, you can also install [http://packages.debian.org/gpomme gpomme]: a GTK+ client suitable for all environments(you should start it when your session starts) and [http://packages.debian.org/wmpomme wmpomme](a ?WindowMaker dockapp)

To install pommed you need to update your /etc/apt/sources.list file with the correct repository, check where pomme is currently available and add it. Then run apt-get update, and then apt-get install pommed. If you use the latest version 1.3, you might get a warning that you might cause harm to your machine, if you get that, use the previous version instead to see if you get the same warning.

By default on Debian testing, the F1, F2 ... FX keys are disabled and act like Fn+F1, Fn+F2 ... To enable the keys and make use of Fn+FX, modify /etc/pommed.conf by changing fnmode = 1 to fnmode = 2 and restart pommed with /etc/init.d/pommed restart.

To enable the sound keys (Fn+F3, Fn+F4 and Fn+F5), you have to modify /etc/pommed.conf : change init = -1 to init = 80 and (at least on Macbook 2) change volume = "PCM" to volume = "Front" and after that restart pommed with /etc/init.d/pommed restart.

Video

To get video to work properly, you need to adjust the resolution using

the [http://packages.debian.org/915resolution 915resolution] package:

aptitude 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.

For highres video playback something like the following is needed in the Device section:

        Option          "LinearAlloc" "6144"
        Option          "CacheLines" "1080"

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.

Note when using an external display: unless the display resolution is in the small builtin supported list (it won't be if it's widescreen or highres) then you'll need to use 915resolution to set a mode for the external display too.

Note when using multiple displays: the order for ?MonitorLayout is "pipe a, pipe b" but this corresponds to "screen 1, screen 0", not "screen 0, screen 1" as you might expect (and isn't documented in the man page...)

Dual Screen (for sid user)

Can not use Dual screen with xorg of sid(2007/07/20) and old xorg.conf on Macbook. If you use dual screen on xorg 7.2 , xorg doesn't start.

(II) intel(0): Kernel reported 104960 total, 1 used
(II) intel(0): I830CheckAvailableMemory: 419836 kB available
(==) intel(0): VideoRam: 262144 KB
(II) intel(0): Attempting memory allocation with tiled buffers and
               large DRI memory manager reservation:
(WW) intel(0): xf86AllocateGARTMemory: allocation of 10 pages failed
        (Cannot allocate memory)
(II) intel(1): Allocating 0 scanlines for pixmap cache

Backtrace:
0: X(xf86SigHandler+0x81) [0x80c8591]
1: [0xb7faa420]
2: /usr/lib/xorg/modules/drivers//i810_drv.so [0xb7bf8ec0]
3: /usr/lib/xorg/modules/drivers//i810_drv.so [0xb7bf9e6e]
4: /usr/lib/xorg/modules/drivers//i810_drv.so(i830_allocate_2d_memory+0x131) [0xb7bfa161]
5: /usr/lib/xorg/modules/drivers//i810_drv.so [0xb7bf5f2e]
6: X(AddScreen+0x1ee) [0x80764be]
7: X(InitOutput+0x21e) [0x80a7b6e]
8: X(main+0x27b) [0x8076c6b]
9: /lib/i686/cmov/libc.so.6(__libc_start_main+0xdc) [0xb7dc3ebc]
10: X(FontFileCompleteXLFD+0x1e5) [0x80761a1]

Fatal server error:
Caught signal 11.  Server aborting

I write new xorg.conf and how to setting method below.

New xorg.conf

Section "Files"
        FontPath        "/usr/share/fonts/X11/misc"
        FontPath        "/usr/X11R6/lib/X11/fonts/misc"
        FontPath        "/usr/share/fonts/X11/cyrillic"
        FontPath        "/usr/X11R6/lib/X11/fonts/cyrillic"
        FontPath        "/usr/share/fonts/X11/100dpi/:unscaled"
        FontPath        "/usr/X11R6/lib/X11/fonts/100dpi/:unscaled"
        FontPath        "/usr/share/fonts/X11/75dpi/:unscaled"
        FontPath        "/usr/X11R6/lib/X11/fonts/75dpi/:unscaled"
        FontPath        "/usr/share/fonts/X11/Type1"
        FontPath        "/usr/X11R6/lib/X11/fonts/Type1"
        FontPath        "/usr/share/fonts/X11/100dpi"
        FontPath        "/usr/X11R6/lib/X11/fonts/100dpi"
        FontPath        "/usr/share/fonts/X11/75dpi"
        FontPath        "/usr/X11R6/lib/X11/fonts/75dpi"
        # path to defoma fonts
        FontPath        "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
EndSection

Section "Module"
        Load    "i2c"
        Load    "bitmap"
        Load    "ddc"
        Load    "dri"
        Load    "extmod"
        Load    "freetype"
        Load    "glx"
        Load    "int10"
        Load    "type1"
#       Load    "vbe"
EndSection

Section "Extensions"
#       Option "Composite" 
        Option "Composite" "Enable"
#       Option "RENDER" "Enable"
EndSection

Section "InputDevice"
        Identifier      "Generic Keyboard"
        Driver          "kbd"
        Option          "CoreKeyboard"
        Option          "XkbRules"      "xorg"
        Option          "XkbModel" "pc106"
        Option          "XkbLayout" "us"
        Option          "XkbOptions"    "ctrl:nocaps"
EndSection

Section "InputDevice"
        Identifier      "Configured Mouse"
        Driver          "mouse"
        Option          "CorePointer"
        Option          "Device"                "/dev/input/mice"
        Option          "Protocol"              "ExplorerPS/2"
        Option          "Emulate3Buttons"       "true"
EndSection

Section "InputDevice"
Identifier      "Synaptics Touchpad"
Driver          "synaptics"
Option          "SendCoreEvents"        "true"
Option          "Device"                "/dev/psaux"
Option          "Protocol"              "auto-dev"
Option          "SHMConfig"             "true"
Option          "LeftEdge"              "100"
Option          "RightEdge"             "1120"
Option          "TopEdge"               "50"
Option          "BottomEdge"            "310"
Option          "FingerLow"             "25"
Option          "FingerHigh"            "30"
Option          "VertScrollDelta"       "20"
Option          "HorizScrollDelta"      "50"
Option          "MinSpeed"              "0.79"
Option          "MaxSpeed"              "0.88"
Option          "AccelFactor"           "0.0015"
#    Option          "HorizScrollDelta"      "0"
EndSection

Section "Device"
        Identifier      "Intel Corporation Mobile 945GM/GMS/940GML Express Integrated Graphics Controller"
        Driver          "i810"
        BusID           "PCI:0:2:0"
        Option          "XAANoOffscreenPixmaps" "true"
EndSection

Section "Monitor"
        Identifier      "Generic Monitor"
        Option          "DPMS"
EndSection

Section "Screen"
        Identifier      "screen0"
        Device          "Intel Corporation Mobile 945GM/GMS/940GML Express Integrated Graphics Controller"
        Monitor         "Generic Monitor"
        DefaultDepth    24
        SubSection "Display"
                Depth           16
                Virtual         2560 1600
        EndSubSection
        SubSection "Display"
                Depth           24
                Virtual         2560 1600
        EndSubSection
EndSection

Section "ServerLayout"
        Identifier      "Default Layout"
        Screen          "screen0"
        InputDevice     "Generic Keyboard"
        InputDevice     "Synaptics Touchpad"
        InputDevice     "Configured Mouse"
        Option          "AIGLX" "true"
#       Option          "Xinerama" "on"
EndSection

Enable dual screen

xrandr --output VGA --mode 1024x768
xrandr --output VGA --right-of LVDS

Disable dual screen

xrandr --output VGA --off

Sound

ALSA driver snd_hda_intel works for playback as of 2.6.18-rc1.

MacBook with Debian 4.0 Etch has no problem with sound. Although, you may need to run alsaconf as root.

If you hear any distortions even when all of the mixer settings are at least 20% below their maximum, it might help to load snd-hda-intel with the 'position_fix=1' option. In the file /etc/modprobe.d/alsa-base, change the line

install snd-hda-intel /sbin/modprobe --ignore-install snd-hda-intel $CMDLINE_OPTS && /lib/alsa/modprobe-post-install snd-hda-intel

to

install snd-hda-intel position_fix=1 /sbin/modprobe --ignore-install snd-hda-intel $CMDLINE_OPTS && /lib/alsa/modprobe-post-install snd-hda-intel

Note the microphone requires mactel patches and the following to activate:

amixer sset 'Input Source' Line; amixer sset 'Input Source' Mic; amixer sset Mux 20.00dB

Wireless

Add 'non-free' to your main Debian repository then update your packages list with

aptitude update

Install the madwifi kernel module source and the ability to compile it

aptitude install madwifi-source madwifi-tools module-assistant

Compile it

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.

Install wireless support

aptitude 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 (unless you intend to use network Manager, in which case you don't need this)

# Starts the Atheros / madwifi wireless on boot
auto ath0
iface ath0 inet dhcp

Restart networking.

/etc/init.d/networking retstart

The quick and ugly way until 0.9.30.13 or later is available as .deb package:

svn checkout http://svn.madwifi.org/trunk madwifi-hal-0.9.30.13 
cd madwifi-hal-0.9.30.13/
make
make install

or:

apt-get install wget
wget http://snapshots.madwifi.org/madwifi-hal-0.9.30.13-current.tar.gz
tar zxfv madwifi-hal-0.9.30.13-current.tar.gz
cd madwifi-hal-0.9.30.13/
make
make install

Keyboard & Synaptics Touchpad

Configure AltGr

To enable the right Apple key, in X, to alt-gr, add the "?XkbOptions" line below in /etc/X11/xorg.conf

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

and to do the same for the Linux console adding the line below to /etc/console-tools/remap

s/keycode 126 =/keycode 126 = AltGr/;

Bad Mapping

If two specific keys ("§" and "<" on german layouts) are swapped then add  apple:badmap  to ?XkbOptions (again in /etc/X11/xorg.conf and separated by a comma) for X11 and edit /etc/console-tools/remap for the Linux console.

Synaptics Touchpad

If you want to use the Synaptics touchpad add these lines to /etc/modprobe.d/

install usbhid /sbin/modprobe appletouch; /sbin/modprobe --ignore-install usbhid $CMDLINE_OPTS

Then add  appletouch  to /etc/initramfs-tools/modules and then run  update-initramfs 

This is just a tip for configuring the synaptics touchpad. You have to install the synaptics driver for Xorg for enabling the touchpad. On my configuration, I set one finger tap on the pad = right mouse click and two finger tap = middle mouse click, I have disabled the two finger scrolling and let the vertical right edge scrolling. Here is the mouse section of my xorg.conf :

Section "InputDevice"
  Identifier      "Synaptics Touchpad"
  Driver          "synaptics"
  Option          "SendCoreEvents"        "true"
  Option          "Device"                "/dev/psaux"
  Option          "Protocol"              "auto-dev"
  Option          "SHMConfig"             "true"
  Option          "New AccelFactor"       "0.03"
  Option          "LeftEdge"              "100"
  Option          "RightEdge"             "1120"
  Option          "TopEdge"               "50"
  Option          "BottomEdge"            "310"
  Option          "FingerHigh"            "30"
  Option          "MinSpeed"              "0.94"
  Option          "MaxSpeed"              "1"
  Option          "AccelFactor"           "0.0015"
  Option          "FingerLow"             "20"
  Option          "HorizScrollDelta"      "0"
  Option          "MaxTapTime"            "150"
  Option          "TapButton1"            "3"
  Option          "TapButton3"            "0"
  Option          "VertEdgeScroll"        "1"
  Option          "HorizEdgeScroll"       "1"
  Option          "VertScrollDelta"       "5"
  Option          "VertTwoFingerScroll"   "0"
  Option          "HorizTwoFingerScroll"  "0"
EndSection

To find out about the synaptics options, type man synaptics in a terminal.

Fn-key behaviour

If you want to change the bahaviour of the Fn-keys look at /etc/pommed.conf after you've installed pommed. (Or look at the parameters of the hid kernel module.)

Other issues

Screenshots:

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

xmodmap -e "keycode 115 = Alt_L"           # left-apple
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? --> Yes, even on the newer MacBook(osamu). Apply the mactel-linux patch to the kernel and recompile it! The use of [http://packages.debian.org/pommed pommed] program as written above makes it work better. (I recompiled the current Debian version of 2.6.18 source with the mactel-linux patch [is that the Etch version of 2.6.18?]. This patch solves issues for fn-arrows and fn-Fn keys for the newer ?MacBooks while addressing few other issues.)

[http://bugs.debian.org/379789 #379789] has been filed to track down a problem with keymap

To work around issues of missing/unresponsive keys on the MacBook Japanese models, see MacBookJp for helpful scripts (Japanese page but scripts are in English. The real fix needs to happen in the kernel source drivers/usb/input.).

Processor

CPU frequency scaling

CPU frequency scaling is governed by SPEEDSTEP_CENTRINO kernel module.

echo speedstep_centrino >> /etc/modules

If that does not work, you can also use the acpi_cpufreq module:

echo acpi_cpufreq >> /etc/modules

CPU frequency scaling in kernel

To avoid unnecessary overhead you can let kernel scale the CPU frequency automatically. Just load module cpufreq_ondemand or cpufreq_conservative. The ondemand-module is perhaps better choice if you want the system to be as responsive as possible.

Next add this to /etc/rc.local or to another startup script:

CPU frequency scaling in userspace

In case you want more complex CPU frequency scaling schemes, you can just load the module cpufreq_userspace, set it as default (see above) install [http://packages.debian.org/powernowd powernowd] or [http://packages.debian.org/cpufreqd cpufreqd] package for CPU frequency scaling. There are several other daemons available, but those two work quite well.

Powertop

If you are serious about saving power, take a look at [http://www.linuxpowertop.org/powertop.php Powertop] program. It is a very good interactive program that gives suggestions on how to minimize CPU wakeups. I was able to drop wakeups from around 1500 to roughly 400 with the aid of this program.

infrared receiver

Use the usual HID device; kernel patch available as of 2006-07-17.

If the  appleir  driver is also compiled as a module, change the line described in the keyboard section of this page to the following, so  appletouch  and  appleir  get loaded before usbhid:

install usbhid /sbin/modprobe appletouch; /sbin/modprobe appleir; /sbin/modprobe --ignore-install usbhid $CMDLINE_OPTS

Also add  appleir  to /etc/initramfs-tools/modules and re-run  update-initramfs .

iSight

On old Macbooks iSight might work with the linux-uvc driver with patches. It is installable with

# aptitude install linux-uvc-source linux-uvc-tools 

Once the 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.

# aptitude install ekiga libpt-plugins-v4l2
$ ekiga

If you are using a semi-recent Macbook, the linux-uvc drivers from the Debian repositories won't probably work - at least not with Debian Etch. Drivers from Testing or Unstable does also not work (backported linux-uvc-0.1.0.svn54 from SID). Luckily there are at least two patched versions of the linux-uvc drivers especially for the iSight. Finding them is not trivial unless you know where to look (svn rev.100 bundle: http://i-nz.net/projects/linux-kernel/). Probably the best way to find them is to go to [http://sourceforge.net/mailarchive/forum.php?forum_name=mactel-linux-users Mactel-linux-users mailinglist archive] and search for "iSight". By following the threads you'll find the various patched linux-uvc drivers. Don't bother downloading any patches, as they are meant to be applied against specific old (svn) revisions of linux-uvc drivers and probably many chunks will be rejected. Go for the s.c. "bundles" which contain whole patched linux-uvc code.

The patched drivers are relatively easy to build and install: just do a "make && make install" and you're set. In case build fails, just do a

aptitude install apt-file
apt-file update
apt-file search name_of_the_missing_header_file

After this install the something-dev package that apt-file gave you, and try again, until the build and install ends without errors. Then do

modprobe -r uvcvideo
modprobe uvcvideo

Now you can test the driver with Ekiga, as shown above. Alternatively you can use mplayer to test the driver. First edit $HOME/.mplayer/config and add this line to it:

# Write your default config options here!
# $HOME/.mplayer/config
# Built-in iSight
# This works at least for a 9/2006 Core Duo Macbook 
tv=driver=v4l2:input=1:width=320:height=240:device=/dev/video0:outfmt=uyvy:fps=24

Then launch mplayer for console:

mplayer tv://

If you see your face, iSight is probably working :). Attention! I only see a green video, nevertheless it works with ekiga!

NOTE: When you get your iSight working, copy the iSight firmware somewhere safe. Mac OS X updates might contain new iSight firmware which could break the Linux iSight support. In this case you can revert back to the old, working firmware.

Kernel patch and hardware tool resource

[http://www.mactel-linux.org/ Mactel-Linux] has mactel specific kernel patch and hardware tool resource. Its subversion archive can be seen at http://svn.sourceforge.net/viewvc/mactel-linux by the browser or retrieved by:

 $ svn co https://mactel-linux.svn.sourceforge.net/svnroot/mactel-linux mactel-linux

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://mactel-linux.svn.sourceforge.net/viewvc/mactel-linux/trunk/tools/temperature/

You need to load the msr module before using the coretemp tool :

modprobe msr

Download Makefile and coretemp.c.

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

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

Note: no sensors are detected below, just EEPROMs.

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 available in Debian 4.0 Etch (or kernel 2.6.16 and above).

See [http://bugs.debian.org/378521 #378521]

Video

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

aptitude 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