Debian GNU/Linux on a Thinkpad T42p

William Stein

Configuration

I purchased a Thinkpad T42p for $2389 through Harvard's educational discount program:

  • Thinkpad T42p 2373
  • 15 inch 1600x1200 flexview display
  • 1.8Ghz "Dothan" Pentium-M 745 processor
  • 1GB RAM internal (leaving one slot free)
  • 128MB ATI Mobility FireGL T2
  • 802.11 a/b/g
  • Two USB 2.0 ports
  • Gigabit ethernet
  • 60GB 7200RPM drive
  • Nine-cell long-life battery

I've owned a 2Ghz Thinkpad T30, a 1.6Ghz T40, and now this T42p. The T42 weighs less than the T30, and in size is somewhere between the T40 and T30. It's thinner than the T30, but wider. The T42p is definitely noticeably larger than the T40, but not much heavier (I think it's just over a half pound heavier).

This page records some of my thoughts and experiences using the T42p with Linux. It is not supposed to be a systematic Debian installation guide.

My T42p is currently running Linux Kernel 2.6.6, which I downloaded from www.kernel.org, and was the only kernel version in which I could get everything working that I need. Here is my configure file.

Other Pages

There are several other pages on installing Linux on the T42p:

Unresolved Problems

If you have any idea how to solve one of these problems, or you do not have the same problem with whatever Linux distribution you are using, please send me an email.

Swapping the Hard Drive

The first thing I did when I got the T42 was physically swap its 60GB 7200RPM drive with the 80GB 4800RPM drive in my old T40. I did this by removing one screw that holds each hard drive in place, flipping the laptops upright, sliding the drives out, swapping the mounting brackets, and reinserting. Note that the mounting brackets look like they are screwed on, but are not; you just pop them on and off. I swapped the drives because I had Debian Linux already installed on the 80GB drive, and I prefer 80GB to 60GB. The output of hdparm says that the 80GB drive is plenty fast
      sh-3.00# /sbin/hdparm -t /dev/hda1
      /dev/hda1:
      Timing buffered disk reads:   92 MB in  3.06 seconds =  30.08 MB/sec

Very Informal Benchmarks

I ran some benchmarks that matter to me with the computer algebra system MAGMA doing the sort of calculations I do in my research. The 1.8Ghz T42p is currently the fastest single processor machine I have at this benchmark, just barely beating any single processor of my Athlon 2800MP cluster. The Athlon 2800MP's are clocked at just over 2.1Ghz, so that's not bad.

Battery

Using the 9-cell battery, with the video brightness set at minimum and "normal usage", gives me about 4 hours battery life (at least when I boot up on battery power, so the processor is at its slowest speed). This is about an hour less than my 1.6Ghz T40 would get with exactly the same battery. I get just over one hour from 10-month-old my old 6-cell battery, which suggests the 6-cell battery is "worn out".

Speedstep

Michael Clark created a patch against kernel 2.6.7 that adds speedstep support for Pentium-M Dothan processors (it also depends on bk-cpufreq.patch. (Michael has also "ported it to 2.6.8-rc3 on top of the 2.6.8-rc3-mm1 cpufreq patch (these are probably the preferred ones to link too):" bk-cpufreq.patch and cpufreq-speedstep-dothan-3.patch.

Before Michael's patch came out, I read some of the code of

/usr/src/linux-2.6.6/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
and rewrote it so that it would work with my processor. After Michael sent his patch (which is only to 2.6.7), I corrected the voltages in my 2.6.6 version of speedstep-centrino.c. My 2.6.6 version only adds support for 1.8GHz Dothan, and nothing else.

For whatever reason cpufreqd doesn't seem to work for me. However, directly echo'ing speeds into /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq and /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq does work for me, and that's enough because it means I have control (I can make a command or icon that speeds up or slows down my computer). For example, to set the computer at maximum:

echo 1800000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo 1800000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo 1800000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
And, to set it at minimum speed:
echo 600000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo 600000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo 600000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
Here are some earlier remarks I had about issues with using speedstep.

So far I have not been able to get speedstep_centrino working at all. If I start the T42p not plugged in, then it runs at 600Mhz, and will not change speed not matter what unless it is rebooted (or hibernated). If I start it up plugged in, then it runs at 1.8Ghz no matter what, even if I subsequently unplug it. This is the error I get when trying to use speedstep-centrino:

  modprobe -v speedstep-centrino
  insmod /lib/modules/2.6.6/kernel/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.ko
  FATAL: Error inserting speedstep_centrino (/lib/modules/2.6.6/kernel/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.ko): No such device
This web page discusses a fix. Here's a verbatim copy of the relevant section of that web page:
With the kernel 2.6.6 provided by Fedora Core 2 the "speedstep-centrino" module exits with error "Found unsupported speedstep CPU". I downloaded the last kernel from Fedora and too downloaded the last sources (2.6.7) from kernel.org but I had same results. Next I email to people that contribute to do this module, but they didn't give me any immediatly solution. The problem was that without this module is impossible to throttle the CPU frequency, an important feature on a mobile system.

A month later, googling, I found a message in a forum about a person that had the same problem and that had correct it changing from the file speedstep-centrino.c of the linux kernel the ".x86mask" assigned for Dothan CPU. In this file the mask assigned is 1, but according to the information of /proc/cpuinfo the mask would be 6. This is my CPU info:

processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 13
model name : Intel(R) Pentium(R) M processor 1.70GHz
stepping : 6
cpu MHz : 1698.751
cache size : 64 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 2
wp : yes
flags : fpu vme de pse tsc msr mce cx8 sep mtrr pge mca cmov pat clflush
dts acpi mmx fxsr sse sse2 ss tm pbe tm2 est bogomips : 3375.10

Using 2.6.7 kernel sources I modified the "speedstep-centrino.c". This is the original code:

static const struct cpu_id cpu_id_dothan_a1 = {
.x86_vendor = X86_VENDOR_INTEL,
.x86 = 6,
.x86_model = 13,
.x86_mask = 1,
};

And the modified code:

static const struct cpu_id cpu_id_dothan_a1 = {
.x86_vendor = X86_VENDOR_INTEL,
.x86 = 6,
.x86_model = 13,
.x86_mask = 6,
};

Then I recompiled the linux kernel and the "speedstep-centrino" recognized my CPU and permits to throttle it's frequency, and therefore saves up battery and reduce temperature.

Video

I had a huge amount of trouble getting the fglrx modules working! This seems to work for me:
  1. Download this RPM directly from ATI for XFree 4.3.0.
  2. Use alien to make this deb package.
  3. Install the deb.
  4. Build the tainted kernel modules:
     cd /lib/modules/fglrx/build_mod
     source make.sh
     cd ..
     source make_install.sh
    
    This works perfectly for me with kernel 2.6.x...
  5. But here's where it was really complicated for me personally. I had install the xfree86 dri trunk, which makes copies of all the modules and puts them in /usr/X11R6/lib/modules-dri-trunk/... instead of /usr/X11R6/lib/modules, which is where the the ATI package puts them. Also, for some reason I had fglrx modules in my dri-trunk version, but those were too old and didn't support my laptop's very new display. Not knowing all this, I kept getting tons of errors when trying to start X (no device found). So I moved modules-dri-trunk to modules-dri-trunk.orig and made a symlink from modules to modules-dri-trunk. Really I should track down the config file that points to modules-dri-trunk
  6. Run fglrxconfig to get an XF86Config file.
  7. It works wonderfully. I have very very very fast 3d graphics, etc.
  8. However, swsusp or changing to a text console freeze the computer when 3d acceleration is enable. I commented out the following lines in XF86Config-4 and swsusp works again, but of course I have no 3d graphics. Until this is resolved, if I need 3d graphics, I'll restart X with these extensions enabled.
    #    Load        "dbe"  	# Double buffer extension
    #    Load        "glx"   # libglx.a
    
    (Note: I don't know if turning off dbe was necessary.)
**BIG WARNING**: The free open source radeon driver "works" with this laptop. However, while using it I had literally dozens of "random" complete freezes of my laptop. It cost me many hours to determine the source of the freezes, since there were almost no clues.

Power Management

I am using APM instead of ACPI. I would like to use ACPI since APM is quickly becoming legacy, but I've had serious issues I couldn't resolve with swsusp2 and ACPI. For example, removing the usb_uhci module during swsusp2 suspend crashes the system. Etc. Pressing Fn-F4, which is for apm suspend, causes the laptop to sort of suspend. However, the moon light blinks and the laptop sort of just sits there. I wish there were a way to disable suspend on Fn-F4, since I might accidently hit it. Pressing Fn-F3 to blank the screen works perfectly (as long as I don't accidently bump Fn-F4).

Linux Suspend to Disk (Hibernate): swsusp2

I have APM and swsusp2 working well, and am able to suspend and resume even under X11 while using the ATI drivers (but only with 3d acceleration support off, by removing the glx option from XF86Config). I have 1GB RAM and a smallish 1GB swap partition, so I'm happy this actually works, but it does work, and well.
  1. Installed plain vanilla kernel 2.6.6, so I could patch it, since the swsusp2 patch didn't work for me with Debian kernel 2.6.6.
  2. I installed swsusp2 for kernel 2.6.6
  3. I had to remove the CONFIG_REGPARM from kernel config file, so my .config now says
               # CONFIG_REGPARM is not set
    
    If I didn't do this, then I got errors about stuff not matching on resume from hibernate. I also had this problem:
    5.16 I've suspended and resumed and now I can't open new X
    applications and my /tmp directory is empty (on Debian)
           
    A recent version of the initscripts package decided to blow
    away temporary directories when calling mountnfs.sh (See Bug
    #227112). The simple solution is to remove mountnfs.sh from your
    SWSUSP_STOP_SERVICES_BEFORE_SUSPEND in /etc/suspend.conf and add your
    extra NFS mounts into SWSUSP_UMOUNTS.
    

Getting Software to suspend to work with kernel 2.6.7

So far I haven't succeeded. Here are some notes about my attempts.

I patched kernel 2.6.7 with

software-suspend-2.0.0.102-for-linux-2.6.7.tar.bz2
When I first tried to compile, I had configured the swsusp2 to not include debugging print support, since I thought I didn't want that. I could not get the kernel to compile; there were many small problems I fixed, but they all were related to avoiding the debug output. So I included debug support (by setting that option in "make xconfig"), and the kernel compiled.

All that said, I still had problems trying to compile. There was an error compiling

/usr/src/linux/arch/i386/power/suspend2.c
but I was able to fix it by putting
#ifdef CONFIG_SMP
at the beginning of smp_suspend2_lowlevel(void* info) and #endif at the end of that function. I don't understand why smp_suspend2_lowlevel has to be defined if CONFIG_SMP is not set.

Anyway I can compile as modules, but it cancels suspend. If I use an initrd (as instructed), then it fails on boot. If I compile swsusp2 into the kernel (not as a module), then the kernel crashes on boot.

Wireless Networking

I installed the madwifi drivers from CVS source:
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/madwifi co madwifi
cd madwifi
make
(as root) make install
These don't work for me, in sense that freezes at ifconfig ath0 up. However, I got it to work by using this remark. The ifplugd was causing a kernel fault! So I had to turn of ifplugd for the ath0 interface:
form:~# more /etc/default/ifplugd    (after I edited it!)
INTERFACES="eth0"
#HOTPLUG_INTERFACES="all"
HOTPLUG_INTERFACES=""
ARGS="-q -f -u0 -d10 -w -I"
SUSPEND_ACTION="stop"
Notice that now I'll need to explicitly add any hotplug interfaces I might use.

Thinkpad Buttons

I installed the tpb package:
   apt-get install tpb
   chmod a+rw /dev/nvram
To start it I use this script:
#!/bin/bash
exec tpb --osd=on --verbose --thinkpad="/usr/bin/konqueror" --wireless="/usr/bin/konsole -e /home/was/bin/hibernate" &
I have a script with those lines in my .kde/Autostart folder.

Miscellaneous Software

Freezing ssh shells

I have a comcast cable modem, and my ssh shells freeze regularly, without lots of network activity. This is extremely annoying. Anyway, the following is a workaround for an openssh2 client. Add to /etc/ssh/ssh_config
   ServerAliveInterval 20
   ForwardX11 yes  #also useful

My Sprint USB Sanyo 4900 Phone

  1. Compiled CONFIG_USB_ACM=m the acm.o module. (Selected this in the USB section, near the middle.)
  2. modprobe acm
  3. Plugin phone:
    May 29 16:40:01 localhost kernel: Product: SANYO USB Phone
    May 29 16:40:01 localhost kernel: SerialNumber: Serial Number
    May 29 16:40:01 localhost kernel: ttyACM0: USB ACM device
    May 29 16:40:01 localhost default.hotplug[3190]: arguments (usb) env (DEVFS=/proc/bus/usb OLDPWD=/ PATH=/bin:/sbin:/usr/sbin:/usr/bin ACTION=add PWD=/etc/hotplug HOME=/ SHLVL=2 DEVICE=/proc/bus/usb/003/003 PRODUCT=474/701/0 TYPE=2/0/0 DEBUG=kernel _=/usr/bin/env)
    May 29 16:40:01 localhost default.hotplug[3190]: invoke /etc/hotplug/usb.agent ()
    May 29 16:40:01 localhost default.hotplug[3191]: arguments (usb) env (DEVFS=/proc/bus/usb OLDPWD=/ PATH=/bin:/sbin:/usr/sbin:/usr/bin ACTION=add PWD=/etc/hotplug HOME=/ SHLVL=2 DEVICE=/proc/bus/usb/003/003 PRODUCT=474/701/0 TYPE=2/0/0 DEBUG=kernel _=/usr/bin/env)
    May 29 16:40:01 localhost default.hotplug[3191]: invoke /etc/hotplug/usb.agent ()
    May 29 16:40:05 localhost usb.agent[3190]: Setup acm for USB product 474/701/0
    May 29 16:40:05 localhost usb.agent[3191]: Setup acm for USB product 474/701/0
    May 29 16:40:05 localhost usb.agent[3190]:      acm: already loaded
    May 29 16:40:05 localhost usb.agent[3191]:      acm: already loaded
    
    The following configuration steps are copied this web page, and they work perfectly for me. Now that you've got an ACM device, you just need to create a dialup connection. Note that the ACM device name may vary - just search through /dev for the proper device. On my (default) Debian install, it's /dev/ttyACM0. On RedHat 7.3, it's /dev/input/ttyACM0. Once you've found that, the number to dial to get a connection to the Vision network is '#777' (which is #PPP on the keypad). So, use whatever method you prefer to create a dialer that will dial #777. On my Debian box, I'm using the standard 'pon' scripts. Here are the config files I use:
    /etc/ppp/peers/sprint:
    
     # You usually need this if there is no PAP authentication
     noauth
     # The chat script (be sure to edit that file, too!)
     connect "/usr/sbin/chat -v -f /etc/chatscripts/sprint"
     # Set up routing to go through this PPP link
     defaultroute
     # Use remote DNS
     usepeerdns
     # Default modem
     /dev/ttyACM0
     # Connect at high speed
     230400
     local
     novj
    
    
    /etc/chatscripts/sprint:
    
    TIMEOUT         5
    ABORT           '\nBUSY\r'
    ABORT           '\nERROR\r'
    ABORT           '\nNO ANSWER\r'
    ABORT           '\nNO CARRIER\r'
    ABORT           '\nNO DIALTONE\r'
    ABORT           '\nRINGING\r\n\r\nRINGING\r'
    ''              \rAT
    TIMEOUT         12
    OK              ATD#777
    TIMEOUT         22
    CONNECT         ""
    
    

Canon USB 2.0 LIDE 20 CanoScan scanner

It worked in about one minute.
  1. apt-get install sane xsane
  2. Run xsane as root.
  3. It just works!
This page was helpful. I added was to the scanner group (changed /etc/group). That should fix the permissions problems.

PCMCIA

  • After swsusp2 hibernate the pcmcia system doesn't work. Restarting it with
    /etc/init.d/pcmcia restart
    
    as root fixes the problem.

    Writing CD's and DVD

    Writing CD-R's and DVD's works, but I can't erase DVD's from K3B. I have only tried writing data DVD's, not DVD's to play on a DVD player. It takes over 20 minutes to write a full 4.3GB data DVD.
    1. I followed this advice: "To get CD burning working all you need in kernel 2.6.x is to have IDE-CD (CONFIG_BLK_DEV_IDECD) enabled and edit /etc/cdrecord/cdrecord to say ?CDR_DEVICE=/dev/cdrom?."
    2. Install k3b and cdrdao:
             apt-get install k3b
             apt-get install cdrdao
      
    3. modprobe ide-cd
    4. Run k3b (which will fix necessary permissions)
    5. Burned and verified a sample CD-RW while compiling kernel...
    6. Created desktop shortcut: modprobe ide-cd; k3b
    7. When I started k3b with a DVD writer, it asked me to install a few other packages and I did (using apt-get). Unfortunately, I don't remember exactly what their names were. They were standard dvd authoring packages.