Linux On Laptops

Gentoo Linux on IBM Thinkpad T42

Specs

Model Thinkpad T42; Model: 2372-7WA
CPU Dothan Pentium-M, 1.7Ghz, 2MB L2 cache
RAM 512Mb PC2700 (one module)
Video & LCD ATI Radeon Mobility 7500, 32Mb dedicated. 14" LCD, 1024x768.
Hard drive 40Gb ATA, 5400 RPM
Optical Drive DVD / CDRW
Networking Intel gigabit wired ethernet. Intel 802.11b/g.
USB / IEE1394 Two USB2 ports
PCMCIA Two PC Card slots on left side
Bluetooth / Fingerprint reader / IEEE1394 No, no and no. Bluetooth would have been nice..
Warranty Three years (one year on battery). International coverage.

T42, left side. T42p, right side.

Images ripped off IBM's website. Click for very large versions.
The one on the right is actually a T42p, but it looks identical as far as I can see (apart from the bluetooth status light).

Overall Impressions

Despite the cons, I really like this notebook. It idles at around 50 degrees, only rising to 72 degrees when compiling. It plays back full screen MPEG4 video without skipping. I just wish it had a more hard-wearing lid and better construction. The laptop I used previously was a HP OmniBook XE3 which came with a hard top lid and rubberised corners standard. It weighed a tonne but I'm confident I could pour a cup of coffee over the lid and it'd still work. No way this thinkpad would survive such an ordeal. But it has a three year warranty so I'm not too worried. Just have to accept that three years down the track it will look like crap, but still be running fine :-)

Pros

Cons

Questions

Partitioning and Setup

I want to dual boot this PC, so had to shrink the Windows partition to make room for Linux. The IBM rescue partition takes up around 5Gb. I reduced the NTFS partition to 12Gb and filled the remaining space with a 50Mb /boot and the rest (~22Gb) for /. Here's the process I went through:

  1. Enter the IBM recovery process by pressing the Blue Button at boot. Have it to a full reset - this is pretty much automatic. The PC will reboot several times and eventually lead you through the Windows XP initialisation procedure.
  2. Delete C:\IBMWORK (optional). From the watching the reset process, I'm guessing this is a temp working directory. Had a gig of stuff in it and I could use that space, so into the recycle bin it goes.
  3. Degrag the disk (Start->All Programs->Acessories->System Tools->Defragment). I read that this is no longer necessary with recent versions of ntfsresize, but it can't hurt.
  4. Boot SystemRescueCD, choose fb1024 option, default keyboard layout. When booted, execute "run_qtparted".
  5. Resize the NTFS partition down to 12Gb. Create new linux partitions. Commit.
  6. Reboot. Windows will prompt to do a check on the hard drive. Let it run.
  7. Hopefully XP will boot happily. Now do usual Windows setup (replace Symantec with AVG, install 7zip, putty, winscp, firefox, a/v codecs, etc). Run windows update and do that dance. There will be a couple of Thinkpad specific updates under Hardware - modem and video drivers IIRC.
  8. Reboot onto the Gentoo livecd. No special procedure for booting off the optical drive - it'll Just Work.
  9. The wired ethernet should be automatically detected and setup via DHCP. Run through a normal Gentoo install.

Kernel

Kernel 2.6.x has been a little flakey in the past, due to the dubious new kernel release policy. Decided to take a punt anyway and went with 2.6.11 vanilla (2.6.11.1 was actually out at the time, but it only had a few fixes that didn't apply to me and it wasn't in portage yet). No complaints so far. Set vm.swappiness = 10 in /etc/sysctl.conf to discourage the vm system from swapping out application data for disk buffer.

Audio

The ALSA module snd-intel8x0 works perfectly. Emerge alsa-utils. Add the following lines to /etc/modules.d/alsa:

alias snd-card-0 snd_intel8x0
alias sound-slot-0 snd-card-0

Run alsamixer and unmute the Master and PCM channels.

Network

Wired ethernet uses module e1000.

Wireless ethernet can use either the ndiswrapper driver, or the native ipw2200 driver. I used the latter. Emerge ipw2200 and ipw2200-firmware, modprobe ipw2200 and you're good to go for unencrypted or WEP encryption. If you get a firmware error in the log, try adding the hwcrypto=0 option to the ipw2200 module. For WPA, emerge wpa_supplicant and set -Dipw in /etc/conf.d/wpa_supplicant. I had to add wpa_supplicant to the boot runlevel in order to have it load before the network is initialised - "before net" doesn't appear to work..

I really like the gnome wireless info applet. I added a small patch to gnome-applets to have it show the bit-rate in the tooltip.

Sreenshot of the patched wireless gnome-applet

Keyboard

The keyboard light key combo already works, as do the volume and mute buttons. I'm using tpb to map the blue "Access IBM" button to launch a gnome-terminal. Using xbindkeys for other shortcuts like Shift-Control-b to launch a browser. Could really use a windows key here..

Video

One of the reasons I bought this laptop was to get 3D acceleration, even as basic as this. The Radeon Mobility 7500 is old enough that it doesn't require the ATI fglrx driver. Just set the driver to "radeon" in xorg.conf, uncomment the glx, dri and DRI sections and you're away. You also need to make sure the agpgart and intel_agp kernel modules are loaded before the radeon module. I enforce this by adding add before radeon intel_agp agpgart to /etc/modules.d/aliases.

You'll know its setup right when glxinfo shows "Direct rendering: yes". I get around 590 FPS in glxgears, and around 40 FPS in q3demo, timedemo demo001 @ 640x480 default settings. Pretty poor really, but sufficient for my purposes. Interestingly the textures all look fine with default settings whereas a Radeon Mobility 9000 I tried had screwed up textures with the fglrx driver until I turned on vertex lighting.

Pointing devices

To make the touchpad support tap/click, you need to give the psmouse module a special option. Add options psmouse proto=imps to your /etc/modules.d/aliases. Haven't figured out how to make the "middle" button work as a middle button yet. Not in a great hurry since it is so easy to trigger the emulation with the two touchpad buttons - I haven't missed yet.

I might switch to the synaptics driver at some point as it appears to have many more options for customisation and special features.

Encrypted home

With notebooks, there is an increased likelyhood of someone running off with your hardware and prying through your data before nuking it and throwing it on ebay. Just in case, I decided to run an encrypted $HOME setup. There is an excellent HOWTO in the Gentoo forums, which you can find in this thread. I now have my $HOME mounted from an AES-256 encrypted file when I log in, and automatically unmounted on log out. pam_mount takes care of the mount/umount transparently so there is no extra passphrase to enter. Nice!

Software suspend

ie "Hibernate". Dump the current process state, kernel state and memory to the hard drive and shut down. On reboot, it should detect the old data, load it into memory and resume wher you left off. Seems a little hairy still, but definitely improving. Keep an eye on swsusp2.

Update: I recently updated the kernel to 2.6.12.3 (vanilla) then patched in suspend2 2.1.9.9 by hand. Followed the Suspend2 HOWTO and it appears to be working perfectly:

Biometric interface

Some thinkpads have an integrated fingerprint scanner. If yours does, check out linuxbiometrics.com where a linux driver is in development.

Config files

Not especially pretty or optimised, but you might find some clues here if stuck.

Contact

If you have any questions or advice, please email the webmaster.