The Thinkpad X20


Introduction

Here are some notes on getting Fedora Core 3 to run on a Thinkpad X20 - including modem and 3D support.

If you have the 3COM combo modem/ethernet card, skip the modem part. The 3COM modem is a paperweight under Linux, though the ethernet part of it will work. Look on Ebay for the Lucent/Intel modem combo card and swap it out to get a working internal modem.

System specifications

Model 2662-11U
Processor Intel Celeron at 500 MHz
Hard Disk Swapped out with a 5400 RPM 40GB Hitachi Travelstar. It came with a 10GB drive
Memory 320 MB
Video ATI Rage Mobility P/M with 800x600 LCD panel
Audio Cirrus Logic Crystal CS4281
Ethernet Intel Ethernet Pro 100
Modem Agere/Lucent LT WinModem

Hardware Support

Fedora Core 3 supports the ethernet controller, sound, and (partially) the video card out-of-the-box. Full support for the video card and modem requires a little extra work.

Video XOrg mach64 driver with DRI support
Modem ltmodem module / driver package

Power Management

APM will work if you pass acpi=off apm=on to the kernel at boot time. Edit /etc/grub.conf:

title Fedora Core (2.6.9-1.681_FC3)
root (hd0,1)
kernel /vmlinuz-2.6.9-1.681_FC3 ro root=LABEL=/1 acpi=off apm=on
initrd /initrd-2.6.9-1.681_FC3.img

If your system just beeps a bunch of times after you press Fn-F4, or locks up when you close the lid to suspend, you may need to stop the PCMCIA service before suspending. Edit /etc/sysconfig/apm-scripts/apmscript to do this (even though the file says not to edit it :) ). Add the lines in bold. Back up the file first - in case you screw up.

#!/bin/bash
#
# Red Hat APM suspend/resume script

...[SNIP]...

CLOCK="--localtime"
[ "$UTC" = "yes" -o "$UTC" = "true" -o "$UTC" = 1 ] && CLOCK="--utc"

case "$PROG" in
suspend|standby)
service pcmcia stop
[ -f /etc/sysconfig/apm-scripts/apmcontinue-pre ] && /etc/sysconfig/apm-scripts/apmcontinue-pre "$@"

...[SNIP]...

resume)
service pcmcia start

...[SNIP]...

There is probably a cleaner way to do this, but I can't make sense of the comments at the beginning of the file telling me what script I am supposed to edit. The edits above will fix APM suspend, at least. The edits are not necessary for APM hibernate.

TODO: Add information about creation of hibernation file under Linux using tphdisk.c.

APM update: January 10, 2005

A note on reliability: Testing this out for a little while, I've found APM hibernate to be extremely reliable. The system will wake up every time. 3D support, modem, and sound all survive. APM suspend is mostly reliable. I have had it die on me if I suspend the system on the port replicator and then wake it up on battery. This may have just been random bad luck, but I haven't had time to try to reproduce it properly.

3D Support for the ATI Rage Mobility P/M

This card is a Mach64 series card, and does have 3D support in recent versions of Xorg. However, Fedora does not build the required drivers by default. To get 3D support working, you must recompile the X server. Here are the steps, which you'll need to do as root.

Install the xorg source RPM

As of this writing, that's xorg-x11-6.8.1-12.FC3.21.src.rpm.

rpm -ivh xorg-x11-6.8.1-12.FC3.21.src.rpm

Edit the spec file to build the mach64 driver

You'll need to make two changes. First, change the version number of the package so that you'll know it's modified and won't confuse it with the original package. In /usr/src/redhat/SPECS/xorg-x11.spec, edit the Release version:

Name: xorg-x11
Version: 6.8.1
Release: 12.FC3.21mach64

You'll also need to tell the build process to build the driver. Further on in the spec file (it's huge), there's a section where the hosts.def file is generated for the xorg build. You need to add #define BuildDevelDRIDrivers YES there:

#define BuildDevelDRIDrivers YES
#define DriverManDir \$(MANSOURCEPATH)4
#define DriverManSuffix 4x /* use just one tab or cpp will die */
#define MiscManDir \$(MANSOURCEPATH)7
#define MiscManSuffix 7x /* use just one tab or cpp will die */

EOF

Probably the easiest way to find this part of the file is to search for "EOF" using your text editor.

Build the RPM

First, I build a source RPM, because we'll need the source again.

rpmbuild -bs xorg-x11.spec

Now, build the binary RPM. This will take a while.

rpmbuild --rebuild /usr/src/redhat/SRPMS/xorg-x11-6.8.1-12.FC3.21mach64.src.rpm

Once this is built:

cd /usr/src/redhat/RPMS/i386
rpm -Fvh xorg*

This will install the new X server and related programs.

Building the kernel module

Fedora Core 3 does not come with the kernel module needed for the mach64 driver to work. So, you've got to build that too. Install your xorg source RPM and go to the source directory:

rpm -ivh /usr/src/redhat/SRPMS/xorg-x11-6.8.1-12.FC3.21mach64.src.rpm
cd /usr/src/redhat/SOURCES/

Unpack the xorg sources.

tar xfz xorg-x11-6.8.1.tar.gz

Inside the extras directory, you'll find the source for the kernel module you need.

cd xc/extras/drm/linux

Now, build the module.

make

When this is finished, you'll have the kernel module you need. Install it.

cp mach64.ko /lib/modules/2.6.9-1.681_FC3/kernel/drivers/char/drm/
depmod -a

Modifying your xorg configuration

You'll need to add a few options to your xorg.conf file to get your 3D acceleration working. Edit /etc/X11/xorg.conf:

Section "Device"
Identifier "Videocard0"
Driver "ati"
VendorName "Videocard vendor"
BoardName "ATI Rage Mobility"
Option "DMAMode" "async"
Option "AGPMode" "1"
EndSection

Making 3D acceleration work for users

You may find that on your next reboot, 3D acceleration doesn't work for your user account (but it does for root). If that's the case, then edit your /etc/rc.local file and add these lines to the end:

#
# fix for:
# Mach64 DRI works as root but not as user
#
modprobe mach64
chmod 0755 /dev/dri
chmnd 0666 /dev/dri/card0

Notes on 3D

I've heard, but am not able to verify, that 3D acceleration on the Thinkpad x20 works only if your display resolution is set to 800x600x16 bit color or lower. Since I don't have an X20 with the 1024x768 screen, can someone verify for me whether that's true or not?

glxgears gives me about 231 fps on my X20 after enabling 3D acceleration. This lets me play Tux Racer and use Celestia, at least.

I've noticed that with recent versions of XOrg Fn-F7 to switch the display between the LCD and the monitor no longer works correctly. This causes some problems when using LCD projectors for presentations. The workaround is to boot the laptop with the external monitor/projector connected.

Update: 6/25/05

To fix the breakage of display switching with Fn-F7, edit your /etc/X11/xorg.conf file and add the following line to your "Device" section:

Option "BiosDisplay" "yes"

My question is simply ... why the hell is this disabled by default??? The next thing you know, we'll have to edit our configuration files and add things like Option "WorkProperly" "yes". Sheesh!

Modem drivers

ltmodem drivers can be compiled without installing the full kernel sources.

To get the modem to work, I had to modify /etc/rc.d/rc.local. I added:

#
# fix for:
# ltmodem and ppp don't get along
#
ln -s /dev/ttLTM0 /dev/modem
modprobe lt_serial

/dev appears to be created fresh on every boot, and for some reason the lt_serial module isn't automatically loading when trying to dial (instead, ppp fails with an error), so I simply load the module at boot time. The symlink is there because ppp also complains when the modem device is /dev/ttLTM0.

This is probably a udev thing. I don't understand the ins and outs of udev yet. :)



TuxMobil - Linux on laptops, notebooks, PDAs and mobile phones
Click this link to go back to the top
This web site was last updated December 19, 2009.