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:
- Processor: Intel Pentium M 1.3GHz
- Memory: 256 MB
- HD: 40 GB
- Drive: CD-RW/DVD-ROM (HL-DT-ST RW/DVD GCC-4240N)
- Screen: 14.1 XGA (1024x768) TFT LCD
- Graphics: ATI Radeon 7500
- WiFi: Cisco Aironet 350 Mini PCI
- Modem
- Ethernet
- IEEE 1394
- USB 2.0
- Audio chipset: SoundMAX
- Pre-installed OS: Windows XP Home
What works and not
My current kernel is: 2.6.6-1-686 (recompiled).
- Ethernet: yes
- WiFi: not tested
- Modem: not tested
- USB 2.0: yes
- IEEE 1394: not tested
- PCMCIA: not tested
- Audio: yes
- APM: yes
- ACPI: no
- Suspend: yes (APM) / not tested (ACPI)
- Hibernation: not tested
- CD-R/RW burning: yes
- DVD playback: yes
- Advanced mouse features: not tested
- Printer: not tested
- 3D acceleration: yes
- S-Video: yes
- External monitor: not tested
- Special keys: not fully tested
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.
- 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
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...
exit
- My disk is partitioned as, they were re-formatted during installation:
- Log-in to the new system and fix what's needed, and configure as desired...
Note that neither Ethernet nor sound works from scratch. - There are some packages you may want to get after installation:
- sudo
- vim
- 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:
- Add:
alias eth0 e100
to the file /etc/modutils/aliases. In /etc/modules you also want to add e100 - In the file /etc/network/interfaces, add
auto lo eth0
iface lo inet loopback
iface eth0 inet dhcp
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:
- In BIOS, turn off suspend when LCD is closed - I want to use my own script
- The kernel doesn't have to be recompiled.
- Download a 2.6 kernel
- In Grub, add acpi=off apm=on nolapic
- Use visudo (as root) to edit the file /etc/sudoers and add:
your_user_name ALL= /usr/bin/apm
- Add a link on the desktop to the simple script below.
#!/bin/bash
sudo /usr/bin/apm --suspend
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:
- In /etc/fstab add sysfs /sys sysfs /defaults 0 0, if it's not there already.
- I recompiled the kernel with the following options (under Power management
options, CPU Frequency scaling):
- Default CPU Freq governor set to performance
- 'powersave' governor as a module
- 'userspace' governor for userspace frequency scaling into the kernel
- CPU frequency table helpers into the kernel
- Intel Enhanced SpeedStep into the kernel
- Install the powernowd package.
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):
- gears: 143 fps
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:
- mkdir /mnt/cdrom
- Add the following line to /etc/fstab
/dev/cdrom /mnt/cdrom iso9660 defaults,ro,user,noauto 0 0
- A user can then mount the CD-drive by:
mount /mnt/cdrom
- To burn CD-R/RWs, download the package k3b (and its dependencies). The drive can write at 24x, and re-write at 10x.
DVD playback
With the right tools, DVD playback works with any region coding, and NTSC as
well as PAL. Here are the steps:
- For convenience, type
ln -s /dev/cdrom /dev/dvd
(most DVD players use /dev/dvd as the default DVD location - Install a DVD player, e.g., ogle
- Install the libdvdcss-package (not part of the maintained Debian packages, search for it.)
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:
- From the IBM website I downloaded the correct file (after trial-and-error I found out that I needed fwdr1605.exe)
- On my desktop running WinXP (and with a floppy), I created the bootable floppy
- 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.)
- I booted my R40 with the newly created CD (using the emm386-option)
- 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)
- Instead I ran the file 42upi214.exe, which I figured out was the correct firmware
- 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:
- To mount the USB memory to the Linux file system, the directory must be created (if it doesn't exist already)
mkdir /mnt/usbmem
- In /etc/modules you also want to add usb-storage
- Then we tell Linux to mount the partition during boot by adding the following line to /etc/fstab
/dev/sda1 /mnt/usbmem vfat user,noauto 0 0
- A user can then mount the USB memory by:
mount /mnt/usbmem
Don't forget to un-mount (umount /mnt/usbmem) the device before removing it.
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:
- Volume/mute keys
- Fn-Home/End to change screen brightness
- Fn-PgUp to turn on/off the slick keyboard light
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.
- Grub is the default boot-loader. To get Windows as an option in the
boot-menu, add the following to the /boot/etc/menu.lst file, at the very end, after the Debian
automagic section:
title Windows XP
root (hd0,0)
makeactive
chainloader +1 - To mount the Windows partition to the Linux file system, the directory must be created (if it doesn't exist already)
mkdir /mnt/windows
Then we tell Linux to mount the partition during boot by adding the following line to /etc/fstab
(Taken from the Mandrake configuration)
/dev/hda1 /mnt/windows vfat umask=0,iocharset=iso8859-1,codepage=850 0 0
To do
These are things next on my list that I need to work on. Roughly ordered in priority.
- Get WiFi up and running
- Get all Thinkpad keys to work
- Get ACPI to work. Suspend-to-RAM for ACPI appears to be working for some.
- Investigate to see if this ATI Radeon driver works better than the standard, or just wait for X.org...
- Modem
- Hibernation
- Other stuff...
Change log
- 09/29/04: Fixed S-Video.
- 08/31/04: Fixed USB-suspend issues.
- 08/30/04: Erased and burned a CD-RW. Got DVD playback up and running. Added steps for DVD firmware upgrade.
- 08/29/04: Fixed CPU frequency scaling.
- 08/27/04: Added framebuffer and booting details.
- 06/26/04: Fixed my KDM-won't-load-at-boot problem. Installed TrueType fonts.
- 05/11/04: Re-install. Various updates, especially Audio and Graphics.
- 04/27/04: Updated CD burning.
- 04/26/04: Initial page.
Links
Here are some links I have found to be helpful or generally informative...
- Debian GNU/Linux
- TuxMobil
- Linux-Thinkpad mailing list
- Allin Cottrell's R40
- Robos' R31
- Richard O'Neill's A22p
- Bellet's T40
- Nat Makarevitch's X31
- Debian Problems and Solutions
- LinuxQuestions.org's Debian forum
- debianHELP
- Debianplaza
Continue to my Linux FAQ.