Introduction
On this page I have tried to document my experiences in running Linux (Mandrake) on an IBM ThinkPad R40. I dual-boot with Windows XP. My previous Linux experience is close to non-existent. I installed Mandrake 9.1 on my desktop but never really played around with the OS.
Mandrake works out of the box on the R40, but getting it to work the way you'd expect it to work consumes a fair amount of your time... I did not expect it to be a walk in the park - it has been, and continues to be, a great learning experience.
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.4.22-28mdk.
- Ethernet: yes
- WiFi: yes
- Modem: not tested
- USB 2.0: yes
- IEEE 1394: not tested
- PCMCIA: not tested
- Audio: yes
- APM: yes
- ACPI: no (battery indicator doesn't work)
- Suspend: yes
- Hibernation: not tested
- CD-R/CD-RW burning: yes
- DVD playback: not tested
- Advanced mouse features: not tested
- Printer: not tested
- 3D acceleration: yes
- S-Video: not tested
- External monitor: not tested
- IBM special keys: not tested
Linux installation
Originally, I started out with Mandrake 9.1. But I had problems getting DMA to work on the HD. Mandrake 9.2 was just released, so here are the installation details to get the system up and running. Additional tweaks are discussed later.
- The computer comes with Windows XP pre-loaded. When you first boot, XP is installed and configured.
- After the first boot:
- Disable Virtual Memory (Page File)
- Disable System Recovery
- Run Scandisk (My Computer, right-click on drive, Properties, Tools, Check Now..., check the boxes)
- Run Disk Defragmenter
- Resize NTFS (XP) partition with Partition Magic, I used 8 GB for the partition
- Convert NTFS to FAT32, this will help hibernation in Linux
- Do whatever Windows tweaks needed...
- Install Mandrake 9.2 from CD
- Keep the hidden IBM partition (with factory installation) and the XP partition. Partition rest of the drive as:
- / : 10 GB
- swap : 500 MB
- /home : 15 GB
- Select all the options for Workstation, plus KDE and Gnome. Add whatever packets needed...
- Enable firewall
- Select LILO and ACPI
- Keep the hidden IBM partition (with factory installation) and the XP partition. Partition rest of the drive as:
- Do the first boot to Linux
- In the LILO entry, append "acpi=off apm=on". Run LILO.
- Use the Mandrake Update to get the latest security and bug fixes, 170+ MB
- Make sure you download the source rpm for the kernel version you want (the one that comes with mandrake 9.2 is too old). http://www2.linuxforum.net/RPM/index.html is a good place to find the rpm you're looking for.
- Turn off the following services from starting at boot:
- acpi (apm works better) (this will also be addressed in Power management)
- pcmcia (otherwise KDE might crash after suspend)
- postfix
- Reboot
- Configure the work area as needed...
Power management
ACPI doesn't really work in the 2.4 kernel, so I'm using APM only. I experienced KDE crashes and computer lock-ups when resuming from suspend. After numerous experiments, it appears as if PCMCIA may have something to with it. To customize my suspend operations, this is what I did:
- In Mandrake Control Center, turn off the pcmcia service on boot
- In BIOS, turn off suspend when LCD is closed - I want to use my own script
- The kernel has to be recompiled. The following things are adjusted:
- Set CONFIG_APM_ALLOW_INTS to yes (by default it is not set), all other APM settings may keep their default settings
- Disable ACPI in the kernel
- Enable the Enhanced Speedstep feature (CONFIG_X86_SPEEDSTEP_CENTRINO) to better control the CPU frequency
- Disable APIC so that the computer completely turn off when powering down
- These are the related settings from my .config file:
CONFIG_APM=y
# CONFIG_APM_IGNORE_USER_SUSPED is not set
# CONFIG_APM_DO_ENABLE is not set
# CONFIG_APM_CPU_IDLE is not set
# CONFIG_APM_DISPLAY_BLANK is not set
CONFIG_APM_RTC_IS_GMT=y
CONFIG_APM_ALLOW_INTS=y
# CONFIG_APM_REAL_MODE_POWER_OFF is not set
# CONFIG_HOTPLUG_PCI_ACPI is not set
# CONFIG_ACPI is not set
CONFIG_ACPI_INITRD=y
CONFIG_X86_SPEEDSTEP_CENTRINO=y
# CONFIG_X86_UP_APIC is not set
- Use visudo (as root) to edit the file /etc/sudoers and add:
your_user_name ALL= /usr/bin/apm, /sbin/ifconfig
- Add a link on the desktop to the simple script below. The script turns off the WiFi connection (I experienced KDE crashes when I didn't) and then suspends the computer.
#!/bin/bash
sudo /sbin/ifconfig eth1 down
sudo /usr/bin/apm --suspend
WiFi
To get WiFi to work required some experimenting... I also had problem with the firewall - for some reason it wouldn't allow my WiFi connection to reach the internet. This is what I did to get the WiFi-card to work:
- It helps if the package wireless-tools is installed...
- Make sure the right firmware (5.00.03) is in the card, check the Cisco
web-site for the Linux supported firmware
- I had problems with the (higher) firmware (5.02.19) being automatically loaded whenever I booted to Windows. I renamed the file /WINDOWS/system32/drivers/pcx504b.img to something else (e.g., pcx504b.im_) and the "feature" went away...
- Download the airo_mpi driver
- In the file /etc/modules.conf add alias eth1 airo_mpi
Then I decided to not use DrakFirewall to set the rules for the firewall (it didn't work as I expected it to work...), instead I use my own script. After the card was working, this is what I did to get the connection up and running:
- Use DrakConnect to make sure that the LAN connection (eth0) and WiFi connection (eth1) are not started at boot
- Then create a script to setup the rules for iptables, I call the script create_iptables:
#!/bin/bash
# Delete existing rules
iptables --flush
iptables --delete-chain
# Create new rules
iptables -N netwk
iptables -A netwk -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A netwk -i eth1 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P INPUT DROP
iptables -A INPUT -j netwk
# Needed for KDE/Gnome
iptables -A INPUT -j ACCEPT -i lo
iptables -A OUTPUT -j ACCEPT -o lo
- With the firewall setup, create another script to bring up the WiFi connection:
#!/bin/bash
# Create the firewall
./create_iptables
# Bring up the device, eth0 for LAN
ifconfig eth1 up
# Select the network (not needed for LAN)
iwconfig eth1 essid 'your_network_id'
# Get and IP address
dhclient
# Show the information...
ifconfig
With this setup I can choose when to establish the connection, wireless or LAN.
Graphics
3D acceleration works "out of the box". I have installed the Mesa demos (gears, a.k.a. glxgears, is included in the regular installation) and I get the following results running the applications in full screen (1024x768):
- gears: 142 fps
- reflect: 41 fps
At the moment, these numbers are good enough for me. I do my gaming on my PS2...
KDE tweaks
- Configure the work area as needed...
Change log
- 02/28/04: Installed kernel 2.4.22-28mdk. Updated the Power management section.
- 01/16/04: Verified 3D acceleration performance. Updated the suspend script.
- 12/14/03: WiFi and the firewall work as desired.
- 12/05/03: Initial page.
Links
Here are some links I have found to be helpful or generally informative...
- Mandrake Linux
- TuxMobil
- Linux-Thinkpad mailing list
- Allin Cottrell's R40
- Eric Gourgoulhon's R40
- Robos' R31
- Richard O'Neill's A22p
- Stephan Fuhrmann's R31
- Bellet's T40
- Mandrake Linux Tips
- Garrick's Little Mandrake FAQ
Continue to my Linux FAQ.