Linux on an IBM ThinkPad R52

The Setup

Debian GNU/Linux (3.1 "Sarge")  

Table of Content

Installation

Predesktop Area

Nasty. IBM stores the recovery image for Windows XP there. Windows itself is dumb enough to believe the BIOS that the Harddisk is several GB smaller than it's actual size. Linux checks this itself and will tell you something like "The BIOS claims some hidden area. Enableing it...". So: if you want to preserve it take care that you do not touch it while paritioning with Linux fdisk.
You can switch the status of the predesktop area in the ThinkPad BIOS which can be entered most easily by holding down F1 while powering on the notebook.

DOS XP (aka: Windows XP "Professional")

Seems to work "as designed", whatever this means. Didn't play with it much.
There are some choices to get rid of it: If you want to preserve the predesktop area and keep your windows for whatever reason the easiest way is to fire up a knoppix CD (at best to runlevel 2 by issuing knoppix 2 at the lilo prompt, otherwise it starts up KDE :( and use GNU's parted. You will notice the predesktop area as a second primary partition at the end of the harddisk. From this you will also want to note and write this down:
/dev/hda1: Windows XP (preinstalled)
/dev/hda2: System recovery (preinstalled)
Notice this to not confuse your hard disks by accident. Lilo happily installs itself into the boot record of /dev/hda2. (Don't know if IBM intended this feature ;)

Installing Linux

The elaborated report can be found from my installation of a T41p. This setup is heavily based upon the T-Model and here only the differences should be described.
NOTE: I'm very happy with my T-series. Do not think I replaced it with the R52. The R52 is from a very good friend of mine, whom I coud not pursuade to get a T-Series (mainly cause of the pricing region of thes models). I just wanted to share my experiences here, and still recommend to get the T if you can afford it. Though the R52 is a pretty nice box I admit.

Differences to T41p

First suprise: The R52 uses a SATA harddisk! Though a cool feature as such, Sarges installer does not really like it if you choose the 2.6-series kernel. You have to do the base install using the default (aka 2.4) kernel. (Guess why this is the default kernel? ;) If you don't obey this, have fun when the debian installer asks you if you have a hard disk built into the box...
Meanwile I also found the reason... 2.6.8.1 used by Debian Sarge is just "to old" for the SATA-Chipset built into this box. This box requires a 2.6.13.1 or higher kernel. I admit that this is to me a bit to colose to the bleeding edge. Using 2.6.13.4 in my case works well though.
Additionally this disk caused me a lot of headache... Beeing a friend of XFS for some years now of course I configures all hard drives using XFS for the first time not setting asside some MB's for /boot. Actually I learned that there are sometimes some reasons to stick to old habits. There seems to be an issue of using grub with XFS-formatted boot partitions at least on this box and/or with Debian. So after quite some fiddling arround I just did as in the old days and used some MB's as /boot formated as ext3. grub is happy, booting works and no longer fiddling arround with lilo.
Actually the grub-problem arrose because the new Debain-Installer is a bit to fancy: It knows that grub will not work in the xfs-only-setup and as a consequence it installs lilo but this does not prevent you from aptitude install grub. And there no warning is issued at all. (Actually I'm pretty sure that I used grub to boot xfs on some RedHat boxes, installed with sgi's setup-cd. And of course I use the xfs-only-setup on my T-model.)
Note: Exactly the same xfs-only-setup I tried on the R52 works like a charm on my T41p using a PATA harddisk.

The Kernel

Sake to the SATA-Issue with the harddisk this machine requires a kernel newer than 2.6.13. Oder kernels will use the harddrive in PATA-Mode. Concerning this issue I found A. Cottrell's SATA page very enlightening. Following his advice I also patched include/linux/libata.h and replaced
#undef ATA_ENABLE_ATAPI         /* define to enable ATAPI support */
#undef ATA_ENABLE_PATA          /* define to enable PATA support in some
                                 * low-level drivers */
with
#define ATA_ENABLE_ATAPI        /* define to enable ATAPI support */
#define ATA_ENABLE_PATA         /* define to enable PATA support in some
                                 * low-level drivers */
as well as adding the necessary kernel parameters. The current kernel config for 2.6.13.4 includes these parameters.

SpeedStep

Using ACPI, cpufreqd and the userspace govenour works well, but with the .config for 2.6.13.4 one has to load the acpi-cpufreq-module via /etc/modules first. Otherwise cpufreqd will not find an interface to talk to.
From 2.6.9 onwards one could also use the ondemand govenour and drop cpufreqd. But I did not test this and I want some control about the frequencies used. (Manly to step down the machine to its bare minimum for allmost all the time.)

Additional Components

XFree86 aka x.org

Actually this section should be renamed but I kept the name for compatibility. It's XFree86 own responsibility that every major distribution will drop it. So did I...
Installing x.org's version 6.8.2 from Debian Testing (aka Etch) did the trick and works fine. Though it complains about "no graphics card". Select ati and that's it: it even automagically selects the 1400x1050 resolution as a default, writes a correct xorg.conf and there you go.

Wireless LAN

As the notebook is a Centrino-Machie it uses an Intel Wireless Card. As parts of the code are not GPL and not available in source the card is not supported by a vanilla kernel as such, though the README's say that it will from 2.6.14 upwards. Anyway, the source for the driver can be found on Sourceforges ipw2200 project, where one has also to download a valid firmware (the real binary part). Additionally they found it convenient to split the drivers source into two parts so one has to get also the IEEE 802.11 source code. Putting all together the built of the driver is "straight forward", following the readmes. First unpack all the new packages, move the firmware (all files *.fw) to /usr/lib/hotplug/firmware/. Then one needs to build the IEEE 802.11 part of the driver. Change to it's directory and just issue
	make; make install

In case it finds an older header it complains about and asks for removal. After the installation of the IEEE 802.11-module one can build the IPW 2200-driver with the same procedure: change to it's directory, issue
	make; make install

NOTE:
Though kernel 2.6.14 comes with built in support for ipw2200 this does NOT work with the adaptor built into the R52, one has to use the latest code mentioned above.

Switch WiFi/Ethernet


To switch easily from wifi to cable and back a simple lan (centrino-edition) script which does the loading/unloading of the modules and brings up the interfaces. This script was initially invented for my T-model but needes quite some adoptions for the Centrino-chipset installed in the R-mode. For no appearant reason I was not able to blacklist the ipw2200-modules to prevent hotplug from loading (I am still convinced that hotplug should keep it's hands off my lan-configuration...) and additionally the centrino-modules think it is a good idea to grab for eth-interface names. For that reason ipwrename is used to rename ethernet as well as wifi-interfaces. For "historic" reasons the wlan-interface is called ath0 (like on my T), the internal lan is named lan0. For that reason /etc/network/interfaces needs some adoption as well.