Below find some dated contents for using Debian on a MacBook.
These contents contain tips for older kernel versions. Since leaving these in the main text interfares with the need of typical users, I have moved these parts here even though some parts of these may still be useful for newer systems. (osamu)
How to change the kernel to amd64 if i386 Debian installed (MacBook Core 2 Duo)
If you wish to have true 64 bit system, I recommend you to use amd64 installer to install a fresh system. The method described in the following only switches kernel to 64bit. The user land tool remains as i386 binaries. The title is correct but this is nothing more than that. If others agree, this section may be removed. (osamu)
Even if you installed debian i386, it is possible to install the amd64 kernel afterwards.
Install the amd64 kernel: Simply run
aptitude install linux-image-amd64
This should install the amd64 kernel and also update the LILO boot loader to automatically boot into amd64.
Reboot: Reboot to start the amd64 kernel.
VALIDATION: To validate that the amd64 kernel is running, run
The output should be something like
[!!]This section below is not a problem anymore in Lenny Beta 2. Full resolution is supported in the default x.org
. TROUBLESHOOTING (1280x800 resolution is gone): Installing the amd64 kernel might disrupt the 1280x800 resolution. See the section Upgrade to resolution of 1280x800 for how to fix this. You will probably have to this manually. TROUBLESHOOTING (automatic update back to i686): After you have installed the amd64 kernel the old kernel i686 is still present and if you perform an automatic update under aptitude, the i686 might be updated and the LILO changed back to boot into the i686 kernel. It might therefore be advisable to remove the i686 kernel, see below. If you want to keep the i686 kernel but still boot into amd64, you can edit file /etc/lilo.conf and change the default variable to the amd64 image. You find valid values in the label entries and have to guess, which one is the amd64 image, because the names are not very instructive (it could be LinuxOLD, for example). After having changed the value, run lilo in a terminal to make the change active. Then reboot. It might also be an option to add
to the configuration file (do not forget to run lilo afterwards). prompt tells LILO to start a menu that allows you to select either of the two kernels. timeout=100 tells LILO to automatically boot into the default kernel after 10 seconds. See man lilo.conf for details. However, also this suffers from the nasty dead-keyboard problem mentioned above, see TROUBLESHOOTING (dead keyboard), so that in most of the cases you get the menu, but you don't get the chance to use it, because the keyboard does not work.
Remove the i686 kernel: To avoid the problem that an automatic update brings you back to the i686 kernel (see TROUBLESHOOTING (automatic update back to i686) above) you can remove the i686 kernel from within aptitude. Run aptitude, search forward (press '/') for linux-image, mark for purge (press '_' and not '-') all installed packages that start with linux-image and end on 686, perform the purge (press 'g' twice). Finally, run lilo in a shell (if required).
. TROUBLESHOOTING (Couldn't find valid RAM disk): With recent amd64 kernel images (at least 2.6.26 and probably also 2.6.25), the initial ramdisk is too large to be properly supported by LILO (even when the option large-memory is set). A solution is to set
(instead of MODULES=most) in /etc/initramfs-tools/initramfs.conf, so that the initrd.img file gets smaller at (re-)installation of the linux-image-amd64 package (see 479607 for a discussion).
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).
Suspend and sky2
- suspend (works, unload module sky2 before suspending; tested with kernel 2.6.20) (no longer necessary in kernel 2.6.26)
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 22.214.171.124 and mactel patches rev 126. Resumes with backlight off but can turn back on with pommed (usually...), also external display resumes with DPMS disabled. Apparently Ubuntu got the backlight turned on when resuming, need to investigate how to solve this issue.
Note that kernel 126.96.36.199 somehow breaks the external display with stable i810 X.org - but works fine in 2.6.26.
915resolution now works automatically; the below (old) instructions show how to do it manually, but this is no longer necessary:
Upgrade to resolution of 1280x800 (for sarge)
Not required in Lenny, x.org now supports the card properly
After installation of Debian, there will be only very few screen resolutions available, e.g. only 1024x768, 800x600, and 640x480 (1024x768 is the biggest normal size that fits the screen). The resolution of the screen of a MacBook (Intel 915, video chipset 945GM) is 1280x800 and rescaling the 1024x768 display to 1280x800 results in a fuzzy and distorted picture.
To get support for the 1280x800 resolution you have to install the 915resolution package.
Install 915resolution: As root run
aptitude install 915resolution
915resolution should automatically set the correct video mode for 1280x800 and configure X properly.
Restart X: Press Ctrl-Alt-Backspace to restart X, but close any sensitive application first.
If it works and you get high resolution, you should see it right away from the more focussed image. You can also check it under Main menu -> Desktop -> Preferences -> Screen resolution.
TROUBLESHOOTING (automatic setup did not work): If the automatic setup of 915resolution did not work for some reason (happened once after upgrading to amd64), you can set it up manually. Edit file /etc/defaults/915resolution and set the following variables.
MODE=5c XRESO=1280 YRESO=800 BIT=32To check whether it works, run
- as root and then restart X by pressing Ctrl-Alt-Backspace (but first close all sensitive applications). If you get the high resolution, reboot to test whether it also works automatically during boot.
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
Sound for etch and early testing of lenny
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
install snd-hda-intel position_fix=1 /sbin/modprobe --ignore-install snd-hda-intel $CMDLINE_OPTS && /lib/alsa/modprobe-post-install snd-hda-intel
The microphone requires mactel patches and the following to activate (with original macbook, kernel 188.8.131.52 and mactel patches rev 126):
amixer sset 'Input Source' Line; amixer sset 'Input Source' Mic; amixer sset Mux 20.00dB
The microphone did not worked on debian testing with kernel 2.6.21. However I made it work by compiling alsa from subversion (as of 12/08/07) on kernel 2.6.21 without mactel patches.
Mixer channels are as follows (with original macbook, kernel 184.108.40.206, and mactel patches rev 126):
Master: Builtin tweeter level. No effect on heaphones. PCM: Master volume for speakers and headphones. This is the channel controlled by pommed. Front: Builtin woofer level. Headphone level. Surro..: ? Line In as Output: ? IEC958: ? Capture: ? Input Source: ? See above for builtin mic. Mux: ? See above for builtin mic.
Optical drive analog CD audio output doesn't appear to work (with original macbook, kernel 220.127.116.11, mactel patches rev 126, xmcd 2.6-19.1).
Important note for the headphones sound : the Surround volume controls the headphones sound; thus, in order to have sound in your headphones after plugging them into the laptop, you have to unmute the Surround volume and set it higher (you can set it at maximum) (you can use alsamixer for example : type alsamixer in a console, go to the 'Surround' volume with the 'right' and 'left' arrow keys, push the 'm' key until you see 'OO' instead of 'MM' and after that push the 'up' arrow key to set the volume higher)
Important note for new Macbook Users : since late 2007, macbooks have used the santa rosa platform as their chipset, consequently sound doesn't work out of the box with Etch, or Testing. Support is included in 2.6.24 kernel, however, it fails to auto-detect the chipset. You must edit /etc/modprobe.d/sound and add the following line:
options snd-hda-intel model=mbp3
Sound on ?MacBook2,1 distorted (sudo dmidecode -s system-product-name): Either a lack of sound, or distorted sound through one or both channels has been experienced on these macbooks. The fix seems to depend on the kernel version. In /etc/modprobe.d/sound try the following configs, removing and reloading the module after each change (rmmod snd_hda_intel && modprobe snd_hda_intel). Note, gnome-mixer and pulse audio will commonly prevent the unloading of these modules. To test run speaker-test -c2 -twav:
#<=2.6.26 options snd_hda_intel model=intel-mac-v3 position_fix=1
#==2.6.28 options snd_hda_intel model=intel-mac-auto position_fix=2
Synaptics Touchpad information for pre-lenny systems
Although contents in this section are quite rich and interesting, these are old information which may not be exactly applicable to new lenny and later systems.
With 7.3 version of x.org and linux 2.6.22, it should work out of the box: the tapping of touchpad with two fingers should generate a middle-button click and tapping it with three fingers will generate a right-button click. Please see below more information if you wish to re-configure it.
For older versions, you need to have a kernel with at least:
Afterwards, edit /etc/X11/xorg.conf and in the Module section, add the following line:
If you want to use the Synaptics touchpad you may also need to 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.
If you just want to reconfigure it with synaptics:
1. Add "synaptics" module in the module section. 2. If not present, add the correct identifier of the touchpad in the ?ServerLayout section. 3. Proceed with the guide.
One possible setup:
Section "InputDevice" Identifier "Configured Mouse" Driver "synaptics" Option "SendCoreEvents" "true" Option "Device" "/dev/input/mice" Option "Protocol" "auto-dev" Option "LeftEdge" "0" Option "RightEdge" "850" Option "TopEdge" "0" Option "BottomEdge" "645" Option "MinSpeed" "0.4" Option "MaxSpeed" "1" Option "AccelFactor" "0.02" Option "FingerLow" "55" Option "FingerHigh" "60" Option "MaxTapMove" "20" Option "MaxTapTime" "100" Option "HorizScrollDelta" "0" Option "VertScrollDelta" "30" Option "SHMConfig" "on" EndSection
Another possible setup:
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
Yet another possible setup here...
- Left click with only the button, no tapping (as in OS X). Reduces accidental cursor jumping + clicking which can drive one nuts.
- Tapping upper left corner = Middle click
- Tapping upper right corner = Right click
- Sliding across right edge of the touchpad = Scroll up and down
Section "InputDevice" Identifier "Synaptics Touchpad" Driver "synaptics" Option "AlwaysCore" #Option "Device" "/dev/input/by-id/usb-Apple_Computer_Apple_Internal_Keyboard_._Trackpad-mouse" Option "Device" "/dev/input/mice" Option "Protocol" "auto-dev" Option "HorizScrollDelta" "0" Option "SHMConfig" "true" Option "TouchpaddOff" "0" # How fast the two-finger scrolling scrolls. The lower, the faster. Option "VertScrollDelta" "25" Option "HorizScrollDelta" "25" # Location of the touchpad edges, somewhat sane values # that I found by testing. Xmin=0, Xmax=1216, Ymin=0,Ymax=387 Option "LeftEdge" "100" Option "RightEdge" "1116" Option "TopEdge" "50" Option "BottomEdge" "337" # Touch and "untouch" thresholds Option "FingerLow" "25" Option "FingerHigh" "50" # We DO NOT want palm triggering middle/right mouse # button events, so a tap has to be quite fast Option "MaxTapTime" "100" Option "MaxTapMove" "100" Option "MaxDoubleTapTime" "200" # Enable vertical (right) edge scrolling with one finger Option "VertEdgeScroll" "1" # Enable horizontal (bottom) edge scrolling with one finger Option "HorizEdgeScroll" "0" # Disable two finger scrolling, as we have the edge scrolling enabled already Option "VertTwoFingerScroll" "0" Option "HorizTwoFingerScroll" "0" # Left top corner of the touchpad shall be the middle mouse button # Bottom buttons tend to get triggered accidentally. Option "LTCornerButton" "2" # Right top corner of the touchpad shall be the right mouse button Option "RTCornerButton" "3" # Disable bottom corners Option "LBCornerButton" "0" Option "RBCornerButton" "0" # Fast taps Option "FastTaps" "0" # Disable tapping of the touchpad (excluding the corners, of course) Option "TapButton1" "0" Option "TapButton2" "0" Option "TapButton3" "0" # Movement speed settings Option "MinSpeed" "0.2" Option "MaxSpeed" "0.6" Option "AccelFactor" "0.35" # Palm detection. Does not seem to work on Macbook Option "PalmDetect" "1" Option "PalmMinWidth" "10" #1-15 Option "PalmMinZ" "200" #1-255 # Various other variables Option "UpDownScrolling" "0" Option "LeftRightScrolling" "0" EndSection
To find out about the synaptics options, see synaptics(5).
It's advisable to run syndaemon after starting X, to prevent accidental taps while you're typing.
- example: syndaemon -i 2 -t -d
If you have problems with the old etch kernel (2.6.18), you can work around this by editing appletouch.c and rebuild the kernel:
1. Open /usr/src/your-linux-source/drivers/usb/input/appletouch.c and replace probably unused PRODUCT ID of older Japanese MacBook model:
#define GEYSER3_JIS_PRODUCT_ID 0x0219
#define GEYSER3_JIS_PRODUCT_ID 0x021A
2. Now rebuild the kernel and reboot.
Now synaptics should work fine with all options for English ?Core2Duo model. (without this work around, it should work without tapping and scrolling). New 2.6.25 kernel in lenny should be fine without this kind of workaround for all ?Core2Duo models.
Infrared Receiver before lenny
Use the usual HID device; kernel patch available as of 2006-07-17.
Sample userland utility implementation http://www.netfort.gr.jp/~dancer/diary/junk2006/20060712-usb-macbook-ir.c
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.
How to get the remote working in 10 steps :
1)I have downloaded this patch http://www.madingley.org/macmini/kernel/ir.patch and copied each piece of it into my kernel sources (most of it goes into appleir.c)
2)After that I have added "CONFIG_USB_APPLEIR=m" at the section "USB HID Boot Protocol drivers" in the .config file from the kernel source.
3)I have recompiled and installed the modules.
4)I have added "appleir" to /etc/modules to have it loaded at boot.
5)Reboot. If after reboot, the command
lsinput 2>&1 | grep "Mac mini"
does not give you any output, add the following line in /etc/modprobe.d/appleir :
install usbhid /sbin/modprobe appletouch; /sbin/modprobe appleir; /sbin/modprobe --ignore-install usbhid $CMDLINE_OPTS
6)I have installed lirc and lirc-x with apt-get
7)I have created /etc/lirc/lircd.conf with some infos found on the web :
# this config file was automatically generated # using lirc-0.8.0(userspace) on Fri Oct 20 01:12:42 2006 # # contributed by Michael Olson # # brand: APPLE_REMOTE # model no. of remote control: # devices being controlled by this remote: 1 # begin remote name APPLE_REMOTE bits 8 eps 30 aeps 100 one 0 0 zero 0 0 gap 135863 pre_data_bits 24 pre_data 0x800100 toggle_bit 0 begin codes KEY_MENU 0x8B KEY_PP 0xA4 KEY_N 0xA3 KEY_P 0xA5 KEY_VU 0x73 KEY_VD 0x72 end codes end remote
8)I have changed the following lines in /etc/lirc/hardware.conf :
# Run "lircd --driver=help" for a list of supported drivers. DRIVER="dev/input" # If DEVICE is set to /dev/lirc and devfs is in use /dev/lirc/0 will # be # automatically used instead DEVICE="/dev/input/event1" MODULES="" # Default configuration files for your hardware if any LIRCD_CONF="/etc/lirc/lircd.conf"
The tricky part is that /dev/input/event1 is not correct, so we have to generate the correct input event at each reboot. I have installed "lsinput" and modified the startup script /etc/init.d/lirc, by adding the following lines just before ". /etc/lirc/hardware.conf" :
mac_input=$(lsinput 2>&1 | grep -B 5 "Mac mini" | head -n 1) sed -i "s;DEVICE=\".*\";DEVICE=\"$mac_input\";" /etc/lirc/hardware.conf
Now everything should be fine.
9)To test if it works, write into ~/.lircrc :
begin flags = startup_mode mode = irexec end begin irexec begin prog = irexec remote = APPLE_REMOTE button = KEY_N config = xmms repeat = 0 end end irexec
and start irexec with "irexec -d".
Now if you press the "next" key on the remote it should open xmms (if you have it installed).
10) I have attached to this page my .lircrc file (see the attachments); Don't forget to start the irxevent and irexec with 'irxevent -d & irexec -d'. Feel free to copy and modify it as you wish. The config file uses 2 other scripts (also attached to this page), named show.sh and show_volume.sh; The scripts are displaying information on the screen as you play with your remote; you will also need to install xosd.
CPU Core Temperature Sensor (manual methods)
- - cpu temperature found through CPU MSR feature
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, or put msr in /etc/modules to make the module load on every boot.
Download Makefile and coretemp.c.
$ make $ sudo ./coretemp CPU 0: 69 C CPU 1: 69 C
- - hddtemp package provides support for hdd temperature monitoring
$ sudo hddtemp /dev/sda /dev/sda: ST98823AS: 38°C
- - I2C sensor is detected but not sure if it's functional
Note: no sensors are detected below, just EEPROMs.
MacBook contains the 82801G (ICH7 Family) and ICH7 is supported by lm_sensors since sensors 2.9.0 by the 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