IBM Thinkpad T21 with Debian GNU/Linux 4.0 (Etch)

Updated 30 August 2007 with more notes on ACPI and the snd-cs46xx suspend/resume bug.

Updated 07 August 2007 with more information about ACPI and APM, and Audio (the CS46xx bug). I am also going to add this page to the relevant list at Thinkwiki.org.

Updated 13 July 2007 to reflect a more accurate IrDA configuration.

This will guide you 100% through settings up Debian GNU/Linux Etch on a Thinkpad T21. Everything will apply if you have this setup. Also, most things should apply if your computer is an IBM Thinkpad T20, T22, T23, or other models of Thinkpad. Also, users of Ubuntu, Knoppix, and other Debian-based Linux distributions may find this guide useful.

  1. Installation
  2. ACPI vs. APM
  3. X.org
    1. Scrolling with the Trackpoint
    2. Accerlated Graphics (OpenGL)
    3. Kill the Touchpad
    4. Multiple Desktops
  4. Audio
  5. IrDa
  6. Ethernet
  7. Playing DVDs
  8. Hotswapping Ultrabay 2000 Devices
  9. Kernel Boot Parameters

Installation

Instllation is easy via Netboot floppy, Netboot CD-ROM, full CD-ROM, or even DVD. Use what you feel comfortable with.

The Debian Installer will be able to auto-detect and configure 90% of this machine for effective use. We will only need to make minor tweaks, for the most part, to use the machine.

When asked, opt for the linux-image-i686 kernel. It will automatically get the latest version of the 686 kernel for you, which is what you want.

ACPI vs APM

Currently, there are two half-working ways to manage power on an IBM Thinkpad T21. There is APM, the older of the two, and ACPI. Only one may be used at a time. This is annoying, because neither work fully. Here is a quick table of what each one can and cannot do successfully. You can choose which you want, based on what functions are more important to you.

Function APM ACPI
Power Down (*) no yes
Sleep/Suspend (and Resume) yes(**) yes
Monitor Battery Status yes yes
Allow IBM-ACPI no yes

(*) Power Down: With ACPI, the computer will fully power down as expected. However, with APM, the computer will power down until the system is halted, leaving you to push the “power” button to actually turn the machine off.(**) When APM resumes from a Suspend state, the sound will not work. There is yet not fix (that I know of) for this problem with APM.

That said, I personally choose ACPI. If you agree, there are no modifications to make. ACPI is installed by default by the Debian Installer and overrides APM if it is installed as well., all you need to do is add two kernel paramaters. In your Kernel loading line of GRUB or LILO, add “acpi=force ec_intr=0″ to get suspend/resume working correctly. Of course, do make sure that ACPI is installed, aptitude install acpi acpid acpi-support. Note that there are still some weird bugs with ACPI with the older Thinkpad T21’s ACPI implementation. When suspending with Fn+F4, the computer often freezes when resumed. However, using the KDE klaptop utility (run with klaptop_check if you don’t have it up automatically), I find that I can configure the computer to suspend properly when the lid is closed, and resume when it is reopened.

Note that sound with the default system and default kernel will not work after resume. This is due to an issue with the snd-cs46xx kernel module. There is a somewhat ugly workaround/hack that apparently works for Ubuntu, but not on my Debian system.The issue may have been fixed for kernel 2.6.23. Personally, I have set up a simple script with a button on my KDE Kicker with the following lines:

fuser -k /dev/snd/* #kill all processes using soundcard so the module will unload
modprobe -r snd-cs46xx #remove module
modprobe snd-cs46xx #load module. ugly, huh?

If Sleep and Suspend are important to you, and you choose APM, there are few things you will need to do.

To enable [buggy] APM, Install apm, aptitude install apmd, and add “acpi=off” to your kernel argument. Turn on your system and run the apmd program and also modprobe apm.

X.org

X.org manages your video card, monitor, keyboard, and mouse (trackpoint). Debian Installer will make X.org work fine, but there is functionality to add if you want it.

Scrolling with the Trackpoint

In /etc/X11/xorg.conf, configure an Input Device thusly:

Section "InputDevice"
 	Identifier      "Configured Mouse"
 	Driver          "mouse"
 	Option          "CorePointer"
 	Option          "Device"                "/dev/input/mice"
 	Option          "Protocol"              "ExplorerPS/2"
 	Option          "Emulate3Buttons"       "true"
 	Option          "XAxisMapping"          "6 7"
 	Option          "YAxisMapping"          "4 5"
 	Option          "EmulateWheel"          "true"
 	Option          "EmulateWheelButton"    "2"
EndSection

Accellarted Graphics (OpenGL)

In /etc/X11/xorg.conf, configure your “Device” section thusly:

Section "Device"
 	Identifier      "S3 Inc. 86C270-294 Savage/IX-MV"
 	Driver          "savage"
 	BusID           "PCI:1:0:0"
 	Option          "UseFBDev"      "false"
 	Option          "BusType"       "PCI"
 	Option          "DmaMode"       "None"
 EndSection

Kill Touchpad

The T21 does not have a Touchpad, so the following section can be removed:

Section "InputDevice"
        Identifier      "Synaptics Touchpad"
        Driver          "synaptics"
        Option          "SendCoreEvents"        "true"
        Option          "Device"                "/dev/psaux"
        Option          "Protocol"              "auto-dev"
        Option          "HorizScrollDelta"      "0"
EndSection

And, near the end of the file, in the section “SeverLayout,” remove the line

	InputDevice     "Synaptics Touchpad"

Multiple Desktops

The T21 is capable of using multiple monitors: the build in lcd, the CRT video port, and the S-Video (TV) video port. At any time, the root user can use the program s3switch (aptitude install s3switch) to activate or deactivate each device. Do note that if you use the s3switch and do not keep the ‘lcd’ activated, and have no other drive attached, your screen will go blank, leaving you without a monitor. Turning your lcd back on after accidnetally deactiavting it is a nice way to test your geek-hood.

Anyway, so s3switch can dynamcically turn activate external monitors, but they will only duplcate your current screen. This is useful for presentations and such, but is not really the cool dual-monitor set up.

The T21 is capable of using multiple desktops and xinerama to create extra workspaces. This is rather cool, but not particularly easy. First, note that if your /etc/X11/xorg.conf is set up for dual-monitor, and one of the monitors are absent (i.e. your are not at your normal work desk), X will still load the area that the monitor would occupy. This would be problematic if a window started in that area, and you could not see it. Therefore, it will be nice to have two /etc/X11/xorg.conf-type files. One for a normal mode, and one for dual-monitor situation. Let us call them /etc/X11/xorg.conf.normal and /etc/X11/xorg.conf.dual, respectivly.

For /etc/X11/xorg.conf.normal, use the file we set up earlier in this guide.

For /etc/X11/xorg.conf.dual, let’s try some things.

Audio

If ALSA it was not automatically installed and configured, you will need to run aptitude install alsa-base alsa-utils alsa-tools. Once installed, run alsaconf as root. ALSA will set things up for you.

The card used by my Thinkpad T21 is a CS4624 chipset, and uses the snd-cs46xx kernel module (and others). As noted in the ACPI/APM section above, there is currently a bug in this module which prevents it from resuming after the computer has been put to sleep or suspended.

IrDa

A bit tricky, but it will work. First, be sure that IrDa is enabled in your BIOS. If not, or if you are unsure, reboot and press “F1″ to enter your system BIOS. Enter the “Config” section, then “Infrared”. Press enter to enable it. Just use the default settings for it.

Now, back in your system, run aptitude install irda-utils irda-tools kmobiletools gammu wammu (the last three only if you want them). Once installed, deactivate irda-utils: ./etc/init.d/irda-utils stop

You will need to edit the following files to contain only the content listed:

/etc/default/irda-utils
  ENABLE="true"
  DISCOVERY="true"
  DEVICE="irda0"
  DONGLE="none"
  SETSERIAL=""

--
/etc/modprobe.d/irda-utils
  alias char-major-10-187 irnet

--
/etc/modutils/irda-utils
  alias tty-ldisc-11 irtty
  alias char-major-161 ircomm-tty

  alias irda-dongle-0 tekram
  alias irda-dongle-1 esi
  alias irda-dongle-2 actisys
  alias irda-dongle-3 actisys
  alias irda-dongle-4 girbil
  alias irda-dongle-5 litelink
  alias irda-dongle-6 airport
  alias irda-dongle-7 old_belkin
  alias irda-dongle-11 ma600

  options nsc-ircc dongle_id=0x09
  alias irda0 nsc-ircc

Next deactivate the serial settings with the command setserial /dev/ttyS1 uart none port 0×2e irq 3. Reactivate irda with /etc/init.d/irda-utils start.

IrDA should be working now, in full FIR glory. Test it with the command irdadump, which should return results similar to this:

14:07:49.175257 xid:cmd 7e91f321 > ffffffff S=6 s=0 (14)
14:07:49.263263 xid:cmd 7e91f321 > ffffffff S=6 s=1 (14)
14:07:49.351142 xid:cmd 7e91f321 > ffffffff S=6 s=2 (14)
14:07:49.439142 xid:cmd 7e91f321 > ffffffff S=6 s=3 (14)
14:07:49.527150 xid:cmd 7e91f321 > ffffffff S=6 s=4 (14)
14:07:49.615155 xid:cmd 7e91f321 > ffffffff S=6 s=5 (14)
14:07:49.703159 xid:cmd 7e91f321 > ffffffff S=6 s=* $HOSTNAME hint=0400 [ Computer ] (21)

Ethernet

Automatically detected and used by Debian.

DVDs

If your T21 is equipped with a DVD+/-RW or DVD-ROM, then it will be able to boot from and read from DVDs easily. You will not, however be able to play DVD movies. If you would like to, and are aware of any legal implications of such in your area, then you’ll need to add the Debian Multimedia repository. Run (as root) echo “deb http://www.debian-multimedia.org etch main” >> /etc/apt/sources.list. Then aptitude install mplayer libdvdcss2 libdvdread3 libdvdnav4

Hotswapping UltraBay 2000 Devices

If you have multiple drives for your UltraBay 2000, such as a DVD-ROM and a Floppy drive, they can be swapped without turning off the computer. This is known as ‘hotswapping’ the drives. You’ll need the hotswap program(s) aptitude install hotswap.

The easiest way to swap the devices it to run sudo hotswap. If you have a drive in the bay, the program will ask you if you want to remove it. If you do, tell it so. Then remove your drive from the bay when prompted.

If they bay is empty, or has floppy in it, put your drive in at any time, then run hotswap to configure the device.

Note that floppy drives are not IDE devices. They do not need hotswap to eject them. They do, however, need to powered down. To do this, as root do echo “eject” > /proc/acpi/ibm/bay. That will only work if the IBM-ACPI is loaded. Check by lsmod | grep ibm. If not, modprobe ibm-acpi”.

Kernel Boot Parameters

If you selected to use ACPI earlier, none of these are necessary.

If you selected to use APM earlier, you will need to add kernel parameters “noacpi acpi=off apm=on.” Do this by editing /boot/grub/menu.lst. After the line “## ## End Default Options ##,” look for the line similar to

kernel          /boot/vmlinuz-2.6.18-4-686 root=/dev/hda1 ro

and change it to

kernel          /boot/vmlinuz-2.6.18-4-686 root=/dev/hda1 ro noacpi acpi=off apm=on

Make a Reply:

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>