Fedora Core on Thinkpad X40 Customization HOWTO

Eric Steven Raymond

Revision History
Revision 2.62006-10-11esr
Termination announcement,
Revision 2.52006-04-24esr
More cleanup on software suspend.
Revision 2.42006-03-27esr
Now we know how to make software suspend work.
Revision 2.42006-03-24esr
Updated for Fedora Core 5. Install madwifi the easy way, from livna. Software suspend is somewhat horked.
Revision 2.32005-11-06esr
Updated for Fedora Core 4. Removed the sections on tpb and tpctl, as I wasn't using them and ibm-acpi seems to be the way to go if you want those capabilities.
Revision 2.22005-08-15esr
Note the existence of the ACPI-Extras driver.
Revision 2.12005-05-05esr
Point to Stephan Müller's FAQ.
Revision 2.02004-10-15esr
Update for FC3.
Revision 1.42004-10-4esr
Fixing DHCP troubles.
Revision 1.42004-09-18esr
ACPI works now.
Revision 1.32004-09-07esr
With John Leach's recipe, 2.6.8 partly fixes ACPI.
Revision 1.22004-09-07esr
2.6.8 doesn't fix ACPI.
Revision 1.12004-08-06esr
Solution to the Suspend problem.
Revision 1.02004-08-05esr
Initial release. Workaround for screen garbage, setup steps for the Atheros, some discoveries about ACPI.

Abstract

This is a HOWTO on configuring and customizing Fedora Core 4 for use on an IBM X40 (I'm told X40 advice also works well for the T40, which is essentially the same machine with a bigger display).

Note: as of 11 October 2006, this FAQ is no longer actively maintained. I have upgraded to an X60. I recommend ThinkWiki for all your Linux-on-Thinkpad configuration needs.


Table of Contents

Summary of recommended fixes for Fedora Core 5 on the X40
Most Things Just Work
Kernel-level support
Things That Don't Work, And How To Fix Them
Suspend/resume
The on-board wireless hardware
The modem
Helpful Links

Summary of recommended fixes for Fedora Core 5 on the X40

  1. Add "acpi_sleep=s3_bios" to the kernel options in /etc/grub.conf to make suspend/resume using Fn-F4 work.

  2. Remove the GNOME power manager package with this command:

    rpm -e gnome-power-manager
    

  3. Enable the livna.org repository and do this:

    rpm -ivh http://rpm.livna.org/livna-release-5.rpm
    yum install madwifi
    

    to make your Atheros WiFi hardware work.

Most Things Just Work

Most things just work. The X display problems in earlier Fedora Core versions are gone. Sound is good out of the box.

Hitting the power-off button while Linux is at runlevel 3 or 5 dispatches through acpid(8) and runs shutdown -h now as it should.

However, note that upgrading your X server from a stock FC5 may break your X! This happened with some FC4-era updates as well. It is probably a good idea to put "exclude=xorg*" in your yum options and update X only on major, well-tested releases.

Kernel-level support

There is an ACPI Extras driver that ships with 2.6.10 and later kernels; it's shipped in FC5 as a module. It provides very comprehensive control of the hardware features, including Fn keys, Bluetooth enable/disable, video output switching, docking/undocking and the UltraBay, CMOS control, LED control, ACPI sounds, and the embedded temperature sensors. The X40 is fully supported, lots of other ThinkPad models are partially supported.

Things That Don't Work, And How To Fix Them

Suspend/resume

With the kernel-level support in FC5, suspend-to-disk is triggered by Fn-F4 or by a lid close (the latter may not be obvious because there's a bit of lag between lid-close and event). Resume does bad things to X: one symptom I see is screwed-up backgrounds in xterms.

The resume problem can be fixed by adding "acpi_sleep=s3_bios" to the kernel options in /etc/grub.conf (thanks to Dax Kelson for this tip).

You also need to remove GNOME power manager. The trashed X display seems to be the result of some bad interaction between it and the kernel-level suspend support. This Bugzilla report tells the story. Here's the recipe for the fix:

rpm -e gnome-power-manager

Finally, you want lid close to sleep the machine, do this:

  1. Make the file /etc/acpi/events/lid.conf with this contents:

    event=button/lid
    action=/etc/acpi/action/sleep.sh %e
    
  2. In the /etc/acpi/actions/sleep.sh file, do this.

    #!/bin/bash
    
    echo -n 'mem' >/sys/power/state
    

    save, then

    chmod a+x /etc/acpi/actions/sleep.sh
    service acpid restart
    

The on-board wireless hardware

There are three different NICs inside X40s — the Intel Wireless Pro 2100 (b only), Intel Wireless Pro 2200 (bg), or the Atheros (abg), You can tell which you have by looking at the output of lspci(1).

I have the Atheros 802.11abg NIC. It's supported by the MADWIFI project. Here are the steps I took to get it working:

  1. Enable the livna.org repository and install the software with the following commands:

    rpm -ivh http://rpm.livna.org/livna-release-5.rpm
    yum install madwifi
    

  2. Type ifconfig -a. You should see an entry for “ath0”. This is your wireless device.

  3. Type ifconfig ath0 up to enable the device. Then type iwlist ath0 scan. If you get at least one cell listing, you are golden — your card has detected an active wireless access point.

  4. To connect your card to one of the access points, you will need to issue a command something like this:

    iwconfig ath0 mode managed essid XXXXX
    

    where XXXXX is one of the ESSIDs that showed up in your scan.

  5. I tripped over some strange bugs or misconfigurations when trying to get dhclient(1) to grab a DHCP address off my wireless router. Eventually I gave up and just did this:

    #!/bin/sh
    ifconfig eth0 down
    modprobe ath_pci
    ifconfig ath0 up
    iwconfig ath0 mode managed essid belkin54g
    ifconfig ath0 192.168.1.13
    route add default gw 192.168.1.1
    

The modem

I have never felt any need to get the on-board modem working; in this age of ubiquitous WiFi and Ethernet it seems like an evolutionary vestige. If you care, a configuration procedure is described here.

Helpful Links

There is a wiki for Linux-on-Thinkpad users: ThinkWiki. This is an excellent resource.

There is a comprehensive document on configuring the X40 aimed at Debian and Knoppix users here.

Internally, the X40 is much like a T40. This page helped get me started.

There is a good general FAQ covering Linux wireless support here.

There is an X40 HOWTO for Debian users here. It includes information on making the X40 modem, IrDA, and Bluetooth hardware work.