Installing Arch on an X200

From ThinkWiki
Revision as of 13:25, 11 October 2009 by The mike (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Introduction

ArchLinux is a very good distribution for advanced, or "conscious" users, who like to tune their system in every detail. The distro does not require any kernel optimization or similar (at this point, it is different from Gentoo), but it lets you do it if you want.

This guide is thus rather barebone. I won't go into details of the single functions (sound, Xorg, etc.), but if some special howto is required for the X200. My system is the following.

$ lspci

00:00.0 Host bridge: Intel Corporation Mobile 4 Series Chipset Memory Controller Hub (rev 07)
00:02.0 VGA compatible controller: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller (rev 07)
00:02.1 Display controller: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller (rev 07)
00:03.0 Communication controller: Intel Corporation Mobile 4 Series Chipset MEI Controller (rev 07)
00:03.2 IDE interface: Intel Corporation Mobile 4 Series Chipset PT IDER Controller (rev 07)
00:03.3 Serial controller: Intel Corporation Mobile 4 Series Chipset AMT SOL Redirection (rev 07)
00:19.0 Ethernet controller: Intel Corporation 82567LM Gigabit Network Connection (rev 03)
00:1a.0 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #4 (rev 03)
00:1a.1 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #5 (rev 03)
00:1a.2 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #6 (rev 03)
00:1a.7 USB Controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #2 (rev 03)
00:1b.0 Audio device: Intel Corporation 82801I (ICH9 Family) HD Audio Controller (rev 03)
00:1c.0 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 1 (rev 03)
00:1c.1 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 2 (rev 03)
00:1c.2 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 3 (rev 03)
00:1c.3 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 4 (rev 03)
00:1d.0 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #1 (rev 03)
00:1d.1 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #2 (rev 03)
00:1d.2 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #3 (rev 03)
00:1d.7 USB Controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #1 (rev 03)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev 93)
00:1f.0 ISA bridge: Intel Corporation ICH9M-E LPC Interface Controller (rev 03)
00:1f.2 SATA controller: Intel Corporation ICH9M/M-E SATA AHCI Controller (rev 03)
00:1f.3 SMBus: Intel Corporation 82801I (ICH9 Family) SMBus Controller (rev 03)
03:00.0 Network controller: Intel Corporation Wireless WiFi Link 5300
04:00.0 Memory controller: Intel Corporation Turbo Memory Controller (rev 11)

Vista Backup

You should start by backing up Windows Vista on some recovery media (CD/DVD) if you want to restore it later. You just open Vista, go to "Start-->Programs-->ThinkVantage-->Create Product Recovery Media"(or something similar) and follow the instructions.

Getting the Arch installation medium

Go to the ArchLinux page and choose which version of the installer you want. My choice was: USB key x86-64 FTP installer. Please note that installing a 64-bit OS enables the recognition of 4Gb RAM (as in my case) but can create problems with some packages (which do only exist in 32-bit version).

Before going on, be sure to follow the intruction on the Arch wiki to get a working installation medium (e.g. a working, bootable USB key).

BIOS modifications

You're likely to want to change some default BIOS options. Now it is a good time to do it. Boot your X200, press F1, and enter the BIOS setup. Some typical changes involve boot device ordering (e.g. if you want to check USB ports before your primary HD) and muting the system beep (PCSpeaker) notifications (e.g. low-battery, suspension, etc.).

Please remember that the BIOS is not a game. If you do something wrong here, you can get into trouble later on. If you want to update your BIOS far any reason (e.g. compatibility issues), please do it with both battery and AC-adapter connected, and try to get a reliable current source (do not perform the flash during a thunderstorm!).

ATTENTION!
A wrong BIOS flash can turn, as far as I know, your humble X200 into a fantastic pot-heatsink, which circumstance you probably do not want to happen!

Partitioning the Hard Disk

Arch installation media have a partition editor whithin (cfdisk?), but it seems that the preloaded partitions by Lenovo create some problems. They are apparently "not rounded about cylinders", so it was necessary for me to edit the partition table with an external program before installing Arch.

I used System Rescue CD with an external (USB) CD-player. At boot, press F12 to choose the boot device and select "external CD player". It is possible to get SysRescCd onto an USB key, but I haven't tried it. After booting from the CD, just follow the instructions and get into X, then use GParted to modify the partition table according to your needs. In my case, since I do not need Vista anymore, I just erased all partitions and let the Hard Disk completely free (in order to create the partitions inside the Arch installer). If you want to keep Vista, you have to be very careful at this point. Read some documentation online and be sure to have a CD/DVD backup of the Lenovo partition, an external CD player, and an original Windows Vista DVD (this seems to be necessary, too, ugh!).

Installing Arch

In the following section, I will assume that you install Arch from an USB key, as I did. If you chose some other option (e.g. CD/DVD), adapt the instructions accordingly.

Insert the USB key into the plug, boot the laptop, and press F12 to choose the boot device. Load the Arch live (!) installer and follow the guide on the Arch wiki.

Some remarks:

  • it is maybe a good idea to install the wireless firmware now (in the base list), but you can do it later (I did so);
  • the ethernet port is working smoothly, so you do not have to do anything special to get your installation files through FTP. If you encounter problems here, it may be a BIOS issue. Get some info online;
  • if you have chosen to use the Arch-included tool to partition your HD, there should be no problem. If you already partitioned your HD before and encounter difficulties now, try to get some help on the Arch forum. Is seems o me that cfdisk is somehow too strict about partition qualities.
  • GRUB: in order to get the right framebuffer resolution, I added vga=865

Some useful post-install packages

Here are some packages you are likely to want. For each of them, see the Arch wiki and/or the Thinkwiki pages:

  • cpufrequtils
  • pm-utils
  • xorg
  • xf86-video-intel
  • xf86-input-evdev
  • alsa-utils
  • wireless_tools
  • iwlwifi-5000-ucode (depending on your wireless card)
  • hal
  • acpid

Some of those packages do not work as expected. I will describe problems and, if possible, solutions in the following. All other packages are working corectly, provided that one sets their configurations as described in the Arch wiki.

Useful kernel modules

It is a good idea to add the following kernel modules to the '/etc/rc.conf' file like this:

MODULES=(.. cdc_acm phc-intel ..)
  • cdc_acm (If you have an build-in F3507g WWAN-Card)
  • phc-intel (Instead of acpi-cpufreq; provides voltage control; has to be installed from aur)
  • pciehp (Enable hotplugging for ExpressCards)
  • rfkill_input (Needed to use the Fn+F5 Shortcut. Workes not well, but does at least something ^^)

hdapsd

Thanks to aur it is very easy to make hdaps work with arch, because nearly can be downloaded and installed from aur.

The interesting packages may be:

  • hdapsd
  • tp_smapi

After installing these two packages a little bit of configuration is needed:

Add the following lines to '/etc/modprobe.d/modprobe.conf'

options thinkpad_ec force_io=1
options hdaps invert=1

(Taken from Install_Ubuntu_9.04_(Jaunty_Jackalope)_on_a_Thinkpad_T400#Active_Protection_System. Thanks to jango.)

The sensor can be configured with the file '/etc/conf.d/hdapsd'. I think it's a good value to set the sensitivity value a little higher than 15, for example 40 or 50.

#DEVICE='hda'
SENSITIVITY='50'
#ADAPTIVE='yes' 
SYSLOG='yes'    
#FORCE='yes' 

Scrolling with trackpoint

Again i refer to Install_Ubuntu_9.04_(Jaunty_Jackalope)_on_a_Thinkpad_T400#Scrolling_with_Trackpoint, so thanks again to jango.

You can use this configuration file as it is shown.

Suspend to RAM

First i tried the solution as described in the article Install_Ubuntu_8.10_(Intrepid_Ibex)_on_a_ThinkPad_T400#Suspend.2FHibernate. This worked quite well, but after the 10sec timeout the notebook fell asleep again. So there has to be a problem with the reactivation of the second cpu.

So i changed this script a little bit.

#!/bin/sh
# Workaround for concurrency bug in xserver-xorg-video-intel
# 2:2.4.1-1ubuntu10.
# Save this as /etc/pm/sleep.d/00CPU

. "${PM_FUNCTIONS}"

case "$1" in
	hibernate|suspend)
                echo 0 > /sys/devices/system/cpu/cpu1/online 
		;;
	thaw|resume) 
		/bin/cpuon&
		;;
	*)
		;;
esac

The file '/bin/cpuon':

#!/bin/bash
sleep 10
echo 1 > /sys/devices/system/cpu/cpu1/online

The important thing is to take the code which enables the second cpu-core (cpu1) and put it into an additional shell-script to start it in the background.

Xorg

If you try some X test like suggested on the Arch installation guide, you possibly won't get the correct output. In my case, no graphic interface at all (black screen). Do not desperate. Install the intel graphics driver, autoconfigure X like described in the wiki (including copying the xorg.conf file into the right folder), then add some Window Manager to your ~/.xinitrc (e.g. exec xterm) and execute startx. You should get the X interface.

It is possible that some MTRR error shows after killing X. This issue is described in some Gentoo forum, but does not seem to originate real problems.

Hint:
If you want to get some particular behaviour from X with input interfaces (keyboard language switch, Ctrl+Alt+Backspace, etc., remember that these features are handled by HAL now. Create/Modify the proper .fdi files in /etc/hal/fdi/policy/ accordingly.

ALSA

In my case, the mute key is working as expected (it mutes and does not unmute), but the volume keys are not working at all. I haven't figured out a general solution yet, but volume keys are correctly recognized both by hal and by Xorg. A small hack, working only in X, is the following.

Execute xev and check how your volume keys are seen by X. They should be XF86AudioRaiseVolume and XF86AudioLowerVolume, or similar. Now open the keybinding manager of your window manager (in my case, rc.xml in openbox) and bind as follows:

  • XF86AudioRaiseVolume --> amixer set Master 1%+ unmute
  • XF86AudioLowerVolume --> amixer set Master 1%- unmute

You can obviously choose the exact amount of volume change, in this example 1%.

Help needed
There should be a similar, but more general solution, since the keys are correctly seen by hal outside X. This solution is expected to work in TTYs too, and to be WM independent, both of which would be desirable.

Brightness keys

They're actually only working in X and not in the terminal. It is ok for me, but there should be a better solution.