DE.STRUCTION: private

Gentoo GNU/Linux on IBM / Lenovo ThinkPad T43 266874G

THIS ARTICLE IS STILL UNDER CONSTRUCTION

The final (read: more complete) version is scheduled to first quarter of 2007.

Introduction

Looking around for a notebook that runs linux quite well can be hard. you cannot have everything you want. The most important features (random ordering) for me are:

I spent some time to decide which notebook to buy, because I'm always looking for 100% native linux support. Thanks to Gina who answered my questions, I finally decided to buy the IBM ThinkPad T43 266874G in march 2006 and I'm quite happy with it. Unfortunatly it's not working everything out of the box, but almost. This modell fits my needs best.

This document should help other people looking for linux-support on ThinkPad T43. If you use another modell, you may still use some generic hints. Just take a look, which hardware is the same.

I tried "the new" way of installing gentoo by using the installer, which was a bit buggy. I think it's still better, to install everything the "classic way", which I did then.

As this document was written, kernel 2.6.15 was out, which works great. No more need to patch every feature in, so just

emerge gentoo-sources

and configure it using my .config

Quick Hardware-Overview

Hardware Components Status Notes
Intel Pentium M (Dothan) 2.0GHz works
Intel 915PM chipset works
14.1” TFT Display (1400×1050) works
80GB PATA HDD works uses libata (see below)
DVD-ROM/CD-RW Combo works uses libata (see below)
AC’97 Audio Controller works autodeteced by ALSA
Broadcom NetXtreme BCM5751M Gigabit Ethernet (10/100/1000) works
IBM Bluetooth 1.2 Module (Broadcom) works uses USB (internal)
Atheros AR5212 802.11abg Mini-PCI WIFI works see below
USB 2.0 Controller 82801FB/FBM/FR/FW/FRW (ICH6 Family) works
UltraNav (TrackPoint / Touchpad combo) works see below
ATI M22 Radeon Mobility M300 partly works DRI only tested with proprietary ATI-driver, xinerama not tested, external VGA only usable if Monitor attached during boot, S-Video not tested (see below)
IBM Active Protection System (HDAPS) partly works see below
56K Modem not tested found by ALSA
CardBus slot (Type 2) not tested
ExpressCard/54 slot not tested
IBM Embedded Security Subsystem 2.0 not tested I've no use for TPM, so it's deactivated in BIOS
Integrated Fingerprint Reader not tested uses USB (internal)
IrDA not tested

Detailed description (of some things)

Power Management (ACPI)

Standby / Hibernate

Works out of the box (using my kernel-config) by writing mem or disk to /sys/power/state. Actually i'm just using standby which takes about 4 seconds instead of booting ;-) It consumes about 5% of it's running power, so a few days standby on battery is possible. Hibernate is only used, if my battery is low or it's not powered on some time. Since kernel-versions greater than 2.6.16, hibernate (software-suspend) was moved to user space and my kernel fails to compile the interface. (config-option seems to be removed)

Proprietary ATI-drivers starting at version 8.32.5 seem to crash after resuming from standby. All tested versions since 8.23.7 were working perfectly, so I reverted to last working version 8.30.3. anybody with similar issue or a solution/fix: please contact me.

Use my ACPI-handler below to enable standby / hibernate by pressing the special labeled FN+F4 / FN+F12 key.

CPU frequency scaling

Graphics Card

SATA HDD / DVD-ROM

ibm-acpi features

Atheros AR5212 802.11abg Mini-PCI WIFI

I'm using the MadWifi-ng-driver, which works pretty well.

emerge net-wireless/madwifi-ng net-wireless/madwifi-ng-tools

It will give you the physical wifi device as wifi0. Actually you cannot use it for wireless operations. Instead you have to create a virtual wifi device (e.g. ath0):

wlanconfig ath0 create wlandev wifi0 wlanmode sta

will create ath0 which you can use now as usually in station-mode (act as client). (This will be done automatically by gentoo, if the module is loaded)

VAP basics

You are not limited to only one virtual wifi device (only one can be in station-mode). In fact you even can use a different wlanmode on each virtual device. The only constraint I know of, is that they all have to share the same channel.

To create a virtual device as an AccessPoint use:

wlanconfig ath create wlandev wifi0 wlanmode ap

This will give you the next free athN device. To create a virual device in monitor-mode, which captures all traffic simply do:

wlanconfig ath create wlandev wifi0 wlanmode monitor

Of course, you can remove virtual devices:

wlanconfig ath1 destroy

There's much more possible - just have a look at the wlanconfig manpage or the excelent MadWifi-Wiki.

Changing the MAC-address

Why changing the MAC? Some service providers (like Humboldt University Berlin) want to restrict wifi, so only registerd users are allowed to parcipate the net. The cheapest (and weakest) solution is to discard packets from divices not on a white list.

As a student at HUB you have register your wifi-card's MAC. Now imagine you own more that one mobile device (e.g laptop and wifi-capable smartphone) but it's not possible to register more than one MAC per account. Got it? Simply just register one MAC for all devices. The drawback is that you may not operate all devices at the same time (not tested yet), since it may confuse the internal network architecture.

The only trick is that you have to change the MAC of the physical device, while no VAP is defined. Afterwards you create a VAP that inherits this MAC:

# destroy old VAP wlanconfig ath0 destroy # change MAC of wifi-device ifconfig wifi0 down hw ether 00:0B:AD:CO:DE:00 ifconfig wifi0 up # create new VAP (with cloned MAC) [outputs dev] wlanconfig ath create wlandev wifi0 wlanmode sta # bring up interface ifconfig ath0 up

WPA2-PSK with wpa_supplicant

Using WPA2 encryption with a PSK is quite simple. Install wpa_supplicant:

emerge wpa_supplicant

Configure it by creating /etc/wpa_supplicant.conf:

network={ ssid="YOUR NETWORK NAME" proto=WPA2 key_mgmt=WPA-PSK psk=YOUR_KEY_GENERATED_WITH_WPA_PASSPHRASE }

wpa_passphrase will help you to create the psk.

Tell gentoo that you want to use the MadWifi-driver on ath0 (if that's your virtual device in station-mode) by creating /etc/conf.d/net.ath0:

modules=( "wpa_supplicant" ) wpa_supplicant_ath0="-Dmadwifi" wpa_timeout_ath0=60

After symlinking /etc/init.d/net.lo to /etc/init.d/net.ath0 you can associate with your AP by:

/etc/init.d/net.ath0 start

IBM Active Protection System (HDAPS)

UltraNav (TrackPoint / Touchpad combo)

Advantages / Disadvantages

Ressources

Hardware

Config

Scripts

ACPI-handler

description

I've written some scripts to handle ACPI-events. Some of them are generic and could be used on other hardware, too but mostly they depend on ibm-acpi, which is part of the kernel since 2.6.10 (CONFIG_ACPI_IBM).

Here is a quick overview: (FN+Fxx-events can be triggered by pressing FN and Function-Key xx together)

Event Script Description
FN+F3 /etc/acpi/toogle_backlight.sh Toogle Backlight (on/off) which saves power. IDEA: lock screen, too
FN+F4 /etc/acpi/standby.sh Let's sleep: Suspend-to-RAM (and deactivate WiFi, to prevent problems)
FN+F5 /etc/acpi/toogle_bluetooth.sh Toogle Bluetooth module (on/off)
FN+F6 /etc/acpi/toogle_wifi.sh Toogle WiFi module (on/off)
FN+F12 /etc/acpi/hibernate.sh Take a deep sleep: (software) Suspend-to-Disk (and deactivate WiFi, to prevent problems)
BATTERY /etc/acpi/battery.sh Display warning, if battery is low / hiberate, if battery is almost empty

You may alter behaviour easily, or implement new features like standby on closing the lid (which I dislike). IDEA: control frequency-govenor through FN+Fxx keys (powersave, conservative, performance)

download

Simply download ibm-acpi-eventhandler.tar.bz2 and install the files into /etc/acpi (assuming, ACPI-support is enabled and working).

Some of the scripts take advantage of other installed software packages, or my own helper-scripts. Mainly dependencies are very basic, like sh, grep, sed, cat, echo, test, logger which should be found on any linux-system. while acpi still makes sense, you will need xosd to get graphical feedback. To switch off the backlight I'm using radeontool.

Theft-Alarm

description

As it's a cruel world and mobile devices are easy to steal you may want to secure your laptop. Since Kensington locks are not secure, perhaps you cannot avoid theft. But at least you can try by letting your laptop "scream for help".

My idea is to use a couple of sensors your laptop comes with. If any of them reports a changed state, we assume someone moves your laptop away. Our only chance is to persuade the thief that it makes no sense running away with a laptop that makes awfull noise.

The script is kept modular, to plug-in new sensors easily. There are three states:

  1. INACTIVE (passive state, do nothing - default)
  2. ACTIVE (armed)
  3. ALARM (awfull noise)

In INACTIVE state (default after startup) the laptop can be used mobile as usual. The screen is not locked (by xscreensaver). There may be a token (e.g. a bluetooth phone), which switches to ACTIVE state, if not in range. This way the screen automatically gets locked and the laptop armed.

In ACTIVE mode, which you may enter manually by locking your screen, all available and configured sensors will switch to ALARM state, if any change is detected. This may include the following:

The only way to disarm and change back to INACTIVE state is to unlock the screen, by knowing your password.

In ALARM state the speaker volume is raised up to the max and will beep. Additionally your soundcard may do the same. The state changes back to ACTIVE, if all sensors report their reference values. Some more ideas are:

The sensors are not limited to hardware supported by the T43. But in fact I got the idea, playing around with HDAPS.

I've to mention that this approach will not stop anyone from stealing your laptop. It will only try to get attention of other people around to become aware of a crime. It only will work when your laptop is powered on (and the script is loaded) and has enough battery. If someone is fast enough to power down your laptop in advance, or killing AC and battery, probably nobody will notice anything. So at least you should restrict access to boot the laptop with a password only. This way a thief won't have much fun with it. (or the knowledge of breaking it)

download

theft-alarm-1.0.tar.bz2 (2006-05-09)

This script is currently stable, while more plugins are in development. It was tested on my T43 and some other 'not-ThinkPads' so far, so any feedback is welcome.

To learn more about this script and its plugins, read the description above, see README, or take a look at the plugins.

NOTE: after starting the script it's default state is INACTIVE, so no theft-checks are done, until it's put in ACTIVE state (e.g. by a locked xscreensaver). For debugging purposes the plugin DEBUG_LOCK.sh switches to ACTIVE state when the file /tmp/ta.lock exists.

some helper-scripts

Currently my stuff from /usr/local/. Grab the needed scripts, if some of the above scripts need them.

They are short and commented...

Links

Linux installation guides for ThinkPad T43's

general information

ThinkWiki: http://www.thinkwiki.org/wiki/Category:T43

IBM ThinkPad T43 ressources

TuxMobil - Linux on Laptops, Notebooks, PDAs and Mobile Phones