Gentoo Linux on the IBM Thinkpad R40
Before you start
Don't boot the computer into windows. The Thinkpad comes preinstalled with Windows XP. The XP partition uses all of the available disk, which is incompatible with running Linux on dual boot. It's necessary to resize it. Before the first boot, the partition is a FAT32 partition, and will be converted to NTFS on the first windows boot. FAT is a much more documented filesystem than NTFS, so resizing tools are much more stable.
In case you did boot the first time, press the "Access IBM" button on startup, and select "Recover to factory contents". When the recovery software asks for a reboot, do a hard reboot (power-off and then power-on), so the "Access IBM" button gets re-enabled, and then proceed to the next step.
If you already have windows installed, and don't want to bork the install, have a look at NTFS resizing tools, like ntfsresize or QTParted. Most of these tools are less than perfect, so backup backup backup. You have been warned!
Boot into the Gentoo LiveCD
Get and burn the Gentoo install CD you wish to use. Follow the Gentoo Installation Handbook for choosing one. To boot from the CD, press the "Access IBM" blue button when the IBM logo appears. Select "Startup" and then the CD-ROM as your boot device.
Install Gentoo as usual
Follow the Gentoo install procedure. When it comes to defining your partitions, use parted to reduce the FAT32 partition. Then proceed as the manual tells you to.
If the FAT32 partition is too small, the "Recover to factory contents" procedure won't work in the future. I set mine to 12GB. It should work with a 10GB partition [1]. The "Recover to factory contents" won't touch your Gentoo install, except for overwriting the Master Boot Record. If you do run the procedure, you'll need to reinstall the Linux bootloader (usually grub).
The command to resize the partition with parted is:
parted /dev/hda resize 1 0.031 12000
Gentoo fails detection of the eepro100 ethernet card. It finds the firewire interface and assumes one interface is all you need. Just run:
modprobe eepro100
net-setup eth1
When setting up grub, remember centrinos don't have floppies. It's quicker to pass --no-floppy to grub, to avoid waiting for auto-detection to fail. From then on, follow the handbook's instructions
Major compilation step ahead
After finishing the handbook, you should have a basic console based linux system. This is a desktop machine, so we're far from done with. Go for a full emerge (overnight ;-):emerge vim xfree windowmaker \\plug the power cord in, and go to sleep.
gnome kde openoffice-bin \\
mozilla-firefox mozilla-thunderbird \\
eterm gaim tuxracer freeciv grip \\
xmms xine gimp
Major compilation step ahead
Wake up. Refreshed, go on configuring your fresh new Gentoo system.Grab my /etc/X11/XF86Config-4. You may need to fiddle with the resolution (there are 1024x768 and 1400x1050 R40 variants). Use xf86cfg to edit the config.
Set DISPLAYMANAGER to gdm in /etc/rc.conf
Add xdm to the default runlevel:
rc-update add xfs default
rc-update add xdm default
/etc/init.d/xdm start
Login as root, naturally select Windowmaker as the window manager. You should have a really usable linux system by now. Office tools, multimedia tools and internet access. Now, for the specific laptop hardware.Centrino Wireless Drivers
To get the Centrino Wireless card working, I used the Intel drivers[6]. These are still under development, but I preferred this solution to using windows drivers over an adaptation layer (ndiswrapper). They work flawlessly. I was unable to install using the ebuilds in portage. However, it's rather easy building from source. The only obstacle I found is that with newer 2.6 series kernels, you have to configure at least one module, so that /usr/src/linux/Module.symvers gets built (if you used my .config above, don't worry about it).After getting the drivers built, just insert the ipw2100 kernel module. You now have a second ethernet card (eth1). Configure it as indicated in the Gentoo Installation Handbook.
APM hibernation
I opted for APM instead of ACPI, since I've found lots of reports of flakiness of ACPI on Thinkpads. APM seems to work rather well. APM hibernation to RAM works out of the box (Fn-F4). There are a couple of driver issues:The USB mouse is unresponsive after resume. This is an X problem, since the /dev/input/mouse3 produces output when moving the mouse. Two workarounds: either unplug the mouse before suspending, or switch between virtual terminals after resuming. One more automatic solution could be installing apmd, have USB compiled as a module, and forcefully remove the module and reinsert it on resume. I may look into this option.
I haven't even tried to get hibernation to disk, but it's reported as feasible [4].
IrDA communication with my Nokia 6100
Winmodem
I don't have a need for the modem, so I haven't set it up. Instructions are here:http://www-306.ibm.com/pc/support/site.wss/document.do?lndocid=MIGR-52698
References
References:[1] Redhat 9 on an IBM Thinkpad G40, http://www.haviker.co.uk/tp/ , Dec 2003, Kieran
[2] http://www.gentoo.org/doc/en/gentoo-x86-quickinstall.xml
[3] Linux on the IBM ThinkPad R40 laptop, http://www.luth.obspm.fr/~luthier/gourgoulhon/ThinkPad/ , Eric Gourgoulhon
[4] Linux on the IBM R40 2722-GDG, http://www.enseeiht.fr/~queinnec/ibm-r40.html , Philippe Queinnec
[5] Software and Device Drivers - ThinkPad R40, R40e, http://www-3.ibm.com/pc/support/site.wss/document.do?lndocid=MIGR-46024#INF
[6] Intel PRO/Wireless 2100 Driver for Linux, http://ipw2100.sourceforge.net/
[7] http://bugzilla.kernel.org/show_bug.cgi?id=1415


For anyone who\\s having trouble with it, emerge synaptics, read the documentation and you\\ll have it going in no time :) (Comment this)
There were two things I thought Id mention, because you brought them up in your writeup. ACPI under the current default installation seems to work nicely with Gentoo on this box, though YMMV. I did manage to get suspend to disk working fairly painlessly, though you want to make sure youre using a journalling filesystem if youre going to play with it.
There are wikis out about it, but essentially the 2.6 series kernels include a "Software Suspend" option under the ACPI config. This basically backs up the current system memory to a swap partition that you specify. There is a second option that you can use to configure which partition you want to use by default, or it can be passed as a kernel boot parameter. Everything works nicely, though I have had some issues with the clock de-synching (which should be fixable with a quick script when I get around to it).
A word of warning though: if you *do* have problems with it, instead of resuming from the swap you will end up with a normal boot as if you had just cut the power (which is bad without a journalling filesystem), and you will need to re mkswap.
I was also wondering if you have had much luck with the IRDA port? Ideally Id like to use it to sync my older palm, so I suppose thats IRTTY.
Thanks,
Brendan Smithyman (Comment this)