Installing Ubuntu 7.04 (Feisty Fawn) on a ThinkPad X40

From ThinkWiki
Revision as of 15:46, 5 August 2011 by Jdthood (Talk | contribs) (The machine)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Executive summary

Ubuntu Linux 7.04 -and probably any modern distro- "just works" out-of-the-box on this machine.

No manual configuration was required. Even network, wifi, xorg (with 3D acceleration), sound and suspend-to-ram were properly configured and functional, all with opensource drivers only, at the end of the default Ubuntu installation. I've no problem with fan noises either.

But there's still some room for fine tuning:

  • To improve energy efficiency and battery life (8 cell bat gives 4h with default install, 6h after tuning)
  • To access some special features (like some Thinkpad special keys)
  • To better use resources (memory, CPU, power, ...)

The machine

This an "all Intel" machine: differing from most other Thinkpad models because even the network, wireless and graphic controllers uses Intel chipsets. Note that some X40 models use atheros for wifi, or tg3 for ethernet (but not mine). That's why I opted for this one (beside the 1.2 Kg ultraportable form factor).

  • IBM Thinkpad X40 (model 2371Y29), Centrino platform
  • 1 Go DDR SDRAM (333MHz PC2700)
  • CPU: Intel Pentium M (Dothan) 738 at 1.4 GHz -32KB L1 - 2Mo cache L2 - 90 nm - LV (low voltage) - 400MHz FSB (4 x 100) - MMX - SSE - SSE2 - no NX/XD bit, no hyperthreading, no 64bits - socket 479 - (Enhanced) EIST SpeedStep - CPUID : 6D6 (cpu family: 6 / model: 13 / stepping: 6)
  • Southbridge chipset ICH4-M (Intel 82801DBM) : PCI, USB, IDE
  • Intel gigabit ethernet controller (linux kernel module: e1000) 82541GI MT mobile (support PXE boot :)
  • Wifi controller: Intel PRO/Wireless 2200BG Mini-PCI Adapter on a MiniPCI slot
  • Northbridge / Graphic chipset : Intel Extreme Graphics 2 (Intel 855GME)
  • Ricoh R5C511 PCMCIA controller (CardBus slot)
  • IrDA
  • TFT display: 12" screen, @1024x768 nominal resolution
  • Hard drive : 1.8" - PATA - 40 Go - 4200 RPM - Hitachi DK13FA-40B
  • ATA controler : Intel 82801DBM Ultra ATA storage controller 24CA
  • Audio controller: AD1981B AC'97 (linux kernel module: i810_audio)
  • Weigth / size: 1.24 Kg / 26.8 cm x 23.7 cm x 2.4 cm
  • UltraBase X4 with broken DVDROM
  • Batteries :
    • default small one: 4 cells, Li-Ion, 1900mAh (about 27.4W) ~ 3h00
    • new one : 8 cells, Li-Ion, 4400 mAh (about 63W), 0.4 kg, ref (FRU) : IBM-92P1083 ~5h30
  • BIOS version : 1UETD3WW (2.08 ), built on 2006-12-21, released on 2007/01/31
  • IBM ThinkPad Embedded Controller version : 1UHTA6WW (1.56)
  • FW model : TP-1U

Installation

The X40 is a very small ultraportable, and doesn't have builtin CDROM or floppy drive. I own an IBM UltraBase X4 dock station, but her DVDrom is dead. So I went for PXE (network boot) installation for the first time ; I just applied instructions from this web page : this was unexpectedly simple and worked flawlessly. Everything got installed from network, "over the air".

I kept the 4Go IBM recovery partition at the end of the drive, by superstition and for Rescue and Recovery. Afterwards, I compiled my own 2.6.22 kernel, patched with high resolution timers, to improve the battery life, and applied tips from the How to reduce power consumption.

Small glitches

Distribution (Ubuntu Feisty Fawn 7.04)

Even if everything was supported, there was some small things where Ubuntu (or Gnome, or Linux kernel) could have done better:

  • Suspend-to-ram works out-of-the-box, no special tricks are needed. But sometimes, not always, for an unknown reason, the Gnome "logout" screen hides the s2ram and s2disk (hibernate) options. Whatever, we still can suspend thanks to the thinkpad's special keys (or just with an "echo mem > /sys/power/state").
  • Ubuntu installs the "special keys" handler from the "hotkey-setup" package. This is suboptimal, since hotkey-setup supports less special keys than tpb, and consumes a lot of battery (see for instance this bug report).
  • More generally, the whole Ubuntu system needs work to become power efficient on laptops: switch to a 2.6.21 or more kernel, use in kernel "ondemand" governor rather than userland powernowd+hald-addon-cpufreq, activate AC97 power saving features when on battery, etc.
  • The default Ubuntu install left me with a lot processes related to printing (cupsd, gnome-cups-icon, hpiod, hpssd (this one is a python script!)) while I have no printer configured nor attached. Bad. They shouldn't start this until hald find something plugged or until I try to configure a printer. It also left the bluetooth "hcid" daemon, while I've no bluetooth controller. evolution-alarm-notify is running while I've never launched (let alone configured) Evolution.

Hardware and BIOS limitations

The hardware is fine for me, even if a bit old by nowadays standards (I'd prefer have an Intel AHCI chipset with SATA drive on it, for power efficiency reason, and I'd prefer a Core2Duo CPU....). It lacks also some options available on some other Thinkpads models, like the fingerprint reader (but seriously, I prefer give this up to keep my "all Intel" chipsets). It lacks a Firewire controler. The BIOS is also somehow suboptimal, in some aspects.

For an unknown reason, the BIOS disable by default the deeper power saving c-states (C3 and C4). There's two option for this that you need to turn on, despite the the misleading BIOS online help that says "usualy not needed". Type "F1" during boot to access the BIOS, then enable:

CPU power management
PCI bus power management

The BIOS, as in many laptops, hides the HPET hardware timer to the system. Windows XP don't support HPET and when enabled, it displays a yellow exclamation mark on his device manager list, hence the common vendor choice to disable it. That's a bit odd since Linux can make a great use of it: other available timers (PIC/LAPIC) can't schedule timer events more than a few milliseconds away, so they causes about 20 to 40 CPU wakeups per second. This impact the power consumption greatly. Yet, thanks to the Udo A. Steinberg and Venki Pallipadi, we have a way to force enable HPET on chipsets known to support it (this include ICH3-M, ICH4-M, ICH5-M etc.). So I applied their patch, part of the Resolution Timer patchset on top of my hand compiled 2.6.22-rc5 kernel, and all worked fine: dmesg | grep hpet:

[    3.740522] hpet clockevent registered
[    3.740527] hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0
[    3.740532] hpet0: 3 64-bit timers, 14318180 Hz
[    5.080000] Time: hpet clocksource has been installed.

Not tested yet

  • TCPA chipset: Trusted Computing controller. Should be supported by tpm and tpmdd but who need this, really ?
  • HDAPS (Hard Drive protection mechanism): this should work out of the box, we have a kernel module for that but I disable it because it's known to suck power
  • IrDA (Infrared controller) : is known to work too, and looks supported by my kernel, but I've no other IrDA device to test with
  • SD Card slot : I've no SD cards to test this
  • 56K Modem: I've no use of this

System informations

dmesg | grep states

[    5.280003] ACPI: CPU0 (power states: C1[C1] C2[C2] C3[C3] C4[C4])
[    5.280009] ACPI: Processor [CPU] (supports 8 throttling states)

lspci :

00:00.0 Host bridge: Intel Corporation 82852/82855 GM/GME/PM/GMV Processor to I/O Controller (rev 02)
00:00.1 System peripheral: Intel Corporation 82852/82855 GM/GME/PM/GMV Processor to I/O Controller (rev 02)
00:00.3 System peripheral: Intel Corporation 82852/82855 GM/GME/PM/GMV Processor to I/O Controller (rev 02)
00:02.0 VGA compatible controller: Intel Corporation 82852/855GM Integrated Graphics Device (rev 02)
00:02.1 Display controller: Intel Corporation 82852/855GM Integrated Graphics Device (rev 02)
00:1d.0 USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #1 (rev 01)
00:1d.1 USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #2 (rev 01)
00:1d.2 USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #3 (rev 01)
00:1d.7 USB Controller: Intel Corporation 82801DB/DBM (ICH4/ICH4-M) USB2 EHCI Controller (rev 01)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev 81)
00:1f.0 ISA bridge: Intel Corporation 82801DBM (ICH4-M) LPC Interface Bridge (rev 01)
00:1f.1 IDE interface: Intel Corporation 82801DBM (ICH4-M) IDE Controller (rev 01)
00:1f.3 SMBus: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) SMBus Controller (rev 01)
00:1f.5 Multimedia audio controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Audio Controller (rev 01)
00:1f.6 Modem: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Modem Controller (rev 01)
02:00.0 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev 8d)
02:00.1 Generic system peripheral [0805]: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 13)
02:01.0 Ethernet controller: Intel Corporation 82541GI Gigabit Ethernet Controller
02:02.0 Network controller: Intel Corporation PRO/Wireless 2200BG Network Connection (rev 05)

cat /proc/cpuinfo

processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 13
model name      : Intel(R) Pentium(R) M processor 1.40GHz
stepping        : 6
cpu MHz         : 600.000
cache size      : 2048 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 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss tm pbe up est  tm2 
bogomips        : 1196.93
clflush size    : 64


Other Linux installation reports on Thinkpad X40

Don't forget that the X40 line included different ethernet (tg3 or e1000) and wireless (atheros or Intel) chipsets, and that Linux support involved over time. So there may be some difference between your experience with X40 and others reports. Some reports are quite old too, and Linux involve at fast pace.

Thinkwiki internal notes about installing Linux on X40

Exernal links to notes about installing linux, OpenBSD and FreeBSD on X40

Installation Notes for Ubuntu 8.04 LTS (Hardy Heron)

Support for the Thinkpad X40 has improved even more in Hardy Heron. A few things to consider that have changed:

1) hotkey-setup has matured to the point that it no longer drains power, so it is now superior to tpb. My X40 has a nice little GUI that pops up when you change the volume/brightness using hotkeys.

2) Although powersaved is still used, laptop-mode-tools is also installed by default. You can go to /etc/laptop-mode/laptop-mode.conf to use the ondemand kernel governor.

3) hpet is now in the ubuntu sources. However, you have to boot with hpet=force to get it work.

4) CPU undervolting is very well supported by the X40. http://ubuntuforums.org/showthread.php?t=786402 has all the information you need. I use the following set of phc values with perfectly stable results: 12:15 11:12 10:9 9:6 8:4 6:1

5) To enable middle-wheel scrolling, go to /etc/X11/xorg.conf and add the following to the "configured mouse" section:

Option "EmulateWheel" "true"
Option "EmulateWheelButton" "2"

6) To make the NumLock (Shift+ScrLk) and the Back/Forward buttons near the arrow keys work, add the following to ~/.Xmodmap:

keycode 77 = Num_Lock
keycode 234 = XF86Back
keycode 233 = XF86Forward


7) NOTE: THE BELOW METHOD STILL RESULTS IN SYSTEM FREEZES FOR ME (Thinkpad X40, 1.2 Ghz Banias)

For at least kernel 2.6.24, UltraBase X4 actions are detected by ACPI's dock driver. By default, UltraBay devices are not accounted for by the event handlers. This leads to system freezing when ejecting and undetected peripherals on docking. The ultrabay_insert and ultrabay_eject scripts from How to hotswap UltraBay devices can be used to achieve safe (un)docking.

Edit /etc/modprobe.d/options:

options dock immediate_undock=0

Create /usr/local/sbin/ultrabase_dock with permissions 755:

#!/bin/sh

/usr/local/sbin/ultrabay_insert
# Anything else that you want executed on docking goes here.

Create /usr/local/sbin/ultrabase_eject with permissions 755:

#!/bin/sh

/usr/local/sbin/ultrabay_eject
# Anything else that you want executed on ejection goes here.

echo 1 > /sys/devices/platform/dock.0/undock

Create /etc/udev/rules.d/50-ibm-ultrabase.rules:

ENV{EVENT}=="undock", KERNEL=="dock.0", SUBSYSTEM=="platform", RUN+="/usr/local/sbin/ultrabase_eject"
ENV{EVENT}=="dock", KERNEL=="dock.0", SUBSYSTEM=="platform", RUN+="/usr/local/sbin/ultrabase_insert"

Restart udev.

Now, the system will remove the UltraBay device when the undock button is pressed. The laptop can be removed when the dock's LED turns off. When docking, the UltraBay devices will be scanned and should be detected automatically.

Installation Notes for Ubuntu 8.10 (Intrepid Ibex)

After a fresh install of 8.10 (11th March 2009), I have the 'display back light is off after suspend to RAM' bug. link to Ubuntu bug status. My workaround is:

From gnome, switch to a console ctrl-alt-f1

to suspend to RAM: $ sudo pw-suspend

when it wakes up again with a dead back light, type: $ sudo vbetool post

(if you type the vbetool command before pw-suspend, it'll be in your bash history. Then you just need to push up, press enter then type your password to get the back light back on after a suspend to RAM).

"options dock immediate_undock=0" worked great in Hardy but no longer seems to work in Intrepid. See https://bugs.launchpad.net/ubuntu/+source/linux-meta/+bug/307801

Using the older 8.04 the VGA-out works well. You could plug in an external monitor and Fn-F7 to switch on VGA-out. It will auto-detect the external monitor, and change desktop resolution.--Dave abrahams 02:16, 14 December 2008 (CET)

However VGA-out does not work as well with 8.10. Currently it seems the X-server needs to be restarted after the external monitor is connected.

Also, the back-light-brightness applet does not work with 8.10, though hardware control still works.

edit: I wrote too soon. NetworkManager and suspend have reliability problems on the X40 in 8.10. Best to stick with 8.04 until these are fixed.

edit: I just did a fresh install of Intrepid Ibex on my Thinkpad X40 - a very similar system to the one on this page. Everything mentioned on this page works "out of the box." I can dock and undock, use the network manager, use the backlight applet, without needing any special fixes. I did not test VGA-out, since I don't use my laptop connected to an external monitor.

I enabled trackpoint scrolling by following the instructions on this blog:

http://psung.blogspot.com/2008/09/scrolling-with-thinkpads-trackpoint-in.html

I'd also like to note that the infamous Hard Drive Killer bug affects this laptop in Hardy, and is inherited by Intrepid when you upgrade. However, a FRESH Intrepid install does not appear to suffer from the Hard Drive Killer Bug.

In light of this, I respectfully disagree with the previous editor and suggest that if you want to install Ubuntu on a Thinkpad X40, 8.10 Intrepid is your safest and easiest bet. - Paganini