Gentoo Linux on the Thinkpad T60p

Lenovo Thinkpad T60p (left) and Thinkpad T42p (right) running Gentoo Linux

I recently upgraded my Thinkpad T42p for a T60p. The T42p was running Gentoo Linux and I was very happy with that, so I planned on installing Gentoo on the T60p as well. Since the T60p was fairly new and there weren't many guides, I decided to do some research and write down some of the issues I had.

Here are some quick specs for the T60p:

  • 2Ghz Intel Core Duo processor T2500 (Centrino)
  • 2Gbytes DDR2 SDRAM
  • 100Gbytes SATA 7200rpm Harddrive (hdparm was claiming about 50Mbytes/sec)
  • 15inch 1600x1200 LCD display
  • ATI Mobility FireGL V5200 (dual head capable)
  • Ultrabay Slim with DVD recordable x24
  • Integrated Intel PRO/1000 Gigabit Ethernet
  • Intel PRO/Wireless 3945ABG 802.11a/b/g
  • Intel High Definition Audio

The PCI/PCI Express bus:

00:00.0 Host bridge: Intel Corporation Mobile 945GM/PM/GMS/940GML and 945GT Express Memory Controller Hub (rev 03)
00:01.0 PCI bridge: Intel Corporation Mobile 945GM/PM/GMS/940GML and 945GT Express PCI Express Root Port (rev 03)
00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 02)
00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 02)
00:1c.1 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 2 (rev 02)
00:1c.2 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 3 (rev 02)
00:1c.3 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 4 (rev 02)
00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI #1 (rev 02)
00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI #2 (rev 02)
00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI #3 (rev 02)
00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI #4 (rev 02)
00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 02)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e2)
00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge (rev 02)
00:1f.1 IDE interface: Intel Corporation 82801G (ICH7 Family) IDE Controller (rev 02)
00:1f.2 SATA controller: Intel Corporation 82801GBM/GHM (ICH7 Family) Serial ATA Storage Controller AHCI (rev 02)
00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 02)
01:00.0 VGA compatible controller: ATI Technologies Inc Unknown device 71c4
02:00.0 Ethernet controller: Intel Corporation 82573L Gigabit Ethernet Controller
03:00.0 Network controller: Intel Corporation Unknown device 4227 (rev 02)
15:00.0 CardBus bridge: Texas Instruments PCI1510 PC card Cardbus Controller



Install Gentoo from CD

I used the latest Gentoo iso that I had laying around, the 2006.0 x86 LiveCD. I opened the laptop, plugged it in, turned it on, and put the CD in the DVD/CD-RW. About 20 seconds later, the boot: prompt came up.

boot: gentoo doscsi

The doscsi flag was more just me being paranoid, knowing that the T60p uses Serial ATA and libata adds those as scsi devices. You can probably do without it, I never bothered as I only went through this process once. When the liveCD booted and X started up, I clicked on the graphical install wizard, and went with mostly all the default (or recommended) options. I always resync, recompile, and reconfigure after this step anyways. I chose an all GRP install (networkless) since that allows me to get past this step the quickest and used the liveCD kernel (no sources). One thing that I noticed right away about the wired ethernet (e1000 driver) is that if I don't setup the eth0 device in the install wizard, the device never gets bound. I've also read in other places some minor issues with the Intel Corporation 82573L Gigabit Ethernet Controller like it getting dropped or the device not getting bound after the e1000 module gets loaded. Other than configuring eth0 and saving, I went straight through the install then a reboot sans LiveCD.



Booting off the harddrive

I want to get to this point of the installation as quick as possible, since if things break here, then you've got serious issues. Otherwise, you're mostly smooth sailing with the exception of the few iffy drivers (ipw3945, fingerprint reader, ATI FireGL V5200).

Since the liveCD kernel doesn't come with sources, I need to emerge them. I wanted the most recent sources so I did a sync first:

# emerge --sync

Then I choose gentoo-sources (with the ibm stuff), and also chose this time to update genkernel and portage:

# emerge portage genkernel
# USE="ibm" emerge gentoo-sources

The next thing, configure my kernel. The liveCD kernel is genkernel'ed, so I'll just stick with that (although with udev in and coldplug out, there's no reason to use genkernel anymore):

# genkernel --menuconfig all

Here is my kernel .config file, I mainly just turned the majority of the random drivers on or made them into modules. I also turned on all the Bluetooth subsystem and the drivers (bluetooth), kismet, SYN Cookies and netfilter/iptables since I use that stuff. Another thing you may want to consider turning off is the Direct Rendering Manager, as I read the ati drivers won't jive with it. I also used the kernel ALSA drivers for sound. Turn on ALSA support, and turn on Intel High Definition Audio if you want to use the kernel drivers, otherwise just turn on ALSA support (and you'll need to emerge alsa later). After the kernel and modules are finished compiling, update your boot loader (I used grub, and here is my grub.conf). Remember that your drive will be /dev/sda because of SATA.

UPDATE: I'm using the 2.6.19 kernel now and the newest ipw3945 drivers no longer requires you to remove the kernel ieee802.11 stuff. I also updated the kernel config file for the 2.6.19-r5 kernel. The SATA drivers are now built into the kernel so make sure to turn them on as well as Inotify (should be on by default) so that udev (replaces coldplug) can automatically keep the /dev nodes up to date.

UPDATE (8/29/2007): I'm now using the 2.6.22-r5 kernel and enabled all of the powersavings, ACPI, and timers in the debugging (in order to use powertop). After re-emerging drivers (ati-drivers, ipw3945, and alsa-drivers if you don't use the kernel ones), everything worked as expected. The wireless options had moved and there were several new options for IrD and Bluetooth that I enabled for kicks. I also enabled the NTFS and FAT filesystem because some digital cameras use them. Here is my kernel .config file.



Installing drivers and software

At this point, you're going to need a network. If you configured eth0 (e1000 wired ethernet), net.eth0 should be started automatically. Before you start emerging stuff, make sure you setup your USE flags. Here is my make.conf file, and you can see my USE flags.

After that, I wanted to get off the wire and get on my wireless, so I did the following:

# emerge ipw3945 ipw3945d wireless-tools

I choose to use wireless-tools instead of wpa_supplicant, since I already have the /etc/conf.d/wireless file from my old laptop. Here's a link to gentoo's wireless How-To, it walks you through both iwconfig and wpa_supplicant. I then created a net.eth1 and added it using rc-update:

# cd /etc/init.d
# ln -s net.lo net.eth1
# rc-update add net.eth1 default

Then I reboot just for safe measure, remembering to remove the ethernet cable from the laptop. Coldplug automatically found my wireless so I didn't need to add that to the modules.autoload.d list. The ipw3945 driver is still a little flakey. Currently, I have issues from time to time when I bring down eth1 (802.11 wireless) and bring it back up (usually on a different network). The 802.11 a/b/g LED flickers really fast and it hangs on * Configuring wireless network for eth1 for a little while before failing. /var/log/messages reports: ADDRCONF(NETDEV_UP): eth1: link is not ready, which doesn't seem that unusual (it reports that even if bringing up eth1 doesn't fail). I have a dodgy work around for this when I don't feel like restarting the machine: shutdown ipw3945d, get rid of the ipw3945 and the ieee80211 modules, and reinsert them. (Note: These directions don't quite work for the newest versions of the gentoo portage tree and the ipw3945 driver, see the UPDATE at the bottom)

# ipw3945d --kill
# rmmod -f ipw3945
# rmmod ieee80211_crypt_wep
# rmmod ieee80211
# rmmod ieee80211_crypt
# modprobe ipw3945
# /etc/init.d/net.eth1 start

We need to first shutdown ipw3945d properly using the --kill flag. Then we need to force remove the ipw3945 module, this is probably unadvisable, but it's being used by kernel processes (nice=-5) and this is the only way to get rid of both the processes and the module. You can then remove the other 802.11 modules and reinsert ipw3945. This will bring up ipw3945d as well as the other 802.11 modules and I'm able to start net.eth1 without any problems.

UPDATE: I recently discovered the purpose of the little switch next to the IR port is for (I usually don't read manuals). In case you didn't know already, this turns on/off wireless. It also happens that when I turn it off, /etc/init.d/net.eth1 (my 802.11 interface) stops automatically, and when I turn it on, it starts automatically. This completely alleviated the issue of the device hanging on startup. I'm uncertain what packages/modules I installed for that to work, but if that requires a module, it should be thinkpad and/or ibm-acpi. So now, I never issue a start/stop to my wireless device anymore, and instead, just use this handy little switch.

UPDATE: The script above doesn't really work anymore in the more recent versions of the ipw3945 driver. The ipw3945d daemon is now started using an rc script. It's still a little finicky when starting up and connecting to an AP, but the worst case is to stop the daemon, make sure the ipw3945 module is unloaded, then restart the daemon using the rc script. This doesn't work 100%, and it kinda sucks.

UPDATE: But it seems the most recent ipw3945 daemon fixes this problem. So this was what I ended up having to do: Firstly, remove net.eth1, ntp-client, ntpd, sshd, and whatever network services you have automatically startup using rc-update. The only thing you need is to make sure /etc/conf.d/net (all the wireless config got moved to this file, so you no longer need to fiddle with /etc/conf.d/wireless) is setup correctly and that ipw3945d is started. The daemon seems to take care of bringing wireless up when one of my APs I have configured in /etc/conf.d/net is in range. As for the network services, I added this to the end of my /etc/conf.d/net:

postup () {
/etc/init.d/ntp-client restart
/etc/init.d/ntpd restart
/etc/init.d/sshd restart
return 0

So now whenever I plug my ethernet cable into the jack or if I get in range of my AP, my network services automatically get started. You will need to make sure udev has the persistent-net rules setup for your ipw3945 device, otherwise it won't come up automatically. I have this in my /etc/udev/rules.d/70-persistent-net.rules file:

# PCI device 0x8086:0x4227 (ipw3945)
SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="[your MAC address]", NAME="eth1"

I wanted my laptop to have all the things my old laptop had, so I just took the world and emerged everything all in one go. Here is my world file as well as an equery list. I took the /var/lib/portage/world file from my old laptop, removed the Thinkpad T42p specific drivers (like ipw2200) from the list, and renamed it old_world. My emerge command looked like this:

# emerge --update `grep -v '^ ' old_world | sed -e s/'\-[0-9].*'/""/g`
# emerge --update world

This removes all the random non-package lines (-v '^ ') and removes the version info at the end of each package (s/'\-[0-9].*'/""/g). The second emerge command makes sure the stuff that wasn't part of my old_world gets updated as well. I didn't run into any problems except for a few packages that got pruned out of the dep tree (just emerge --unmerge them) and the change in the name that slocate uses. You can add a -vp to check for the former.

Now that I have nearly everything installed and my new T60p is a spitting image of my old T42p, I'll bring up a few random things:

  • I prefer's implementation over openssh's. That's as simple as unmerging openssh and emerging net-misc/ssh.
  • I emerged all the bluez and gnome-bluetooth stuff, although I'm not sure if the bluez stuff is needed
  • If you didn't compile ALSA drivers into the kernel, emerge alsa-driver and stuff, then rc-update add alsasound default
  • You may also want to emerge thinkpad and tpctl (and most likely acpitool so that hotplugging works for thinkpad specific stuff)
  • I emerged ati-drivers, but the version that I got (8.21.7-r1) isn't one that works with this graphics card

UPDATE: As of a few months ago,'s license for versions after 3.9.2 no longer fall under the 'free for non-commercial use' agreement. Therefore, gentoo has masked it and we'll all have to use openssh now. Recently another ebuild was added into portage that may be use for thinkpad users. The tpb package allows you to bind commands to miscellaneous buttons on your thinkpad. You may want to emerge that as well.

UPDATE (8/18/2009): I was required to upgrade my kernel due to getting DRM to work under xorg-server with the open source ati drivers. This inadvertantly broke wireless. In order to fix this, you'll want to first put yourself on a wired connection, remove all the ipw3945 packages (remember to remove the daemon from the default runlevel:

# emerge -C ipw3945 ipw3945d ipw3945-ucode
# rc-update del ipw3945d

Then you need to install the iwl3945 microcode:

# emerge -v iwl3945-ucode

Then, you need to make some changes to your kernel. The gentoo-wiki has a good guide for you to follow. It's relatively painless and you can't really go wrong. After you've gotten that setup, there will be some changes. Your wireless adapter will no longer show up as eth1, but as wlan0 instead. You'll need to make all the appropriate changes (all eth1 to wlan0) to your /etc/conf.d/net, /etc/conf.d/wireless, and/or /etc/wpa-supplicant/wpa-supplicant.conf depending on whether you use wpa-supplicant or wireless-tools. You then need to create a net.wlan0 rc script:

# cd /etc/init.d
# ln -s net.lo net.wlan0

And you may or may not need to add that to the default runlevel. Mine starts automatically, but for some people the wired interface gets auto started, or none at all. After that, it should work like it did before. I didn't need to make any other changes and both wireless-tools and wpa-supplicant worked fine.



Fingerprint Reader

This was one thing that I really wanted to get working. There's this fingerprint reader siting just below the keyboard and it would suck if I wasn't able to use it. This took a bit of trial and error, but you want to start here: There are 3 ebuilds here that you want from there and they're located in the overlay URL under sys-auth: sys-auth/bioapi, sys-auth/tfm-fingerprint, and sys-auth/pam_bioapi. You can read up on the Gentoo 3rd party ebuilds How-To if you want, but basically you want to stick these in your /usr/local/portage/sys-auth/ directory. Once you have everything it should look like this:


Before you emerge these 3 ebuilds, the bioapi package NEEDS the qt USE flag. There are 2 versions of the program that creates the fingerprint file, a graphical version (QSample) and a command line version (Sample, but (as of 6/11/2006) the command line version doesn't allow you to enroll a fingerprint. In order to get the graphical version, you need qt. So this is what I did:

# USE="qt" emerge sys-auth/bioapi sys-auth/pam_bioapi sys-auth/tfm-fingerprint

You can pretty much follow the directions on the website from here on. Everything works as advertised. You may need to play around with /etc/pam.d/xscreensaver a bit in order to get that working to your satisfaction. I created a /etc/pam.d/bioapi:

auth required
auth sufficient likeauth nullok
auth sufficient {5550454b-2054-464d-2f45-535320425350} /etc/bioapi/pam/
auth required
account required
session required
session required

and added an include in the xscreensaver pam.d file. Consult the pam.d man page for more options.

UPDATE: There's a new ebuild in the portage tree that's a different implementation of the fingerprint reader than this one called sys-auth/thinkfinger. It also provides a pam module that you can include in services you want to be able to authenticate with a fingerprint. This one doesn't require the qt package and having both the bioapi and thinkfinger installed at the same time doesn't seem to break anything.



Other stuff


I mentioned earlier that the ati-driver that's part of the most recent portage tree doesn't work with the ATI Mobility FireGL V5200 card in the T60p. I didn't bother with a more recent version since the current work around requires the ChipId 0x71c5 in the xorg.conf file to trick the driver into thinking you've got a Radeon X1300, and I'm willing to wait for a real driver to be released. Currently, I just have what Xorg -configure outputted, which uses vesa as its driver. The only annoying thing about it is I can't get overlays to work.

UPDATE: I found some linux proprietary ati drivers, version 8.25.18-1, that supported the FireGL V5200. After I installed it, I removed the ChipID option in my xorg.conf and changed the driver to fglrx. Now I get GL accelleration, but I still can't get XVideo to work, even when I turn the option on.

UPDATE: The new ati driver was much slower than the vesa driver for some reason. So I switched back to the vesa driver. Oddly, glxgears now runs at 880fps compared to 200 with the ati driver.

UPDATE: XVideo is working now. The most recent (as of July) gentoo portage tree has Xorg X11 7.0-r1, that put together with ATI's most recent FireGL drivers (Thanks much to Lance Warner) 8.26.18 from ATI's website, I have X Overlay now. I ran a couple of other tests (like glxgears) and GL doesn't seem to be working all that much faster than with the vesa driver, but I don't use hardware GL very much; I was mostly concerned with the X overlay. For the specifics, the most recent emerge --sync required me to unmerge xorg-x11 (among a few other things like mozilla), and the emerge --update world put the newest X11 libs as well as xorg-x11 7.0-r1. Afterwards, I ran the file that I got from ATI's website, making sure that the older drivers were removed. One problem with this is that it blows away whatever Gentoo's portage installs, but I guess that can't be helped. It's something you just have to remember the next time you see an error when using portage.

UPDATE: The last --update world performed (November 2006) upgraded X11 to xorg-x11 7.1.1 and the proprietary ati driver version 8.26.18 no longer works. But fortunately the newest driver available on the ati website (8.29.6) works with the newer version of xorg-x11. X Overlay still works, seems to be a little faster than before, but the DRM is broken and I get no opengl. Maybe I'll mess with this some more when I get bored.

UPDATE: After the most recent kernel upgrade, I decided to try the ebuild instead of downloading from the ati website. I unmasked the most recent ebuild for ati-drivers (8.35.5) and emerged it. Everything works fine. DRM/DRI works, opengl works fine, Xvideo works fine, and on top of that, all the ATI control panels now work.

UPDATE (11/29/2007): The latest drivers in the portage tree DOES NOT work with the ATI FireGL V5200 video card. This includes x11-drivers/ati-drivers-8.42.3 and x11-drivers/ati-drivers-8.433, which both fail to locate any screens or devices. When you emerge either of these, portage gives you a warning about these drivers not working with some ATI devices. Adding a mask in your /etc/portage/package.mask will keep them from getting installed.


UPDATE (8/18/2009): And the ati-driver issue continues. A little while ago, gentoo decided to drop xorg-server-1.4 from its portage tree and migrate everyone to xorg-server-1.5. This unfortunately required an ati-drivers update. The migration was simple, and gentoo had a nice guide for doing it, but the new ati-drivers made things sketchy. I'd notice after a week or so of uptime that X would take up lots of memory (over 50%), DRI didn't work all the time, and random other stuff (like OpenOffice) wouldn't work sometimes. Finally got tired of it all and decided to unmask the newer ati-drivers, which required me to also unmask a newer version of xorg-server. Realizing that all of these ati-drivers doesn't support anything older than the R600 chipset (so no X at all), I had to go back to the working version, just to realize it wasn't in the portage tree anymore.

So I switched to the open source driver, which required me to set my VIDEO_CARDS to radeon instead of fglrx. Recompiling xorg-server pulled xf86-video-radeon (note that you can also use radeonhd but you must also have radeon in your list of cards). Since the proprietary drivers handled all of the GL and DRM stuff, you need to also include those so re-emerging mesa was required (needs radeon in your cards list or it won't build the r300_dri module). The version of the kernel I had (2.6.23) was too old, so I built a new kernel using 2.6.30. You need to enable CONFIG_DRM and CONFIG_DRM_RADEON, build your kernel and X should be good to go, with all the DRM/DRI stuff working. (But it broke wireless)


Intel Pro/1000 Gigabit Ethernet

I didn't have any problems with this for a while, but the other day I restarted after compiling the kernel while experimenting with the ati drivers and the wired ethernet adapter is nowhere to be found. I looked through dmesg and got this:

e1000: 0000:02:00.0: e1000_probe: The EEPROM Checksum Is Not Valid
e1000: probe of 0000:02:00.0 failed with error -5

The Intel support says to check the driver. So I check the driver by recompiling my kernel with e1000 as a module. When I modprobe, I get the same message. The Intel support then says to run diagnostics. I didn't know of any so I decided to take things into my own hands (WARNING, THIS COULD BE DANGEROUS). I opened up /usr/src/linux/drivers/net/e1000/e1000_main.c and commented out 2 lines in the block of code that checks the EEPROM:

        /* make sure the EEPROM is good */

        if (e1000_validate_eeprom_checksum(&adapter->hw) < 0) {
                DPRINTK(PROBE, ERR, "The EEPROM Checksum Is Not Valid\n");
/*              err = -EIO;
                goto err_eeprom;
*/      }

This way, I'll still get the error message in dmesg, but the driver loads successfully, and gigabit ethernet works again. I know that this is dodgy, but I was impatient as there were other things that I wanted to deal with.

UPDATE: Thanks to udev, you can have network come up automatically when you plug in an ethernet cable. You need to make sure you have this in your /etc/udev/rules.d/70-persistent-net.rules file:

# PCI device 0x8086:0x109a (e1000)
SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="[your MAC address]", NAME="eth0"



With the Bluetooth subsystem compiled into the kernel as well as the bluez packages, everything seems to work. When I turn on the bluetooth device (Fn + F5), /etc/init.d/bluetooth automatically starts and I can scan devices. When I turn off the bluetooth device, /etc/init.d/bluetooth automatically shuts down. I haven't had the chance to talk to another device or transfer any files yet.



I disabled all the CPU frequency scaling and suspend/hibernate, so I'm not sure if that stuff works correctly. The ibm acpi controls are definitely working (light, beep, display, bay, etc...), but I'm not sure if it's tied to the hotplug agent correctly. I don't have another Ultrabay device to test this on.



The USB seems to be working without any tweaking. I was able to connect an iPod up to the T60p, mount it, and copy files to/from it. I was also able to connect to multiple different digital cameras and mount them as scsi devices.



Not tested yet.



Not tested yet.



Not tested yet.


WAN Wireless

Not tested yet.

UPDATE: I did however notice a few kernel upgrades that the Sierra Wireless USB driver is in the kernel now, under Device Drivers->USB Support->USB Serial Converter. I compiled it into the kernel but haven't tested it because I don't have an account with Verizon. Also, has a detailed walkthrough for getting this working.




More links

Gentoo Handbooks
A very good guide for the T60, detailing the hardware and drivers
Thinkwiki's T60p page
Gentoo on Thinkpad T60, contains detailed instructions on getting WAN working
Installing Mandriva 2007 Cooker on a ThinkPad T60p
Fedora Core 5 on the Thinkpad T60p
Fingerprint reader ebuilds for Gentoo (VERY useful, you need this)
Fingerprint reader info on Thinkwiki
Bluetooth How-To at Thinkwiki (not really that useful...)
Also see: Gentoo on Thinkpad W700 page

This page was last updated on: Aug 29 2007