Debian/Testing on IBM ThinkPad R40

Introduction

On this page I have tried to document my experiences in running Linux on an IBM ThinkPad R40. I dual-boot with Windows XP. My previous Linux experience is a relatively quick encounter with Mandrake 9.x. I've tried Mandrake 10.0 (Community), but APM suspend/resume crashed X/KDE for me, so I installed Debian/Testing (Sarge) instead.

If you are brand new to Linux you may want to stay away from Debian. If you are willing to do some tweaks, Debian is a nice distribution...

Computer hardware

The computer is a IBM ThinkPad R40, model 2722-3YU. The following hardware is installed:

What works and not

My current kernel is: 2.6.6-1-686 (recompiled).

Linux installation

If your R40 is brand new and you haven't booted into Windows yet, nor partitioned your hard-disk for Linux, please see my installation report on Mandrake 9.2. For the Debian installation I did not re-partition my drive, but I did format existing partitions. Don't forget to backup your data!!  Here are the installation details to get the system up and running. Additional tweaks are discussed later.

  1. Install Debian from CD. I downloaded the first three CDs (Sarge/Testing snapshot 2004-04-17)
    • My disk is partitioned as, they were re-formatted during installation:
      • / : 10 GB
      • swap : 500 MB
      • /home : 15 GB
    • Follow the installation-instructions, answer the questions carefully
    • Ethernet is not working during install, I fixed that later...
    • After the re-boot, when installing packages, the security update won't work because Ethernet is not working. The installation hangs. Press 'ctrl-c' and then 'enter', and reconfigure apt. Then install the packages, again the installer will hang, press 'ctrl-c' and then 'enter' to continue. Finally, each time it's looking for a new CD when installing the packages, the installation hangs. This happens because the CD-rom is not mounted. When this happens, press 'ctrl-c' and then 'enter'. This takes you back to the main installation menu. Choose to start a shell and type:
      mount /dev/hdc /cdrom
      exit
      You can then continue with the package-installation. Debian has a new installer in the pipe-line, and this problem will probably be fixed. I haven't tried later snapshots...
  2. Log-in to the new system and fix what's needed, and configure as desired...
    Note that neither Ethernet nor sound works from scratch.
  3. There are some packages you may want to get after installation:
    • sudo
    • vim
  4. After installing Debian it appears as if Windows has disappeared. Do not fear, Windows is here. We just need to make Linux aware of its existence.

Ethernet

Ethernet is not working during the install. What needs to be done is:

Now the network should come up automagically when booting. Without the above /etc/network/interfaces I experienced very slow startup time (think minutes) for Konqueror (and some other KDE applications) after I brought up the interface. It may have something to do with the loopback device.

Note: Now I have removed eth0 from the auto-line in /etc/network/interfaces. Instead I bring up the network using a macro (in case I boot the machine without Ethernet connected.)

On a side-note, I also added:

127.0.0.1 my_host_name my_user_name

to /etc/hosts, for which without I experienced an annoying "sudo: unable to lookup my_user_name via gethostbyname()"-message every time I used sudo.

Power management

ACPI
Don't use ACPI right now. I have had problems with ACPI not waking up after a suspend... The only way to restart the computer is to remove the battery. Therefore, I disable ACPI and use APM instead.

APM
APM works.

This is what I have done to make the power management work:

Note: The nolapic parameter allows the computer to completely turn off when powering down. The same effect can be achieved by not compiling Local APIC support into the kernel...

CPU frequency scaling
To conserve battery power, I am scaling the CPU frequency (automatically, based on need) using powernowd. This is what I had to do to get powernowd to work:

With APM it wouldn't work unless the options above were compiled into the kernel. With APCI it seemed to work even when they were modules.

Audio

When starting KDE, I got an error telling me that permission was denied for /dev/dsp. I have a sneaky suspicion that this is related to ALSA. The remedy is to add your user to the audio group in /etc/group. Also, do a chmod 666 to /dev/dsp?, /dev/audio?, and /dev/mixer?. Then in the KDE Sound System configuration, select Threaded OSS as the audio device...

Of course, the speakers on the laptop leave more to be desired...

WiFi

I haven't tested WiFi yet. In the meantime, check out my Mandrake 9.2 experiences.

Since I don't use WiFi at the moment, I don't want the annoying WiFi-led blinking. Therefore, I add airo to the /etc/hotplug/blacklist file so that the module is not loaded during boot.

Graphics/X

Framebuffer
I use the radeonfb framebuffer (as opposed to vesafb). Some people report that it messes up the screen and that there are some suspend/resume problems, but for me it works without any problems. One can choose the framebuffer with a stock kernel by using a boot parameter. I have recompiled the kernel with support for only radeonfb. In Grub I add vga=788 for 1024x768.

Starting X/KDM
For some reason, the Window Manager (in my case kdm) couldn't start during boot. I had to log in as a regular user in a text-console and do startx. The solution was to add mousedev in /etc/modules.

3D acceleration
3D acceleration does work "out of the box". Direct rendering is active. I get the following results running the glxgears application in full screen (1024x768):

At the moment, these numbers are good enough for me. I do my gaming on my PS2...

TrueType fonts
In order to get TrueType fonts in Linux, I copy the .ttf fonts from the Windows partition (/mnt/windows/windows/Fonts) and follow the instructions from the TrueType Fonts in Debian mini-HOWTO.

S-Video

By using the atitvout tool, I can connect the computer to a (PAL) TV. atitvout pal and atitvout -f t turns on the S-Video output and turns off the LCD. A resolution of 1024x768 works for me, although the resolution may have to be 800x600 for it to always work. atitvout -f l then turns off the S-Video output and the LCD goes back on.

After I have had the S-Video output activated, the LCD goes kind of whiteish. To fix that problem I have to change the resolution of the screen. xvidtune -next followed by xvidtune -prev fixes that.

CD-R/RW & DVD playback

CD-R/RW
Debian has a default mount-point for the CD-drive at /cdrom, I prefer /mnt/cdrom. This is what needs to be done in order to get the drive to work:

DVD playback
With the right tools, DVD playback works with any region coding, and NTSC as well as PAL. Here are the steps:

DVD+R and DVD+RW
I had to upgrade the firmware in the DVD-drive (GCC-4042N) in order for the drive to read certain (all?) DVD+R and DVD+RW discs (TDK and Sony). Here are the steps I took:

  1. From the IBM website I downloaded the correct file (after trial-and-error I found out that I needed fwdr1605.exe)
  2. On my desktop running WinXP (and with a floppy), I created the bootable floppy
  3. Following the steps at http://www.nu2.nu/bootcd I created I bootable CD with the extracted IBM files. (AFAIK: Nero's bootable CD option does not support extended memory - needed by the flash-program.)
  4. I booted my R40 with the newly created CD (using the emm386-option)
  5. I ran fw.exe, it said that my drive needed updated firmware (new version 0214), and it asked me to put the disk FWDR1605 into A:. The problem was that A: had the boot-image, and R: had my firmware files (as config'd by Bart the Boot CD guy)
  6. Instead I ran the file 42upi214.exe, which I figured out was the correct firmware
  7. Three minute later, and after a fresh re-boot, I could read DVD+R and DVD+RW... :)

Warning!! Upgrading the firmware may ruin your drive. Know what you are doing.

USB

To add USB memory support:

Suspend/resume
USB has a tendency to freak out when performing a suspend/resume cycle, especially the ehci_hcd module (USB 2.0). The solution is to unload the module during suspend, and reload the module when resuming. The following script (originally created by Dimitris Kogias) should be placed in /etc/apm/scripts.d/

#!/bin/sh
MODPROBE=/sbin/modprobe
[ -x "${MODPROBE}" ] || exit 0
case "${1},${2}" in
(suspend,*)
    ${MODPROBE} -r ehci-hcd
    ${MODPROBE} -r uhci-hcd
    /bin/sleep 2s
    ;;
(resume,suspend)
    ${MODPROBE} uhci-hcd
    ${MODPROBE} ehci-hcd
    /bin/sleep 2s
    ;;
esac
exit 0

I also unload/load the uhci_hcd module (USB 1.1) just to be safe... Then create symbolic links in /etc/apm/suspend.d/ and /etc/apm/resume.d/ to the script in /etc/apm/scripts.d/

Special keys

All keys haven't been tested, but these work:

Warning! Fn-F3 turns the screen black, and stays black until you turn off the power...

Booting and Windows

Booting
By examining the messages that flies on the screen when booting up the system, I noticed two "Fatal" messages: ide-detect and hw_random could not be found. I solve this by commenting out ide-detect in /etc/modules, and to list hw_random in /etc/hotplug/blacklist.

The hw_random message can also be avoided by not compiling support for the Intel Hardware Random Number Generator (RNG) (under device drivers/character devices). According to this web-page, the Intel chipset does not have the RNG - despite what Intel says...

And suddenly another "Fatal" message popped up: ehci_hcd, even though the module is loaded once the boot-process is completed. It's under investigation...

"Enable" Windows
Unless something went seriously wrong during the installation, Windows is still there in its partition. We want to do two things: be able to boot into Windows, and mount the Windows partition to the Linux file system.

To do

These are things next on my list that I need to work on. Roughly ordered in priority.

Change log

Links

Here are some links I have found to be helpful or generally informative...

Continue to my Linux FAQ.