Debian on the IBM Thinkpad X40 Martin Würtele <web@wuertele.net> $Id: x40.sgml,v 1.8 2005/07/02 21:39:04 martin Exp $ - Copyright (c) 2005 Martin Würtele, see . Hardware Overview

CPU: Intel(R) Pentium(R) M processor 1.40GHz Graphic card: Intel Corp. 82852/855GM Integrated Graphics Device Sound chip: Intel Corp. 82801DB/DBL/DBM AC'97 Audio Controller LAN network card: Intel Corp. 82541GI Gigabit Ethernet Controller WIFI network card: Atheros Communications, Inc. AR5212 802.11abg Modem: reported as Intel Corp. 82801DB/DBL/DBM AC'97 Modem but actually a HAMR based Smart Link Soft Modem Cardbus: Ricoh Co Ltd RL5c476 II SD-Card reader: Ricoh Co Ltd: Unknown device 0822 Harddisk: HITACHI_DK13FA-40B, ATA DISK drive IrDA: unknown, maybe SIR TCPA chip Bluetooth Active Protection System Working hardware

CPU with Graphic card with and framebuffer Sound LAN WIFI Modem Cardbus Bluetooth Not (yet) working or untested hardware

IrDA: sir-dev loads but no signals are sent or received, there's however a patch schedueld for 2.6.12 inclusion TCPA chip: ibmasm module loads, however I have not yet performed any tests SD-Card reader: reports itself as Ricoh Co Ltd: Unknown device 0822, haven't found a working driver so far Active Protection System: There are rumors about a driver from IBM but I couldn't find one Installation Partitioning

First I thought of keeping a copy of Windows but as it requires more than 6 GB, which is more than I'm willing to waste, I removed it entierly. As a sideffect the recovery partition no more works once grub is installed so I removed it as well.

For safety I chose a small partition for / if 180 MB, 2x 512 MB for swap (one is used for crypto-swap, one solely for suspend-to-disk), one after / and one at the end of the disk and used the rest as LVM PV .

I currently use LVMs for /usr (2 GB), /var (1 GB), /var/log (100 MB), /var/cache (1 GB), /tmp (500 MB), /var/tmp (150 MB) and /home (12 GB), all with ext3 filesystems. As ext3 will become xfs-style growfs in the 2.6 kernel series soon allocating additional space to LVMs will be even more comfortable. Installing Linux

I installed Debian GNU/Linux using debian-installer netboot-images. Just follow the instructions provided in the installation manual, works flawless including LVM setup. Configuration Network

I use to automaticalle configure wlan and lan, however it does not yet default to lan when it can connect to both. Intel e1000 Gigabit Ethernet Controller

The network card works straight forward inkluding media detection and autocrossing. Atheros Communications, Inc. AR5212 802.11abg NIC

I use the driver from compiled as debian package following the guide at by Martin List-Petersen. GPM

Just make shure there is no repeat_type= line in your /etc/gpm.conf and it will work together with X. device=/dev/psaux type=autops2 XFree86

If you want automatic configuration install which is used for hardware detection in eg. or . Powermanagement CPU frequency scaling

You have to enable CPU scaling in your kernel ( CONFIG_CPU_FREQ, CONFIG_CPU_FREQ_TABLE) and you will need a scaling daemon. I decided to go with in PASSIVE mode as I prefere long battery lasting (Immediately jump to lowest frequency when usage drops below 20%. Raise by "step" Hz if it goes above 80%.). ACPI

If you use a recent kernel version, e.g. , append acpi_sleep=s3_bios as kernel parameter to get your graphic card reset after resume and enable CONFIG_ACPI_IBM to get the Fn-x to work.

XFree sometimes is screwed then resuming so I modified /etc/acpi/actions/suspend.sh to change to vt1 and /etc/acpi/actions/resume.sh to change to vt7 which helps:

suspend.sh #!/bin/sh # lock screen user=`who | grep " :0" | awk '{print $1}'` export XAUTHORITY=/home/$user/.Xauthority export DISPLAY=:0 su $user -c "xscreensaver-command -lock" # change to vt1 chvt 1 # stop daemons /etc/init.d/powernowd stop /etc/init.d/laptop-mode stop /etc/init.d/ifplugd stop /etc/init.d/wwwoffle stop # stop linuxant hsf modem /usr/sbin/hsfstop # unload modules rmmod button rmmod ehci-hcd rmmod ath_pci # sync clock /sbin/hwclock --systohc

resume.sh #!/bin/sh # make shure we are on vt1 chvt 1 # load modules modprobe button modprobe ehci-hcd modprobe ath_pci # start daemons /etc/init.d/ifplugd start /etc/init.d/powernowd start /etc/init.d/laptop-mode start /etc/init.d/wwwoffle start # start linuxant hsf modem /usr/sbin/hsfstop # sync clock /usr/sbin/hwclock --hctosys # change to vt7 chvt 7 Suspend-to-disk

Suspend to disk works with recent kernel, make shure you append resume=/dev/$SWAPPARTITION to your kernel. If you use cryptoswap as I do you need to enable the otherwise unused swap partition prior to suspending and deactivating it after resume. You can do this eg. with /etc/acpi/actions/hibernate.sh:

hibernate.sh #!/bin/sh # activiate suspend swap partition as we use cryptoswap swapon -p 20 /dev/hda4 # call suspend.sh . /etc/acpi/actions/suspend.sh # hibernate echo -n 4 >/proc/acpi/sleep # call resume.sh . /etc/acpi/actions/resume.sh # deactivate suspend swap partition swapoff /dev/hda4 Modem

lspci reports 0000:00:1f.6 Modem: Intel Corp. 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Modem Controller (rev 01) and the documentation of talks about HAMR5600 based AMR/CNR/MDC/ACR modem cards on southbridges like the ICH4.

However trying both modules for sl-modem (snd-intel8x0m or the proprietary slamr one) failed. The only driver I could get to work is the Connexiant HSFmodem Linux driver from . Sound

Sound works out of the box, just tell alsa-config to build the modules for intel8x0.

Loaded modules: snd_virmidi snd_seq_virmidi snd_mpu401_uart snd_seq_midi snd_rawmidi snd_intel8x0 snd_ac97_codec snd_pcm_oss snd_mixer_oss snd_pcm snd_page_alloc snd_seq_oss snd_seq_midi_event snd_seq snd_timer snd_seq_device snd soundcore Misc Thanks

Thanks to Stephan Müller for . Martin List-Petersen for Uli Martens for fixing some typos Document source

This guide was written in SGML and processed by from Copyright

Copyright (c) 2005 by Martin Würtele <web@wuertele.net>, Klaus Ita THIS DOCUMENTATION IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.