Linux on the Thinkpad T41p and T42p

This page describes my experiences using Linux on two Thinkpads: an IBM Thinkpad T42p (first booted in mid-September, 2005), and an IBM Thinkpad T41p (first booted in February 2007).

This isn't really an instructional howto. The idea is, there are lots of Linux resources but it takes time to dig up the precise things that matter for your particular laptop. I hope that other people can use this page and save themselves some time.

Other Web Resources

Thinkpads running Linux are popular, and there are many web resources around.

Overview

I first booted via a Debian/stable installer CD. I tried for a long time to install Debian/unstable directly but could not get it working. The CD itself did not boot, and when I made a grub CD and then ran the installer CD via that, the installer did not work. The Debian/stable installer is far more reliable and is the way to go.

My partitioning scheme is as follows:

There is a swap partition here in order to support swsusp2 so that the machine can suspend to disk. I normally prefer to use swap files instead of swap partitions, because swap files can be added and removed over time as my needs change--swap partitions require an up-front prediction about how much virtual memory will be needed, and such predictions are almost impossible to get right. Nevertheless, swsusp2 requires an actual partition and so I retroactively added one.

The large allocation for Windows is because Windows games have gotten really large! 5-10 gig installation requirements are common. My first partitioning gave only 15 gigs to Windows and I had real trouble making things fit.

I would prefer if /home was on a separate partition from the rest of the Linux file space, but currently it is not due to historical reasons. (See above not on previous partitioning.) With /home being separate, I would feel free to completely wipe the other partition without losing any critical data. Some people like to split their partitions up more finely grained, e.g. to have read-only /usr, special filesystem settings for /var/spool, /var/log being on its own partition so that log file growth does not stop the machine, etc., but I find it not worth the trouble for a personal machine.

Notice that I went ahead and deleted the 5 gig partition that IBM creates for its rescue tools. To each their own, but I don't expect to ever use them, and 5 gigs is a lot of disk space! I've read that it is a good idea to ask Windows/XP to create "recovery disks", because that 5-gig partition held my only copy of XP, but I haven't gotten around to it.

After the initial install, I switched to Linux 2.6.13 and upgraded to Debian/unstable. I recall that this required some fiddling and several reboots, but there were no major problems.

My kernel config file as of February 14, 2007, using Linux 2.6.19, is:

config-astra-20070214

BIOS

When I first started installing Linux on this machine, I noticed that it would freeze after 5 minutes of inactivity. It turns out that this machine has a lot of support for power management that runs behind the scenes even after you have booted your OS. I went into the BIOS (press F1 on boot) and turned off all the various timers for automatic suspending. I'd rather use the OS-level tools like acpid.

Sound

The kernel support for Intel/SiS/.... AC97 chips (CONFIG_SND_INTEL8x0) works fine. Originally, I had to disable two flags using an ALSA mixer (such as alsamixer): Headphone Jack Sense and Line Jack Sense. Without that, I would not hear any sound! I think that current versions (Linux 2.6.19 anyway) might not need this trick any longer.

Networking

The wired NIC works out of the box using the "e1000" driver for the Intel Pro/1000 (CONFIG_E1000). When you configure your kernel, be aware that it's under the "1000 Mbit" section -- there's a fast NIC built into this machine!

My Thinkpad has an Intel PRO/Wireless 2200BG. Using the support built into Linux 2.6.19, it works except that I see 22% packet loss. I now use the ipw2200 module on SourceForge, plus the ieee80211 generic stack from SourceForge, and I see no problems.

By default, this setup will name your wireless NIC eth1. This seems inaccurate to me, and I fear that various tools may be confused by it. Thus I use ifrename to change the name to wlan0. The following /etc/iftab is all that is required; simply change the mac address to whatever your card's is:

wlan0 mac 00:11:22:33:44:55

The first time you change the file you must run ifrename manually (with no arguments). After that, the system will run it automatically via the hotplug scripts.

Suspend to RAM

Suspend to RAM works but you need to add the following option to your kernel command line:

acpi_sleep=s3_bios

Without this flag, the graphics are not reinitialized correctly after a resume. The system suspends and resumes but the screen stays black.

Do not enable EnableVbetool or VbetoolPost in /etc/hibernate/ram.conf. With these enabled, I found that suspend would almost work but, just after resume, the screen would go blank and the keyboard would stop responding.

Suspend to Disk

Software Suspend 2 works out of the box. I simply patched my kernel with version "2.2.rc6 for 2.6.13" and recompiled. The standard hibernate script in Debian, available in its own package, works great.

ACPI

ACPI works great with I see no reason to muck around with APM these days. Turn on ACPI in your kernel, as well as the one called something like "IBM extras". The IBM Extras setting adds several neat files in /proc/acpi/ibm.

Also, be sure to install the acpid package in order to respond to ACPI events.

I hacked my /etc/acpi/powerbtn.sh to simply call hibernate. I don't *want* it to log people out -- I only have one user on my laptop, and when I press power I want it to immediately go into hibernation.

Additionally, I commented out the commands in sleep.sh involving hwclock. The commands don't do the right thing by default, and anyway, on Debian it should use the scripts in /etc/init.d instead of calling hwclock directly.

X and Accelerated Graphics

I am using the open-source "ati" driver and getting very reasonable performance out of the OpenGL-based games I have tried. From glxgears I get about 1900 fps. The system is extremely stable.

To get this, the kernel has support for AGP and for DRM, and there are a few extra options added to xorg.conf that you can see below. Otherwise everything .

Getting to this happy state require a lot of false starts. To things that did not work for me:

External Monitors and Projectors

I use the XOrg server with the open-source "ati" driver. Everything works excellently except that I have had problems connecting an external monitor after the X server has started. On the advise of another web site (I don't remember which one at this point), I set up my X server to have pre-configured settings for the external monitor instead of trying to auto-detect them. This is important because the auto-detection happens only when the server starts--it does not happen again if you plug a monitor or project in later on. The bottom line is the following section from my xorg.conf:

Section "Device"
        Identifier      "ATI Technologies Inc M10 NT [FireGL Mobility T2]"
        Driver          "ati"
        BusID           "PCI:1:0:0"
        Option          "UseFBDev"              "false"
        Option          "ColorTiling"   "on"
#       Option          "AccelMethod"   "EXA"
        Option          "EnablePageFlip"        "on"
        Option          "AGPMode" "4"
        Option          "MonitorLayout"         "LVDS, CRT"

        # reasonable guesses at monitor limits....
        Option      "CRT2HSync"    "15-92"
        Option      "CRT2VRefresh" "50-85"
        Option      "MergedFB"     "on"
EndSection

Notice also that I have turned on the DynamicClocks option. This is supposed to improve battery life, though I haven't verified it in person.

I'm not perfectly happy with this setup. Ideally, the external monitor would run at 1024x768 and the installed software--particularly presentation software--would be able to deal with it. But I haven't put in the effort to get that working....

Built-in Mice

The Thinkpad has both a touchpad and a pointing stick thingie (between the G, H, and B keys). I have configured my kernel with the standard drivers and have a mediocre setup with the following properties:

I tried the fix on William's page to disabling tap-to-click but it didn't work, and so I still get annoying clicks when my wrists brush across the touchpad. I have no idea why the fix didn't work; it looks like it should....

The Linux source code recommends a separate Synaptic driver for use with X, but I have not used that because it is nicer using the /dev/input/mice mouse consolidator.

UPDATE: As of February 2007, the pointing stick thingie is working. Otherwise, the above list is still accurate. For some reason, the tap-to-click is not reacting as thoroughly to my wrists as it used to; this is a positive change, since I hate tap-to-click anyway.

UPDATE: As of May 2007, everything is working. Tap-to-click is still turned on, but its sensitivity seems to be low enough now not to be too annoying. Obviously this is all a mystery to me.


Lex Spoon