Gentoo on the Thinkpad X61s

This is my guide to Gentoo on the Thinkpad X61s. If you link this page, have any comments, use Gentoo on the Thinkpad too, know solutions to problems, etc. i’d be very happy if you drop me a line on tom111(a)gmx.de. Have fun.

Updated on 03/30/2008: Brightness and Volume Buttons, first draft.
04/01/2008: Tips and Anti-Pitfalls, Volume Buttons, X…
04/09/2008: A new BIOS 2.11 was published on Lenovo’s site. I see no difference in temperature/fan behaviour.
04/20/2008: Kernel 2.6.25 was released, find my kernel config at the bottom. I switched back to using KDE3, its just so perfectly configurable, and it features “kpowersave” which has a nice integration of hal into the desktop. It autodimms, autosuspends,…

02/12/2010: Complete update of the guide.

Installation notes:

  • Use SystemRescueCD! It can be easily installed on an USB-Stick. Can be resize NTFS partition easily and has everything you need
  • As always: Use a recent kernel! This guide is based on 2.6.32.

Hardware support:

Fingerprintreader:

I think this gadget is quite useless. Typing a password is faster and more secure. Nevertheless it is supported using thinkfinger and a pam-module. I had it working in the beginning. Thinkwiki has details.

Graphics:

Use recent software and most stuff will work out of the box! My /etx/X11/xorg.conf is here. Note that I have input devices disabled, they are autoconfigured through hal. I have the hal useflag enabled.  I also use kms and can switch between the console and X with no flicker! See me kernel config below.

Networking:

Wireless: iwlagn module and net-wireless/iwl4965-ucode work out of the box. The temperature of the Wireless LAN Card and thereby the heat under your right palm can be dramatically reduced by enabling power management via

for i in `echo /sys/bus/pci/drivers/iwl4965/*/power_level`; do
echo 5 > $i
done

Wireless comfort, aka “airport”: I use net-misc/wicd. It simply rocks!

Frequency Scaling

Works out of the box with kernel modes. I use the “ondemand” governor which can be started by the init scripts using “cpufrequtils”. Finetuning can be achieved by using a more sophisticated deamon like powernowd.

Bluetooth:

Works perfectly using bluez and standard kernel drivers. You can follow this guide.

Volume, Play, Next Song, … Buttons

In KDE everything works automatically with kmix. The X-Server will generate keyboard events XF86AudioPrev, XF86AudioNext, XF86AudioMute , … and so on.

For other desktops make your favourite desktop react appropriately to the keys “XF86Audio..” To raise volume you can use for instance

amixer sset Master 10%+

You can even use the fancy next, prev – Buttons above the arrows to switch between consoles, windows, desktops or whatever you like.

Make Caps Lock an additional Control

In KDE and Gnome this can be configured through keyboard settings. Otherwise generate a file ~/.Xmodmap

clear Lock
keycode 66 = Control_L
add Control = Control_L

and add “xmodmap .Xmodmap” somewhere in your desktops startup. (.xinitrc for people who still type startx (like me)) At least in KDE this can be configured as an option for keyboardlayout configuration.

Brightness Buttons

Work automatically through kernel and X.

Cardreader

Works out of the box with my kernel configuration. Just plug in a card and mount /dev/mmcblk0p1 or similar.

Sleep Modes

Work out of the box. I use powerdevil which suspend through hal and pm-utils.  Make sure you have the ‘laptop’ useflag set.

The fan issue:

I use the thinkpadfan control script from thinkwiki, because the control of the BIOS leaves the fan on forever.

Background: The BIOS measures different thermal sensors, you can see the values with ‘cat /proc/acpi/ibm/thermal’. Confirmed are: 1st is CPU, 4th is GPU, 3rd is MiniPCI=wlan. It switches on the fan if one of them is over a certain threshold. If you enable wireless connections than the IPW4965, which also makes the nice warm feeling under the palm of your right hand will heat up to approx 42 degrees. This is more than the threshold and the BIOS switches on the fan which does not result in cooling the wlan device as you can see be monitoring the temperatures. CPU-Temp drops below 40, but the fan keeps running as the miniPCI is “hot enough”. The heat-up is not too fast, which explains the 10 minute delay from power on. Switching the Kill Switch solves the problem but cuts you of from wireless networks. As the fan appearently does not affect the temperatur of the miniPCI slot (it is located in a totally different place anyway).

Tips and Tricks

  • The Intel HDA implementation has two extra channels for headphone and external speaker, these have no volume and can only be (un)muted. If you hear no sound after the installation make sure to unmute them, using e.g. alsamixer. The channel for the external speaker is the rightmost in my case.
  • powersaving mode for the iwl4965 driver DRAMATICALLY reduces the temperature when using the wlan device. See networking section.

Output of lspci:

00:00.0 Host bridge: Intel Corporation Mobile Memory Controller Hub (rev 0c)
00:02.0 VGA compatible controller: Intel Corporation Mobile Integrated Graphics Controller (rev 0c)
00:02.1 Display controller: Intel Corporation Mobile Integrated Graphics Controller (rev 0c)
00:19.0 Ethernet controller: Intel Corporation 82566MM Gigabit Network Connection (rev 03)
00:1a.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Contoller #4 (rev03)
00:1a.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #5 (rev 03)
00:1a.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #2 (rev 03)
00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 03)
00:1c.0 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 1 (rev 03)
00:1c.1 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 2 (rev 03)
00:1d.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #1 (rev 03)
00:1d.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #2 (rev 03)
00:1d.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #1 (rev 03)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev f3)
00:1f.0 ISA bridge: Intel Corporation Mobile LPC Interface Controller (rev 03)
00:1f.1 IDE interface: Intel Corporation Mobile IDE Controller (rev 03)
00:1f.2 SATA controller: Intel Corporation Mobile SATA AHCI Controller (rev 03)
00:1f.3 SMBus: Intel Corporation 82801H (ICH8 Family) SMBus Controller (rev 03)
03:00.0 Network controller: Intel Corporation Unknown device 4230 (rev 61)
05:00.0 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev ba)
05:00.1 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller (rev 04)
05:00.2 SD Host controller: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 21)

make.conf

# Please consult /etc/make.conf.example for a more detailed example.
CFLAGS=”-march=core2 -O2 -pipe -fomit-frame-pointer”
# LDFLAGS=”-Wl,-O1″
LDFLAGS=”-Wl,-O1 -Wl,–as-needed”
CXXFLAGS=”${CFLAGS}”
# This should not be changed unless you know exactly what you are doing.  You
# should probably be using a different stage, instead.
CHOST=”i686-pc-linux-gnu”
USE=”a52 aac anthy apache2 avahi bash-completion bluetooth bzip2 cddb
cdparanoia cjk consolekit ctype curl daap djvu emacs expat fbcon ffmpeg flac ftp gd
gimp glut gmp gnutls graphviz gtk guile hdaps ieee1394 imagemagick imap imlib ipod java
javascript latex leim libnotify lm_sensors m17n-lib migemo mime mmx mng mp4 mplayer mule musicbrainz mysql
mysqli nls nptl nsplugin obex ocaml oggvorbis openal opengl pcmcia
php plasma plotutils policykit real sasl samba semantic-desktop slang smartcard sqlite sqlite3 sse texlive
theora threads tk truetype uim unicode usb visualization -vhosts wicd wifi wxwindows xcb xine xft xulrunner xvid v4l v4l2
-arts -emboss kde qt4 xcomposite xinerama zeroconf zsh-completion
-gnome -gnome-keyring -gphoto2″
MAKEOPTS=”-j3″
INPUT_DEVICES=”keyboard mouse evdev”
VIDEO_CARDS=”intel”
ACCEPT_LICENSE=”*”
# FRITZCAPI_CARDS=”fcpcmcia”
LINGUAS=”en en_US de ja es fr it”
FEATURES=”parallel-fetch ccache collision-protect”
PORTAGE_NICENESS=”10″
CCACHE_SIZE=”5G”
CCACHE_DIR=”/var/tmp/ccache”
PORTDIR_OVERLAY=”/usr/local/portage/tom-overlay /home/tom/gentoo/sci /home/tom/gentoo/sage-on-gentoo”
source /usr/local/portage/layman/make.conf
APACHE2_MODULES=”actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias”
GENTOO_MIRRORS=”http://gentoo.tiscali.nl/”
#SYNC=”rsync://rsync.europe.gentoo.org/gentoo-portage”
#The following line seems to help when mirrors are far away
PORTAGE_RSYNC_EXTRA_OPTS=”–timeout=300″

Kernel Configuration

This is my kernel config file for kernel 2.6.32. Use with caution.

Sources

  • Share/Bookmark