Arch Linux on an IBM/Lenovo Thinkpad X60
Archlinux Logo IBM Thinkpad Logo


Warning:

This site is currently outdated. I will take some time and update it in the near future. The main purpose for now is to provide for an easy way to regain fast direct rendering for Intel pre-965 chipsets on Archlinux. For long discussions of this topic see the Archlinux forums, e.g. http://bbs.archlinux.org/viewtopic.php?id=65460 and http://bbs.archlinux.org/viewtopic.php?id=61650

Since for now there seems to be no way to regain the old performance, I have created a repository of old Xorg packages. If you want to try downgrading X, mesa, and intel drivers, do the following:

Edit /etc/pacman.conf and add

[i810-repo]
Server=http://archlinux.freevar.com/i810-repo/

as the first repository entry.

Also, add xf86-video-intel to the IgnorePkg line

Please keep in mind that the X sever you are downgrading from has undergone a number of changes. This downgrade might therefore break functionality you came to rely on. Most importantly, the X server settings in /etc/X11/xorg.conf might not be adequate any more. If you have removed the mouse and keyboard input devices during the upgrade to xorg-server-1.5.x, you need to re-add the to the ServerLayout Section and reintroduce an InputDevice Section for each of them. Even more importantly, you need to choose the i810 (not intel) driver in the Device section. The following are the sections from my xorg.conf:

Section "ServerLayout"
     Identifier "X.org Configured"
     Screen 0 "Screen0" 0 0
     InputDevice "Mouse0" "CorePointer"
     InputDevice "Keyboard0" "CoreKeyboard"
     Option "AIGLX" "true"
EndSection


Section "InputDevice"
     Identifier "Keyboard0"
     Driver "kbd"
EndSection

Section "InputDevice"
     Identifier "Mouse0"
     Driver "mouse"
     Option "Protocol" "auto"
     Option "Device" "/dev/input/mice"
     Option "ZAxisMapping" "4 5 6 7"
EndSection


[...]

Section "Device"
     Identifier "Card0"
     Driver "i810"
     Option "DRI" "true"
     Option "XAANoOffscreenPixmaps" "true"
     Option "DevicePresence" "true"
     Option "CheckLid" "false"
     VendorName "Intel Corporation"
     BoardName "Mobile Integrated Graphics Controller"
     BusID "PCI:0:2:0"
EndSection




The files can also be downloaded directly from here:

i810-repo.db.tar.gz
intel-dri-7.0.4-1-i686.pkg.tar.gz
libdrm-2.3.0-3-i686.pkg.tar.gz
libgl-7.0.4-1-i686.pkg.tar.gz
libxfont-1.3.4-2-i686.pkg.tar.gz
mesa-7.0.4-1-i686.pkg.tar.gz
xf86-input-evdev-2.0.1-3-i686.pkg.tar.gz
xf86-input-keyboard-1.2.2-4-i686.pkg.tar.gz
xf86-input-mouse-1.3.0-1-i686.pkg.tar.gz
xf86-input-mouse-1.3.0-2-i686.pkg.tar.gz
xf86-video-i810-1.7.4-12-i686.pkg.tar.gz
xf86-video-intel-2.3.2-4-i686.pkg.tar.gz
xf86-video-vesa-1.3.0-8-i686.pkg.tar.gz
xorg-server-1.4.2-6-i686.pkg.tar.gz


Good luck!



Introduction:



This site documents my installation of Arch Linux on an IBM/Lenovo Thinkpad X60. I had to install a new hard drive and used this as an opportunity to document the Arch install on this marvelous notebook.

First, I will shortly introduce the notebook and Arch Linux. Then I describe the installation of the Arch Linux base system from CD, the installation of the KDE desktop including many helpful programs and the system configuration. At the end you will find links to the complete configuration files which have been edited in the process for easy review and also a few helpful links.

This is what my current desktop looks like. Click to enlarge.

Desktop thumbnail


About The X60:

The Thinkpad X60 is a extremely lightweight (sub)notebook. It may weigh as little as 2.7 lbs. including the battery. With the extra large battery I use it runs 6 to 7 hours. Trade offs are the tiny 12.1" XGA screen and the lack of an internal CD/DVD drive. An additional UltraBay dock may hold such a drive. Since I never need the drive outside of my home I am happy not to carry it around with me.

For more details see Lenovo's and the Thinkwiki's X60 pages. For the technically curious, this is the output of lspci.


About Arch Linux:

Arch Linux is a rolling release system. It includes an own package management, an Auto Build System (ABS) and a great and knowledgeable user base providing scripts for building applications in the Arch User Repository (AUR). Its system administration philosophy is strongly influenced by BSD. At a first glance, it may resemble Gentoo in a way. However, it is significantly different in a number of ways, most notably in that it provides precompiled packages and is designed to be much simpler to administer.

For reviews of Arch Linux check out Distrowatch's Arch Linux page. For a more detailed self-description read the ArchLinux entry in the Wiki.


Preparation:

Download the current Arch Linux Base Install CD from here.

If you need wireless for internet access, also download ipw3945d, ipw3945-ucode and ipw3945 from here, here and here. Copy these packages to a CD or USB drive.


CD Base Install:

Start the computer with the CD.

Run

$ /arch/setup

I have a 160 GB hard drive. I reserved 15 GB for the root file system (even though 10 GB should be well enough), 1 GB for swap and the rest for the home directory.

After the package installation, you need to edit /etc/rc.conf. I did the following minimal adjustments; more changes should be done after the installation of custom packages later on:

HARDWARECLOCK="UTC"
TIMEZONE="America/New_York"
...
HOSTNAME="[hostname]"

When editing /etc/locale.gen, I uncommented the US American utf-8 locale:

en_US.UTF-8     UTF-8

In grub's menu.lst I added the vga=792 to the kernel line to get a nice 1024x768 resolution for the console. I also deleted the uncommented entry for Windows (since I do not have Windows):

kernel /boot/vmlinuz26 root=/dev/sda1 ro vga=792

Finish the setup, take the CD out of the drive and reboot.


New Mirrors And First Update:

If you use internet access via Ethernet, you are all set. During installation process your e1000 Ethernet card has been recognized and added to /etc/rc.conf, so that the device is ready. A simple

$ dhcpcd eth0

should connect you.

If you use wireless, install the three packages copied to CD or USB device. Mount the device which is probably to be found at /dev/sr0 (CD) or /dev/sdb (USB) or /dev/sdb1 (USB); then install the packages.

$ mkdir /mnt/usbstick
$ mount /dev/sdbX /mnt/usbstick
$ pacman -A /mnt/usbstick/ipw3945-X.X.X-X.pkg.tar.gz
$ pacman -A /mnt/usbstick/ipw3945-ucode-X.X.X-X.pkg.tar.gz
$ pacman -A /mnt/usbstick/ipw3945d-X.X.X-X.pkg.tar.gz

Then you need to load the driver:

$ modprobe ipw3945
$ /etc/rc.d/ipw3945d start

To configure your wireless card you need to know the network name ([e]ssid):

$ iwconfig eth1 essid "[network_name]"
$ dhcpcd eth1

One more thing should be done before updating the package database: The extra, unstable and community repositories should be unmasked in /etc/pacman.conf. Also, a custom entry for the archlinuxfr server should be added to be able to install the wonderful pacman wrapper called yaourt. I am using the Northern American Ibiblio mirror, it is sufficiently fast for me. Please do not use the archlinux.org mirrors. They are under heavy strain and from time to time throttled.

[current]
Server = ftp://ibiblio.org/pub/linux/distributions/archlinux/current/os/i686
Include = /etc/pacman.d/current

[extra]
Server = ftp://ibiblio.org/pub/linux/distributions/archlinux/extra/os/i686
Include = /etc/pacman.d/extra

[unstable]
Server = ftp://ibiblio.org/pub/linux/distributions/archlinux/unstable/os/i686
Include = /etc/pacman.d/unstable

[community]
Server = ftp://ibiblio.org/pub/linux/distributions/archlinux/community/os/i686
Include = /etc/pacman.d/community

[archlinuxfr]
Server = http://repo.archlinux.fr/i686

Now you can update the package database and the base system:

$ pacman -Syu


Desktop Installation:

Before the next step I recommend installing the console web browser elinks. It can kill time while waiting for downloads and installation to complete. :)

$ pacman -S elinks

To switch to a different virtual console to run elinks, press control-alt+[2-6]. To get back, press control-alt-1.

Now the bulk of the system. I use a KDE-centric system with Firefox as my web browser and Openoffice for my daily work. The following command includes everything I installed at this point. This may include a few packages not of interest for some. I do think, however, that they generally helpful and may reflect more or less what most people expect from a desktop: web and office applications, multimedia and administration tools. If you do not know all of these programs, google (or whatever) is your friend.

$ pacman -S artwiz-fonts acroread alsa-oss alsa-utils amarok-base amule aspell-de aspell-en audacity bash-completion cpufrequtils cups-pdf digikamimageplugins easytag fakeroot filelight firefox flashplugin foomatic-db foomatic-db-ppd gimp gparted gtk-qt-engine gtkpod gwenview htop k3b kdeadmin kdebindings kdegraphics kdemultimedia kdenetwork kdepim kdeutils kipi-plugins knetworkmanager konversation kplayer mac mc mplayer-plugin musepack-tools mysql namcap ooodi2 openoffice-spell-de openoffice-spell-en openntpd openssh opera rpmextract rxvt-unicode scribus skype sudo tpb ttf-cheapskate vorbis-tools xf86-video-i810 xorg yaourt

Beware, this can take a while, it is well over 600 MB to be downloaded and installed.


User Management:

Now add regular users to the system. I recommend the adduser script, since it is amazingly simple"

$ adduser

Alternatively, you can add a user by doing

$ useradd -m -s /bin/bash [username]
$ passwd [username]

At this point you should also add yourself to the sudoers, so that you can take advantage of sudo. I know about the different opinions about it. I consider it very helpful. If you do not like it, leave it.
Also, for yaourt to build packages from source without using root account (and therefore heightened security), you need to allow poweruser status to yaourt when using the Arch tools srcpac, abs, pacman and pacdiffviewer. I have included all of this in the following. This is what my changes to /etc/sudoers look like:

# User alias specification
User_Alias POWERUSER=[username]

# Cmnd alias specification
Cmnd_Alias YAOURT=/usr/bin/srcpac, /usr/bin/abs, /usr/bin/pacman, /usr/bin/pacdiffviewer

# User privilege specification
root    ALL=(ALL) ALL
POWERUSER ALL=(ALL) YAOURT

# Uncomment to allow people in group wheel to run all commands
%wheel  ALL=(ALL) ALL

When installing software from AUR using yaourt, you will be asked which editor you prefer. To avoid this as have it started automatically, add the following to ~/.bashrc

# set Nano as yaourt's default editor
export EDITOR="nano"

To enable bash completion when using sudo add this to the same file:

# enable bash completion when using sudo
complete -cf sudo

Now log out to use the advantaged of user account + sudo

$ exit

and log in as the new user.

Much of the system administration done in Arch is regulated by access to groups. To take full advantage of the Arch User Repository (AUR) and the Arch Build System (ABS) though yaourt, for example, you need to create a group "abs", become member of it and make the local build directory owned by that group (well, there are other ways, but I prefer this):

$ sudo groupadd abs
$ sudo gpasswd -a [username] abs
$ sudo chown root.abs /var/abs/local
$ sudo chmod 775 /var/abs/local

Other groups are necessary for access to a number of devices like external drives, cameras, the wireless card, etc. For more information see this page (though incomplete). Become a member of these groups:

wheel log video audio optical floppy storage slocate camera scanner hal dbus network

by doing this:

$ sudo gpasswd -a [username] [groupname]


/etc/rc.conf (basic system configuration):

Now let us finish editing the most central configuration file of Arch Linux - /etc/rc.conf. Add the following modules to the MODULES array. They allow for printing over USB, IBM-specific ACPI functions, CPU frequency scaling over ACPI, hot plug for the PCI controller and support for the SD-card slot.

usblp ibm_acpi acpi-cpufreq shpchp sdhci

In the network section, below the "lo" entry, enter

eth0="dhcp"
eth1="dhcp"

and adapt the INTERFACES array as follows:

INTERFACES=(lo !eth0 !eth1)

These are both important for using NetworkManager to handle all network connections. Wrong settings in this part might well be the number one error for networking encountered in the Arch forums.

Then update the DAEMONS array as follows. The ordering of daemons is, again, particularly important for NetworkManager which needs ipw3945d, dbus, hal and dhcdbd loaded in that very order. Note that network should be commented out for NetworkManager to work. alsa, netfs and cups can be safely started in the background. You may like to try this with others as well. cpufreq is a daemon to control the CPU frequency (how to set it up is described below), alsa enables sound (setup also described below), cups is for printing (you need to set it up in KDE's Control Center) and KDM starts KDE's login screen.

DAEMONS=(syslog-ng cpufreq ipw3945d dbus hal !network crond @alsa @netfs \
        dhcdbd networkmanager networkmanager-dispatcher @cups kdm)


Sound:

To set up your sound card, run

$ alsaconf

and choose "hda-intel".


/etc/X11/xorg.conf (X window system configuration):

For a rough configuration of X for your system do

$ xorgconfig

To use direct rendering and easy switching from LCD to external projectors fine-tune /etc/X11/xorg.conf as follows.

In the section "ServerLayout" add:

Option         "AIGLX" "true"

In the section "Module" add:

Load  "ic2"
Load  "bitmap"
Load  "ddc"
Load  "int10"
Load  "vbe"

My "Device" section looks like this:

Identifier  "Card0"
Driver      "i810"
Option      "DRI"                       "true"
Option      "XAANoOffscreenPixmaps"     "true"
Option      "MonitorLayout"     "NONE,LFP+CRT"
Option      "DevicePresence"    "true"
Option      "CheckLid"              "false"
VendorName  "Intel Corporation"
BoardName    "Mobile Integrated Graphics Controller"
BusID       "PCI:0:2:0"

In the section "Screen" set the default color depth to 24 bit. Add the following before the first subsection:

DefaultDepth 24

The sections "DRI" and "Extensions" look as follows:

Section "DRI"
        Mode 0666
EndSection

Section "Extensions"
        Option "Composite" "Enable"
EndSection


CPU Frequency Scaling:

For CPU frequency scaling with the extremely simple cpufreq daemon, we have already loaded the correct modules and daemons in /etc/rc.conf. We now need to edit /etc/rc.local to send the current commands to both CPUs at startup. This works perfectly, unlike many of the desktop 'solutions' that regulate only one CPU (Kubuntu Guidance, anyone?).

# Set CPU Frequency Scaling
echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo "ondemand" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
cat /sys/devices/system/cpu/cpu1/cpufreq/cpuinfo_max_freq > \ /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
cat /sys/devices/system/cpu/cpu1/cpufreq/cpuinfo_max_freq > \ /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq


Thinkpad Extra Keys:

For some of the Thinkpad's features you need access to the kernel's nvram module. First do the following:

$ sudo groupadd thinkpad
$ sudo gpasswd -a thinkpad [username]

Then edit /etc/udev/rules.d/udev.rules and change the line containing "nvram" to:

KERNEL=="nvram", NAME="misc/%k", SYMLINK+="%k", GROUP="thinkpad", MODE="0664"

Then do:

$ sudo modprobe -rv nvram
$ sudo udevcontrol reload_rules
$ sudo modprobe -v nvram

If /dev/nvram does not exist, do:

$ sudo mknod /dev/nvram c 10 144
$ sudo udevcontrol reload_rules
$ sudo modprobe nvram

Finally, we need to edit /etc/rc.local again to make the kernel module for the Thinkpad extra keys which we worked on before available at startup:

# Thinkpad Extra Keys
modprobe nvram

To use the 'page forward' and 'page backward' keys in Firefox we have make them simulate function keys because of the internal workings of Firefox which disallow setting this in its config. To achieve this a simple hack to ~/.Xmodmap is sufficient:

keycode 234 = F19
keycode 233 = F20

In Firefox, type about:config in the address bar and set the values of the variables keyconfig.main.goBackKb2 and keyconfig.main.goBackKb2 to ][][VK_F19 and ][][VK_F20 accordingly. (No, those brackets are not errors.)

To set this into effect, create a file called (e.g.) ~/.kde/Autostart/xmodmap-for-navi and enter:

#!/bin/bash
xmodmap ~/.Xmodmap

Then make the file executable:

$ chmod +x ~/.kde/Autostart/xmodmap-for-navi

The tpb program adjusts the volume when pressing the Thinkpad's volume keys and displays the current loudness using a little OSD program. To start tpb with Every start of KDE, create a file ~/.kde/Autostart/tpb-exec and enter

#!/bin/bash
tpb &
tpb &

I start this twice because for some reason I have not yet figured out, it sometimes fails. This little script also needs to be executable:

$ sudo chmod +x ~/.kde/Autostart/xmodmap-for-navi ~/.kde/Autostart/tpb-exec


Urxvt As A Desktop Background:

As you can see in my screenshot, I have worked a little on the Rxvt Unicode console emulator (also called Urxvt). This is achieved by some settings in ~/.Xdefaults and a tweaking of the application's window settings in KDE. The former (~/.Xdefaults) settings are these:

urxvt*background:  #000000
urxvt*foreground:  #ffffff
urxvt*color0:      #000000
urxvt*color1:      #9e1828
urxvt*color2:      #aece92
urxvt*color3:      #968a38
urxvt*color4:      #414171
urxvt*color5:      #963c59
urxvt*color6:      #418179
urxvt*color7:      #bebebe
urxvt*color8:      #666666
urxvt*color9:      #cf6171
urxvt*color10:     #c5f779
urxvt*color11:     #fff796
urxvt*color12:     #4186be
urxvt*color13:     #cf9ebe
urxvt*color14:     #71bebe
urxvt*color15:     #ffffff
urxvt*fading:   15
urxvt*tintColor: #ffffff
urxvt*shading:   60
urxvt*inheritPixmap: True
urxvt*scrollBar: False
#urxvt*font: -*-*-*-*-*-*-*-*-*-*-*-*-iso8859-*

URxvt*urlLauncher:      firefox
*perl-ext-common:matcher
*matcher.button: 1

urxvt.saveLines: 10000
urxvt.cursorBlink: true
urxvt*scrollTtyKeypress:    true
urxvt*scrollTtyOutput:      false
urxvt*scrollWithBuffer:     false
urxvt.scrollstyle:      plain
urxvt.secondaryScroll:  true
urxvt*font: xft:DejaVu Sans Mono:pixelsize=11:antialias=true:hinting=true
urxvt*boldFont: xft:DejaVu Sans Mono:pixelsize=11:antialias=true:bold:hinting=true
urxvt*italicFont: xft:DejaVu Sans Mono:pixelsize=11:antialias=true:italic:autohint=true:hinti
ng=true
urxvt*bolditalicFont: xft:DejaVu Sans Mono:pixelsize=11:antialias=true:bold:italic:autohint=t
rue:hinting=true

urxvt*title: Terminal
urxvt*termName: rxvt-unicode

KDE's special application window settings are as follows:

[Geometry]
Position: Apply initially - 44,47
Size: Apply initially - 656,523
Desktop: Apply initially - All desktops

[Peferences]
Keep below: Apply initially
No border: Force
Skip taskbar: Force
Skip pager: Force


Rebooting:

That is about it. Happy rebooting!

$ reboot

You will be greeted by kdm. Congratulations!


Some More Helpful Programs:

I also installes a number of programs from the AUR using yaourt. You could do this e.g. in KDE's konsole or urxvt. The three KDE plugin packages are especially interesting since I refuse to install the kdeaddons package which pulls in kdegames. However, I like the plugins which, for example, add Ark functionality to the context menu in Konqueror. beagle-no-gnome and kerry-no-gnome are packages that provide for the search tools Beagle and Kerry, but avoid the Gnome dependencies that come with the default packages in Arch Linux. All in all the AUR is really worth a closer look. Arch users are great!

$ yaourt -S beagle-no-gnome bibletime bibus hwinfo jmemorize kate-plugins kdeaddon-kfile-plugins kdeicons-oxygen-svn kerry-no-gnome kftpgrabber konq-plugins nvu-kde nvu-extension-firefox ttf-ms-fonts ttf-nastaliq ttf-sil-arabic ttf-sil-fonts truecrypt-gui-kommander zekr


Random Stuff:

I am extremely annoyed by system beeps. In KDE and in Konsole these can be turned off, but Arch Linux's standard kernel does not disable it. If you do not want to recompile the kernel anyways, a simple series of commands reduces the beep's length to zero, thus stopping this annoyance. For this, once more edit /etc/rc.local:

$ Disable System Beep
setterm -blength 0 > /dev/vc/1
setterm -blength 0 > /dev/vc/2
setterm -blength 0 > /dev/vc/3
setterm -blength 0 > /dev/vc/4
setterm -blength 0 > /dev/vc/5
setterm -blength 0 > /dev/vc/6
setterm -blength 0 > /dev/vc/7
setterm -blength 0 > /dev/vc/8

To speed up web browsing, you may want to disable the ipv6 protocol that is still unsupported by some providers. Edit /etc/modprobe.conf and add

alias net-pf-10 off

at the end of the file.

If you experience problems with some websites that expect "Bon Echo" to be different from "Firefox" and deny some (or all) of their functionality, with a simple step you can change the browser identification to Firefox. Enter about:config in Firefox's location bar and set the variable "general.useragent.extra.firefox" from "BonEcho/X.X.X" to "Firefox/X.X.X". Done.

If you keep tinkering now, you may wish to create your slocate database:

$ sudo updatedb

To administer the network, start KNetworkmanager from "Internet" in the KDE menu. If you do not exit the program it will automatically start up at login and choose a network connection. For file search start Kerry from "Utilities". Same here. You may want to change Kerry's settings.

If you install Google Earth [$ yaourt -S google-earth], disable "Atmosphere" in the "View" menu, otherwise the screen will turn grayish when zooming.


Afterthoughts:

In case of reinstalling the whole system, make sure to back up the /home directory and to restore those files/folders in the ~/.kde folder that are necessary, e.g. ~/.kde/Autostart/
~/.kde/share/config (esp. the subfolders kmail*, kadd*, kwall*)
~/.kde/share/apps (esp. the subfolders kmail, kabc, kwallet),
as well as some other hidden folders like
~/.mozilla

It also makes sense to copy the newest version of each package stored in /var/cache/pacman/pkg to a CD or USB device. These can be copied to the harddisk before the first pacman -Syu and will save a lot of waiting time and bandwidth.


Configuration Files For Easy Review:

~/.Xdefaults
~/.Xmodmap
~/.kde/Autostart/xmodmap-for-navi
/etc/rc.conf
/etc/rc.local
/etc/pacman.conf
/etc/sudoers
/etc/locale.gen
/etc/modprobe.conf
/etc/X11/xorg.conf


Links:

Arch Linux
Arch Linux Wiki
Arch Linux Forum
Arch Linux User Repository (AUR).
Linux on IBM/Lenovo Thinkpads

W3C HTML 4.01 Validator Icon  Tuxmobil stickerLinux on Laptops sticker
Free Web Hosting