Home / About / Gentoo Linux on a Thinkpad X201

Installation Notes

Gentoo Linux on a Thinkpad X201

ThinkPad X201, model 3249CTO, S/N R9-4GN8P
Intel Core i5-540M Processor (2.53-3.06GHz, 3MB L3, 1066MHz FSB)
12.1" WXGA LED Panel, (1280x800) with Camera
8 GB PC3-8500 DDR3 SDRAM 1067MHz SODIMM Memory (2 DIMM)
320 GB Hard Disk Drive, 7200rpm
5-1 Media Card Reader and Modem
ThinkPad X200 Series 6 cell Li-Ion Battery
Intel Centrino Wireless-N 1000
Date of Purchase, June 2010

Gentoo Linux

Here is a record of my steps taken to install and configure Gentoo Linux on a Thinkpad X201, as well as some general tweaks to make life a little nicer using GNU/Linux. I currently run openbox as my window manager. Collected from various online sources, I find it helpful to have this information consolidated at one location.

X201 Hardware Manual
X201 Service Guide
X200 Datasheet


Booting from a USB Drive (gentoo-install-amd64-minimal-20100408.iso)

I booted off a USB drive running install-amd64-minimal-20100408.iso. Once the USB is running, procede with the install as per Gentoo Handbook


Boot Parameter needed due to the integrated graphics card

In order to get X working with the integrated graphics card I have added "xforcevesa i915.modeset=0" to the kernel command line in grub configuration.
xforcevesa i915.modeset=0

Networking

Kernel module iwlagn works out-of-the-box, but after installing gentoo, you also need to install the ucode listed below for the wifi to function. Ethernet need the kernel module e1000e,(Intel(R) PRO/1000 PCI-Express Gigabit Ethernet support.) I now use WICD to control my networking running as a service on boot. On my desktop I run wicd-client which is handy as a small applet in the dock as can be seen in the screenshot below.
emerge -av net-wireless/iwl1000-ucode
To stop that annoying flashing wifi LED create a file called /etc/modprobe.d/wlan.conf containing the following lines:
# 1 means do not blink: options iwlcore led_mode=1

Installing Gentoo using ACCEPT_KEYWORDS="~amd64"

By accepting keywords I get the lastest versions of software, and use OpenRC rather than Baselayout. My boot up time is: 18.4 seconds

CPU Frequency

Works out-of-the-box, but I had to manually load the module acpi-cpufreq by listing the module in /etc/conf.d/modules

Power Management

I followed the Gentoo Power Management guide.

To make suspend to ram work add "acpi_sleep=s3_bios" to the kernel command line in grub configuration.

Here are the two scripts I use for the acpi event of closing the lid.

lid
Located here /etc/acpi/events/lid
event=button/lid action=/etc/acpi/actions/suspend.sh %e

suspend.sh
Located here /etc/acpi/actions/suspend.sh
#!/bin/sh # if launched through a lid event and lid is open, do nothing echo "$1" | grep "button/lid" && grep -q open /proc/acpi/button/lid/LID/state && exit 0 # stop wifi /etc/init.d/net.wlan0 stop # remove wifi module rmmod iwlagn # go to sleep sleep 3 && echo -n "mem" > /sys/power/state # reload wifi module modprobe iwlagn sleep 1 /etc/init.d/net.wlan0 stop && iwconfig wlan0 txpower on && /etc/init.d/net.wlan0 start for i in `echo /sys/bus/pci/drivers/iwlagn/*/power_level`; do echo 5 > $i done

Secure Digital Card Reader

Works out-of-the-box and automounts using Hal and Dbus, or can be manually mounted at /dev/mmcblk0p1

Desktop Beautification

Screenshots:
Screenshot #1 (minimal)

Fonts

USE Flags
Enable the following USE flags:
truetype type1 cleartype corefonts

Emerge Fonts

X.org and other apps should pull in some common fonts. Here are some additional fonts useful for OpenOffice and other programs. Dejavu provides excellent default fonts which we will enable in the next section.

app-admin/eselect-fontconfig
media-fonts/corefonts
media-fonts/dejavu
media-fonts/font-bh-ttf
media-fonts/font-bh-type1
media-fonts/freefonts
media-fonts/ttf-bitstream-vera
media-fonts/unifont
media-fonts/artwiz-aleczapka-en

Enabling fontconfig options

Use ‘eselect fontconfig list‘ to see a list of available configuration options.
eselect fontconfig list

Try enabling the following with ‘eselect fontconfig enable <num>:

10-autohint.conf
10-sub-pixel-rgb.conf
20-unhint-small-dejavu-sans-mono.conf
20-unhint-small-dejavu-sans.conf
20-unhint-small-dejavu-serif.conf
25-unhint-nonlatin.conf
57-dejavu-sans-mono.conf
57-dejavu-sans.conf
57-dejavu-serif.conf

This will give you very nice hinted fonts suitable for the great majority of RGB LCD displays.

The 57- series rules enable dejavu fonts as the default Serif and Sans Serif fonts. This will improve the look of your desktop environment and programs like Firefox immediately.

~/.fonts.conf

This file controls your user fontconfig settings. We will reiterate RGB hinting and disable it for bold fonts so they are not overly bold..

<?xml version='1.0'?> <!DOCTYPE fontconfig SYSTEM 'fonts.dtd'> <fontconfig> <match target="font"> <edit mode="assign" name="rgba"> <const>rgb</const> </edit> </match> <match target="font"> <edit mode="assign" name="hinting"> <bool>true</bool> </edit> </match> <match target="font"> <edit mode="assign" name="hintstyle"> <const>hintfull</const> </edit> </match> <match target="font"> <edit mode="assign" name="antialias"> <bool>true</bool> </edit> </match> <!-- Disable autohint for bold fonts so they are not overly bold --> <match target="font" > <test compare="more" name="weight" > <const>medium</const> </test> <edit mode="assign" name="autohint" > <bool>false</bool> </edit> </match> </fontconfig>

Openbox Theme:
openbox theme called Steel-Ice

Openbox Menu:
Openbox XML menu file


SSH Filesystem

I now mount network drives over ssh, rather than samba.
emerge sys-fs/fuse
emerge sys-fs/sshfs-fuse
modprobe fuse

to mount:
sshfs user@host:/dir/mount/point/ /local/mount/point/
to unmount:
fusermount -u /local/mount/point/


lspci Output

00:00.0 Host bridge: Intel Corporation Core Processor DRAM Controller (rev 02) 00:02.0 VGA compatible controller: Intel Corporation Core Processor Integrated Graphics Controller (rev 02) 00:16.0 Communication controller: Intel Corporation 5 Series/3400 Series Chipset HECI Controller (rev 06) 00:16.3 Serial controller: Intel Corporation 5 Series/3400 Series Chipset KT Controller (rev 06) 00:19.0 Ethernet controller: Intel Corporation 82577LM Gigabit Network Connection (rev 06) 00:1a.0 USB Controller: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller (rev 06) 00:1b.0 Audio device: Intel Corporation 5 Series/3400 Series Chipset High Definition Audio (rev 06) 00:1c.0 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 1 (rev 06) 00:1c.3 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 4 (rev 06) 00:1c.4 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 5 (rev 06) 00:1d.0 USB Controller: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller (rev 06) 00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev a6) 00:1f.0 ISA bridge: Intel Corporation Mobile 5 Series Chipset LPC Interface Controller (rev 06) 00:1f.2 SATA controller: Intel Corporation 5 Series/3400 Series Chipset 6 port SATA AHCI Controller (rev 06) 00:1f.3 SMBus: Intel Corporation 5 Series/3400 Series Chipset SMBus Controller (rev 06) 00:1f.6 Signal processing controller: Intel Corporation 5 Series/3400 Series Chipset Thermal Subsystem (rev 06) 02:00.0 Network controller: Intel Corporation WiFi Link 1000 Series ff:00.0 Host bridge: Intel Corporation Core Processor QuickPath Architecture Generic Non-core Registers (rev 02) ff:00.1 Host bridge: Intel Corporation Core Processor QuickPath Architecture System Address Decoder (rev 02) ff:02.0 Host bridge: Intel Corporation Core Processor QPI Link 0 (rev 02) ff:02.1 Host bridge: Intel Corporation Core Processor QPI Physical 0 (rev 02) ff:02.2 Host bridge: Intel Corporation Core Processor Reserved (rev 02) ff:02.3 Host bridge: Intel Corporation Core Processor Reserved (rev 02)

make.conf

# Please consult /usr/share/portage/config/make.conf.example for a more # detailed example. CFLAGS="-O2 -pipe" CXXFLAGS="-O2 -pipe" # WARNING: Changing your CHOST is not something that should be done lightly. # Please consult http://www.gentoo.org/doc/en/change-chost.xml before changing. CHOST="x86_64-pc-linux-gnu" # MAKEOPTS="-j3" # These are the USE flags that were used in addition to what is provided by the # profile used for building. USE="dbus devicekit consolekit policykit hal udev cdparanoia css aac -abiword \ -arphicfontis aspell acpi alsa \ avahi aim bash-completion battery bzip2 cairo cdparanoia cddb cleartype \ -cjk cups corefonts encode -esd -eds fame flac flash ftp ffmpeg freetype \ gif gimp glibc -omitfp -gnome -gphoto2 gtk2 history \ icq ieee1394 imagemagick imap jabber -java javascript jpeg laptop \ libg++ lm_sensers libwww mime mmx mad mng mozilla mp3 mpeg mbox \ maildir ncurses nptlonly nsplugin npp ogg oggvorbis opengl -ldap oscar oss \ otr pcmcia pam pdf perl pmu posix png ppds quicktime samba spell \ symlink sse ssl sse2 svg sql sysfs tiff trayicon truetype type1 unicode usb vim vim-syntax \ vhosts vorbis win32codecs X xine xml xml2 xpm xvid yahoo \ -arts -fortran -joystick -kde -motif -htdocs -esound -qt3support -qt4 \ -berkdb xinerama xulrunner" #INPUT_DEVICES="keyboard mouse evdev" INPUT_DEVICES="evdev synaptics" VIDEO_CARDS="vesa" # FEATURES="parallel-fetch ccache" # # Portage # # NICENESS sets system priority. 10 is a reasonable value. #PORTAGE_TMPDIR=/var/tmp #PORTDIR=/usr/portage #PORT_LOGDIR=/var/log/portage #PORTAGE_NICENESS=10 #AUTOCLEAN="yes" #PORTDIR_OVERLAY=/usr/local/portage # # #FEATURES="distlocks userpriv sandbox" FEATURES="ccache" CCACHE_DIR="/var/tmp/ccache/" CCACHE_SIZE="2G" ACCEPT_KEYWORDS="~amd64" ACCEPT_LICENSE="skype-eula" ACCEPT_LICENSE="dlj-1.1" ACCEPT_LICENSE="googleearth" ACCEPT_LICENSE="*" # Needed form some applications including Open-Office: LINGUAS="en" 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 cgi cgid 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.chem.wisc.edu/gentoo/ \ http://mirrors.cs.wmich.edu/gentoo http://www.cyberuse.com/gentoo/ \ http://lug.mtu.edu/gentoo/ ftp://lug.mtu.edu/gentoo/" SYNC="rsync://rsync25.us.gentoo.org/gentoo-portage"

Kernel Config

Here is my config file for kernel 2.6.34-gentoo-r1


X11 Config

Here is my xorg.conf


ICC Profile

Here is my thinkpadx201.icc
I use xcalib to launch the profile.


Resources

(thanks to these very helpful resources)



Last updated on 06/30/10