This document describes how to install Debian GNU/Linux 3.1 (sarge) on an IBM Thinkpad T43p. Since I don't have time to write everything in one session, nor am I finished twiddling around with the setup of the notebook, this is work in progress.
History:

| Component | Status | Comments |
|---|---|---|
| Intel Pentium M 770 with 2.1GHz (Sonoma Chipset, 533MHz Frontside Bus) | works | including frequency scaling and powersaving |
| 1024MB DDR2 SDRAM | works | |
| Hitachi Travelstar 7K60 60GB harddisk (7200RPM, 8MB Cache) | works | speed is very good. Powersaving and suspend-to-RAM issues can be fixed by applying a couple of patches, see the Harddisk page for details. |
| IBM Active Protection System | works | using the hdaps kernel module as found in kernel 2.6.14 and the corresponding hdaps tools (Debian package hdaps-utils) it's possible to watch the tilting and shaking of the notebook in 3D. Neat, but not useful as of now, since there's no possibility to park the head automatically in case of dropping the Thinkpad or similar. |
| CD-RW/DVD-RW Multi-Burner | works | after enabling the SATA-ATAPI stuff in includes/linux/libata.h, see the Multi-Burner configuration page |
| 128MB ATI FireGL V3200 graphics | works | powersaving is not working yet, the opensource driver works very good apart from 3D performance, using ATI's binary-only driver for 3D and TV-Out |
| 14.1" SXGA+ LCD display (1400x1050px) | works | |
| Intel PRO/Wireless 2915ABG Mini-PCI Adapter | works | using the driver from http://ipw2200.sf.net |
| Broadcom BCM5751M Gigabit-LAN | works | using the tg3 kernel module; beware: it's not included in the standard Debian kernels |
| Bluetooth | works | using the hci_usb kernel module |
| Infrared | works | using the nsc_ircc kernel module, a patch is needed for correct hardware detection, see the Infrared page for details |
| 56k Modem | works | using the Conexant HSF softmodem driver from http://www.linuxant.com/ |
| 2x USB2 | works | using the uhci_hcd and ehci_hcd kernel modules |
| PCMCIA Cardbus Slot | works | using the yenta_socket kernel module |
| Parallel Port | unknown | not tried yet |
| Fingerprint Reader | works | using the bioapi software found at http://www.qrivy.net/~michael/blua/, see the Fingerprint Reader page for details |
0000:00:00.0 Host bridge: Intel Corporation Mobile 915GM/PM/GMS/910GML Express Processor to DRAM Controller (rev 03)
0000:00:01.0 PCI bridge: Intel Corporation Mobile 915GM/PM Express PCI Express Root Port (rev 03)
0000:00:1c.0 PCI bridge: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) PCI Express Port 1 (rev 03)
0000:00:1c.2 PCI bridge: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) PCI Express Port 3 (rev 03)
0000:00:1d.0 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #1 (rev 03)
0000:00:1d.1 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #2 (rev 03)
0000:00:1d.2 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #3 (rev 03)
0000:00:1d.3 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #4 (rev 03)
0000:00:1d.7 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB2 EHCI Controller (rev 03)
0000:00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev d3)
0000:00:1e.2 Multimedia audio controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Audio Controller (rev 03)
0000:00:1e.3 Modem: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Modem Controller (rev 03)
0000:00:1f.0 ISA bridge: Intel Corporation 82801FBM (ICH6M) LPC Interface Bridge (rev 03)
0000:00:1f.2 IDE interface: Intel Corporation 82801FBM (ICH6M) SATA Controller (rev 03)
0000:00:1f.3 SMBus: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) SMBus Controller (rev 03)
0000:01:00.0 VGA compatible controller: ATI Technologies Inc M24 1T [FireGL M24 GL] (rev 80)
0000:02:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5751M Gigabit Ethernet PCI Express (rev 11)
0000:04:00.0 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev 8d)
0000:04:02.0 Network controller: Intel Corporation PRO/Wireless 2915ABG MiniPCI Adapter (rev 05)
This is a list of things I haven't got working yet or that I'm not happy about. Anyone having ideas how to solve these problems is welcome to send me feedback or add a comment
The notebook came pre-installed with Windows XP Professional. After finishing the Windows installation, I decided to create the recovery media first, because IBM doesn't put them in the box anymore. Better safe than sorry. Using the software in the "Access IBM" folder and two blank DVD-RWs that was quickly done.
Then I booted grml, my favorite Linux Live-CD, and used ntfsresize and cfdisk to resize the NTFS partition (/dev/sda1) to 15GB, but left alone the recovery partition (partition type in cfdisk is "Compaq diagnostics").
After that I booted the Debian Sarge DVD and tried the installation using version 2.6 of the linux kernel by typing "linux26" at the boot prompt. Unfortunately that didn't work, because the harddisk is connected to a SATA controller and the installation kernel didn't recognize it. So I restarted the installation, using the standard kernel instead. This time around the harddisk was recognized, although via the old IDE-sata interface of the kernel, so the disk was called /dev/hda. But at least I could start the installation.
I used the Debian installer to partition the harddisk, creating a swap partition (/dev/hda5) and the root partition (/dev/hda6), 1GB each. For the rest (~36GB) I used LVM and created logical volumes for /home (10GB), /tmp (1GB), /usr (2GB) and /var (1GB).
Then I did a minimal installation, and rebooted into the fresh system using the installed kernel (version 2.4). Everything was working so far, but I decided to compile a new kernel from the 2.6 series to use the harddisk via the new SATA interface.
First I installed the necessary packages to build the kernel from source with
apt-get install gcc make ncurses-dev
Then I downloaded the source code from the Linux Kernel Archives.
After extracting the compressed tar archive and studying the ThinkWiki a bit, I also applied some patches:
make menuconfigin the kernel source tree. Important settings to change are:
makeand after switching to the root account I installed the kernel modules, the System.map file and the kernel image with
make modules_installThen I added a new entry in the GRUB menu file in /boot/grub/menu.lst:
cp System.map /boot/System.map-2.6.12.3
cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.12.3
title Debian GNU/Linux, kernel 2.6.12.3
root (hd0,5)
kernel /boot/vmlinuz-2.6.12.3 root=/dev/sda6 ro video=vesafb,nomtrr,ywrap vga=836 acpi_sleep=s3_bios resume2=swap:/dev/sda5 processor.max_cstate=2 elevator=cfq
Note: not all of the kernel parameters are necessary, video and vga give a higher resolution in the text consoles (if the vesa framebuffer driver is compiled into the kernel), resume2 is for Software Resume 2, elevator=cfq selects a different scheduling mechanism more suitable for desktop use, acpi_sleep is needed to circumvent a problem with suspend-to-ram.
Since switching to SCSI-SATA also meant that the harddisk would be called /dev/sda after the reboot, I also changed all occurences of "/dev/hda" to "/dev/sda" in /etc/fstab.
Oneinit 6
later and I was running the shiny new kernel.
The next pages describe how to configure the various hardware components so they work Debian Linux.
The drive itself works fine in any case, but when it's used as normal EIDE-device there's no DMA support because it's connected to the SATA-controller. Hence it's necessary to use it as SATA-device to get the full speed and low CPU utilization needed, for instance to play DVDs without annoying stuttering.
Current vanilla kernels from http://www.kernel.org have the code for ATAPI support via SATA already included, but it's not enabled by default. After reading some comments about various Linux distributors already enabling the functionality in their custom kernels, I figured it's worth giving it a try.
In the kernel source tree in includes/linux/libata.h you have to change
#undef ATA_ENABLE_ATAPI /* define to enable ATAPI support */
#undef ATA_ENABLE_PATA /* define to enable PATA support in some
* low-level drivers */
#undef ATAPI_ENABLE_DMADIR /* enables ATAPI DMADIR bridge support */
at around line 40 to
#define ATA_ENABLE_ATAPI /* define to enable ATAPI support */
#define ATA_ENABLE_PATA /* define to enable PATA support in some
* low-level drivers */
#define ATAPI_ENABLE_DMADIR /* enables ATAPI DMADIR bridge support */
Just add "libata.atapi_enabled=1" to the kernel command line in the GRUB configuration.
Using the Debian kernel package (currently linux-image-2.6.16-1-686 in sid/unstable), just make sure that the initrd is created in a way that the libata module is loaded with the atapi_enabled=1 option set. Depending on the programm you're using to create the initrd, it's necessary to configure the following files:
Put the line
libata atapi_enabled=1
into /etc/mkinitrd/modules
Put the above line into /etc/mkinitramfs/modules
Make sure the option is configured in the /etc/modprobe.d/ directory, e.g. put the line
options libata atapi_enabled=1
into a file /etc/modprobe.d/cdrom
Either way, you have to re-create the initrd afterwards, either manually (see the manual pages for mkinitrd, mkinitramfs and yaird, respectively) or by running dpkg-reconfigure linux-image-2.6.16-1-686
If patching is necessary you have to recompile and install the kernel as described on the kernel configuration page. After rebooting into the new kernel, the optical drive should then be accessible via /dev/scd0 (or /dev/sr0) for reading and /dev/sg1 for writing.
If your system still uses /dev/hdc (i.e. the drive is not found in /proc/scsi/scsi) it's maybe because the IDE-detection routines at startup find the multi-burner before the libata subsystem tries to access it. You can disable the IDE-detection by passing "ide1=noprobe" as kernel parameter in your GRUB configuration.
After a week of testing there haven't been any problems so far, so it seems to work fine. Playing DVDs now works perfectly, and writing to optical media works as well. But of course, you can also wait until the kernel developers think the feature is stable enough to enable it by default in the kernel.
Since I use various kernels at the moment, some with the SATA-ATAPI features enabled and some without, I put the following lines into an init script to fix the /dev/cdrom and /dev/dvd symlinks depending on kernel configuration:
# fix dvd and cdrom links
rm -f /dev/cdrom /dev/dvd
if grep -q MATSHITA /proc/scsi/scsi
then
# running libata enabled kernel
ln -s /dev/sr0 /dev/cdrom
ln -s /dev/sr0 /dev/dvd
else
# running kernel with only IDE support
ln -s /dev/hdc /dev/cdrom
ln -s /dev/hdc /dev/dvd
fi
Finally found time to fiddle around with the fingerprint reader, and getting it to work was easier than I thought. The HowTo in the ThinkWiki was very helpful, as usual.
There are 4 components to make the whole thing work:
Just installe the downloaded .deb file with
dpkg -i dpkg -i bioapi_1.2.3_i386.deb
Ignore the warning about not finding /usr/lib/libqtpwbsp.so, it's not fatal.
The software comes in a zip file, so
apt-get install unzip
if you haven't got it installed already. Then create a new directory and change into it, then unpack and install the driver:
mkdir fingerprint-driver
cd fingerprint-driver
unzip -q /path/to/the/downloaded/UPEK_BSP_file.zip
sh install.sh
It's necessary to use a patch from http://badcode.de/downloads/fingerprint.patch to make the pam module work, I also attached the fingerprint.patch file below in case it vanishes from the current URL.
Otherwise the installation is straightforward with the usual 3 steps ./configure, make and make install: (make sure you have libpam-dev or specifically libpam0g-dev installed)
tar -xjf /path/to/the/downloaded/pam_bioapi-0.2.1.tar.bz2
cd pam_bioapi-0.2.1/
patch -p0 < /path/to/the/downloaded/fingerprint.patch
./configure
make
make install
Since the BioAPI framework could work with various biometric devices each and every one of them has a unique serial number (a long hexadecimal number) called Module ID. The process of gathering sample fingerprints and the PAM configuration both need the Module ID of your fingerprint reader. You can print the ID in the needed format with the following rather ugly command:
BioAPITest | sed -ne "/Fingerprint/{n;n;s/^.*: \(.\{9\}\)\(.\{4\}\)\(.\{4\}\)\(.\{4\}\)\(.*\)/\1-\2-\3-\4-\5/gp}"The result, in my case {5550454b-2054-464d-2f45-535320425350} (check if your ID differs and change accordingly in the following steps), is needed in several places. First create a directory in /etc/bioapi1.10/pam with that name, e.g. with
mkdir -p /etc/bioapi1.10/pam/{5550454b-2054-464d-2f45-535320425350}Into that directory the files containing the sample fingerprints (one file per user, with .bir as extension) need to be copied. Creating these files is done using the Sample program that comes with the UPEK software (in the NonGUI_Sample subdirectory), which needs to be made executable first. Then run it (from the current directory with ./Sample), choose "enroll" and enter a valid username. You'll then be prompted to collect 3 fingerprints. Once you're done, choose "quit" and look into the current directory. It should contain a .bir-file for the username you just entered. Copy that file into the directory created in the last step. E.g. for the user spiney:
cd /path/to/fingerprint-driver/NonGUI_SampleRepeat for each user you want to use the fingerprint reader with.
chmod a+x Sample
./Sample
cp spiney.bir /etc/bioapi1.10/pam/{5550454b-2054-464d-2f45-535320425350}
The next and final step is to configure services to use the pam_bioapi module as authentication source. For each PAM-aware service there's a configuration file in /etc/pam.d/ plus the fallback configuration file called common-auth which you could use to enable the reader system-wide. I just enabled it for gdm (the Gnome Display Manager, i.e. the graphical login) and login (for the text consoles) by adding the following line before the line with @include common-auth:
auth sufficient /usr/local/lib/security/pam_bioapi.so {5550454b-2054-464d-2f45-535320425350} /etc/bioapi1.10/pam/Note: by using the complete path to the pam_bioapi.so module it's not necessary to copy it to /lib/security.
After that logging in using the fingerprint reader should work for configured services. If not, check /var/log/auth.log for any pam-related error messages.
For PAM-aware applications like xscreensaver which are run as normal user without root privileges it's necessary to change the permissions on two files so that files can be read and written:
echo /proc/bus/usb/`lsusb | sed -ne "/0483:2016/s/Bus\ \(.*\)\ Device\ \(.*\):\ .*/\1\/\2/p"`
Either set to permissions on both to world read/writeable (pass 666 to chmod, probably ok security-wise since notebooks are single user systems in most cases) or assign a special group to them and give it write permission, and then add all users that should be able to use the fingerprint reader to that group. In my case I used the group adm, because my normal user was already member in it (I do like to read log files without changing to root). So I did the following
chgrp adm /var/log/BSP.log
chmod g+rw /var/log/BSP.log
DEVICE=/proc/bus/usb/`lsusb | sed -ne "/0483:2016/s/Bus\ \(.*\)\ Device\ \(.*\):\ .*/\1\/\2/p"`
chgrp adm $DEVICE
chmod g+rw $DEVICE
Since you have to set the permissions on the proc entry every time you boot (or come back from suspend/hibernation), it's best to put the last three lines into some shell script that gets run every time you boot.
Now also non-root users can use the fingerprint reader. The only application at the moment that comes to mind and is PAM-capable is xscreensaver. It needs a patch from http://nax.hn.org/pub/bioapi/xscreensaver-4.22_alternativeAuth.diff by Josef Hajas so that you are first asked to swipe your finger and it falls only back to password authentication when that fails. You can either get the source code from the xscreensaver website, but if you run Debian sid you can also download my patched xscreensaver package (built from the current source from Debian via apt-get source) which is attached below. I'll try to keep them updated whenever there's a new version in Debian until the patch makes it into the xscreensaver source code upstream. But I disclaim all warranties regarding that package, so beware!
Now just change /etc/pam.d/xscreensaver to
#
# /etc/pam.d/xscreensaver - PAM behavior for xscreensaver
#
auth sufficient /usr/local/lib/security/pam_bioapi.so {5550454b-2054-464d-2f45-535320425350} /etc/bioapi1.10/pam/
@include common-auth
and add the following option
alternativeAuth: True
to your ~/.xscreensaver configuration file, restart xscreensaver and you're set. Lock the screen, press a key and there should be the window telling you to swipe your finger over the reader.
Again, if it doesn't work, take a look into /var/log/auth.log and check those file permissions.
Since the original patch was sometimes confusing to the user (see Brice Goglin's comment below) I tried to come up with a different approach: use a different PAM configuration for xscreensaver when using the alternativeAuth option.
Below is the patch (xscreensaver-4.23_fingerprint.patch) and also an updated version of the package for Debian sid (xscreensaver_4.23-3fingerprint_i386.deb). To use it, follow the instructions above, but instead of modifying /etc/pam.d/xscreensaver (if you did already, remove the bioapi line again), create a new file /etc/pam.d/xscreensaver-alternative with the following content:
#
# /etc/pam.d/xscreensaver-alternative - PAM behavior for xscreensaver
# when running with alternativeAuth
#
auth sufficient /usr/local/lib/security/pam_bioapi.so {5550454b-2054-464d-2f45-535320425350} /etc/bioapi1.10/pam/
Again, I disclaim all warranties regarding the patch and the package, so beware!
The next pages provide information about how to configure the built-in ATI Radeon graphics card.
You can create new configuration files suitable for the fglrx driver with the fglrxconfig tool, alternatively you can also use aticonfig to change configuration parameters. Better backup /etc/X11/xorg.conf before using either of the two utilities.
Attached at the bottom of the page you can find the xorg.conf files I use for the various multi-monitor modes that the ATI binary driver supports and also TV-out. A few notes:
You can create new configuration files suitable for the radeon driver with the text-based xorgconfig tool or run
X -configure
to let X.org probe your hardware and write a configuration file, alternatively you can also use the graphic application xorgcfg to change configuration parameters. Better backup /etc/X11/xorg.conf before using either of these utilities.
Attached at the bottom of the page you can find the xorg.conf files I use for the various multi-monitor modes that the radeon driver supports. A few notes:
Once you have installed and set up the graphics card with the fglrx and the radeon driver (including multi-monitor setups), it's helpful to make the switch from one setup to another rather easy.
Basically, switching involves exchanging the xorg.conf file and the GL library file. But since the drivers are different in other respects too (suspend/resume, 3D acceleration), it's also convenient to change configuration files
at the same time, for example the xscreensaver configuration file to run different screensavers (radeon: no 3D; fglrx: all the 3D you can find
) or the hibernate.conf file for suspending the ThinkPad.
The attached radeonswitch script does exactly that.
You can switch the configuration either at boot time (if you set up GRUB/LILO to do so, see below) or while the system is up and running.
If you only want switch while the system is running, no special installation is needed. If you want to switch at boot time, as root issue
mv /path/to/downloaded/radeonswitch /etc/init.d
chmod 755 /etc/init.d/radeonswitch
update-rc.d radeonswitch defaults 95
to integrate it into the boot sequence of the Debian system.
Put the xorg.conf files for the various configurations you use into /etc/X11, renaming them to xorg.conf.<config>. For <config>, use a word starting with fglrx for the fglrx driver or a word starting with radeon for the radeon driver, e.g. xorg.conf.fglrx.tv is my TV-Out configuration for the fglrx driver. The example configuration files on this site all use this naming convention.
If you want to switch other configuration files, add them to the CONFIGS variable at the beginning of the radeonswitch file (an example can be found as comment inside the script) and provide one version with a .fglrx suffix and one with a .radeon suffix. For example the I created one /home/spiney/.xscreensaver.fglrx file with almost all 3D screensavers active and another /home/spiney/.xscreensaver.radeon with mostly 2D screensavers configured. The file corresponding to the chosen driver will be copied to /home/spiney.xscreensaver when radeonswitch is run.
Usage from the command line
As root issue
/etc/init.d/radeonswitch set <config>
to switch to the corresponding configuration and restart X.
You have to configure your boot loader to switch the driver at system startup. For GRUB this means adding
RADEONDRIVER=<config>
to your kernel configuration line in /boot/grub/menu.lst. For LILO (not tested) it should work with adding
append="RADEONDRIVER=<config>"
to your /etc/lilo.conf line and running
/sbin/lilo
to install the new LILO configuration.
Of course you have to provide multiple menu entries for GRUB or LILO, otherwise you can't really switch.
If you provide menu entries where RADEONDRIVER is not appended, the graphics card setup will be left as it is.
Use this script own your own risk! I give no warranty whatsoever that the script works as intended, so if it accidentally deletes your whole harddisk, you're on your own. But I'm using it myself for quite some time now, so that's unlikely.
Bug reports or feature requests are very welcome, feel free to use the feedback page.
New technologies are fine, but sometimes they just give headaches. The harddisk found in the T43p is one such case. It's connected to a SATA controller via a so called SATA-to-PATA bridge, and the problem is that powermanagement and suspend-to-RAM is not working with stock kernels from kernel.org, at least not with the currently latest version 2.6.14.
But, after reading and re-reading the page about the topic in the ThinkWiki, playing around with different combinations of patches and following bits of the discussion in the LKML and linux-ide archives, at last I got the whole thing working. But of course this is rather unsafe territory and I give no warranty whatsoever that it works for you or that there will be no loss of data, so continue at your own risk.
In the root directory of the kernel source, apply the patches in the following order:
patch -p1 < /path/to/downloaded/suspend-to-ram-from-lkml.patch
patch -p1 < /path/to/downloaded/02_libata_passthru.fixed.patch
patch -p1 < /path/to/downloaded/03_libata_passthru_bugfix.patch
If necessary, recompile and install the kernel as shown in the kernel configuration page.
After booting into the new kernel, commands like
hdparm -I /dev/sda
to show information about the drive or
hdparm -y /dev/sda
to spin down the harddisk should work. (the -i option does not, interestingly enough)
Once that works it's time to configure suspend-to-RAM or start using the Laptop Mode Tools.
The nsc-ircc kernel module needs a patch to work, which you can download at http://shamrock.dyndns.org/~ln/linux/.
To apply the patch go to the root directory of the kernel source code and issue
patch -p1 < /path/to/downloaded/nsc-ircc-pnp.2.6.12.diff
After that you have to recompile and install the kernel as described on the kernel configuration page.
To use the infrared transmitter (it's located at the front, which is a rather unpractical placement IMO) it's necessary to install the irda-utils with
apt-get install irda-utilsThe configuration of the irda-utils Debian package takes place in /etc/default/irda-utils and get filled in via questions asked by debconf at installation time. I use the following settings:
ENABLE="true"
DISCOVERY="true"
DEVICE="irda0"
DONGLE="none"
SETSERIAL=""
As stated in /usr/share/doc/irda-utils/README.Debian to use Fast-Infrared (FIR) it's necessary to disable the Serial-Infrared (SIR) part of the system, so I disabled loading the SIR kernel modules by adding them to /etc/hotplug/blacklist:
# ignore serial irda drivers
irtty_sir
sir_dev
irda
After that it's necessary to tell the system which kernel module to load for the irda0 device, that is done by putting the following lines into /etc/modprobe.d/irda-utils:
alias irda0 nsc-ircc
options nsc-ircc dongle_id=0x09 io=0x2f8 irq=3
install nsc-ircc /bin/setserial /dev/ttyS1 uart none port 0 irq 0; /sbin/modprobe --ignore-install nsc-ircc
Stop the irda-utils with
/etc/init.d/irda-utils stop
and then make sure the SIR modules are not loaded anymore (use lsmod and if they're still loaded use rmmod to remove them). Then start the irda-utils again with
/etc/init.d/irda-utils start
The nsc-ircc module should get loaded automatically and the irattach program should be setting up the infrared device irda0. Check /var/log/syslog, it should look similar to this:
Sep 17 14:43:10 t43p kernel: pnp: Device 00:0a activated.
Sep 17 14:43:10 t43p kernel: nsc-ircc, Found chip at base=0x000
Sep 17 14:43:10 t43p kernel: nsc-ircc, driver loaded (Dag Brattli)
Sep 17 14:43:10 t43p kernel: IrDA: Registered device irda0
Sep 17 14:43:10 t43p kernel: nsc-ircc, Using dongle: IBM31T1100 or Temic TFDS6000/TFDS6500
Sep 17 14:43:10 t43p irattach: executing: 'echo t43p > /proc/sys/net/irda/devname'
Sep 17 14:43:10 t43p irattach: executing: 'echo 1 > /proc/sys/net/irda/discovery'
Sep 17 14:43:10 t43p irattach: Starting device irda0
After that it's possible for example to use infrared communication to sync a Palm PDA or to access a mobile phone via gnokii or gammu. See the Linux Infrared Howto for more information.
I actually don't like the irda-utils to be started automatically at boot time since I very seldomly use infrared communcations, so I removed the symbolic link /etc/rc2.d/S20irda-utils (because I use runlevel 2 as my default runlevel, which is the standard configuration in Debian, use the appropriate rcX.d directory for your runlevel). Instead I'm using the following script (I called it toggle_irda) to toggle the irda-port on and off:
#!/bin/sh
PIDFILE="/var/run/irattach.pid"
if [ -f $PIDFILE ]
then
/etc/init.d/irda-utils stop > /dev/null
else
/etc/init.d/irda-utils start > /dev/null
fi
It checks whether the irda-utils are currently running and either starts or stops them. The scripts gets started when pressing Fn+F8, see the Special Keys page for details.
Three software packages are needed:
You can install acpid and tpb with
apt-get install acpid tpb
The ibm-acpi kernel module is part of the standard Linux kernel since version 2.6.10, but it's not the most recent version. To replace it with the newest version (at the time of writing 0.11, the upcoming kernel 2.6.14 will include 0.12a), it must be compiled as a module (CONFIG_ACPI_IBM=m; if you're using my kernel configuration file you're fine, otherwise search for "IBM Thinkpad Laptop Extras" in the kernel configuration). Download the compressed archive and then issue
tar -xzf ibm-acpi-0.11.tar.gz
cd ibm-acpi-0.11
make
make install
to install the new module. After that either reboot (the new module should get loaded automatically by the hotplug subsystem) or try
rmmod ibm_acpi
modprobe ibm_acpi
Make sure you're running the correct version, either by search the kernel message buffer with
dmesg | grep ibm_acpi
or by checking in the proc filesystem with
cat /proc/acpi/ibm/driverTo enable the hotkeys you have to echo some values into the proc filesystem:
echo enable > /proc/acpi/ibm/hotkey
echo 0xffef > /proc/acpi/ibm/hotkey
The first line basically enables the hotkey feature, the second selects all available key combinations apart from Fn+F5 (which toggles the bluetooth adapter on and off) to send ACPI events. See the ibm-acpi README file for details, also for the various other interesting files in that directory.
Since you probably don't want to do that everytime after the modules gets loaded, it's probably a good idea to put these module parameters into the /etc/modprobe.d/ directory, in my case I wrote a file called /etc/modprobe.d/ibm-acpi containing
options ibm_acpi experimental=1 hotkey=enable,0xffef
The next step is to configure acpid for the ACPI events sent by pressing the special keys and tell it what command to run. The name of the events all start with "ibm/", hence I wrote a file called /etc/acpi/events/ibm-acpi with the following content:
event=ibm/
action=/etc/acpi/actions/ibm.sh "%e"
The action line calls a script and passes the event name as first and only argument. The /etc/acpi/actions/ibm-acpi.sh is a simple shell script and looks like this:
#!/bin/bash
case "$1" in
# Fn+F12
"ibm/hotkey HKEY 00000080 0000100c")
/usr/sbin/hibernate
;;
# Fn+F4
"ibm/hotkey HKEY 00000080 00001004")
/usr/sbin/hibernate -F /etc/hibernate/hibernate.conf.ram
;;
# Fn+F6
"ibm/hotkey HKEY 00000080 00001006")
/root/bin/toggle_wlan
;;
# Fn+F8
"ibm/hotkey HKEY 00000080 00001008")
/root/bin/toggle_irda
;;
# Fn+F3
"ibm/hotkey HKEY 00000080 00001003")
/root/bin/toggle_backlight
;;
# log everything else to syslog
*)
/usr/bin/logger -i -t "IBM Special Button" $1
;;
esac
For a couple of events commands are run, the rest get logged to the syslog daemon. All Thinkpad's ACPI event names and their corresponding keys are listed on the above mentioned ThinkWiki page. The toggle_wlan and toggle_backlight scripts are attached in their current version if someone's interested, they'll be explained in more detail once I write the pages for the network and graphics card sections. The toggle_irda script is explained on the Infrared page. The hibernate script is part of Software Suspend 2.
Be sure to notify acpid about changes in files in /etc/acpi by issuing
/etc/init.d/acpid reload
The last part is to configure tpb. This is easy, because the most important functions work right away, namely the volume-up/down and mute buttons, the thinklight and the brightness control. The latter two work even without tpb, probably it's hardwired in the hardware, but tpb adds a nice on screen display.
The configuration file is /etc/tpbrc. Two things I changed from the defaults:
I copied the example script from /usr/share/doc/tpb/callback_example.sh to that location and started editing. First I substituted all occurences of "echo" with "/usr/bin/logger -i -t tpb" to log all actions to the syslog daemon. The only action that I really defined is the one for the zoom-event (when pressing Fn and the space bar), because I wanted to use xzoom (apt-get install xzoom if you haven't guessed it by now) to get a zooming feature for X. That part of the callback script looks now like this:
(zoom)
case $2 in
(on)
/usr/bin/X11/xzoom
;;
(off)
killall xzoom
;;
esac
;;
BTW, since tpb is run from the startup files of the X Window System, all commands run by the user running X, whereas the commands run from acpid are run with root privileges.
apt-get install hibernate vbetool
Attached is the hibernate.conf that I use for suspending to RAM, just a few notes: (see the hibernate.conf manual page for all the other settings)
You can use the configuration file by issuing
hibernate -F /path/to/hibernate.conf.ram
see the Special Keys page for how to map Fn+F4 to that command.
More information can be found in the "How to make ACPI work" ThinkWiki page.