Installing Debian 5.0 (Lenny) on a ThinkPad X200

From ThinkWiki
Revision as of 07:22, 8 December 2008 by Harrisonts (Talk | contribs) (Video Card)
Jump to: navigation, search

These instructions are written with Debian testing (currently lenny) in mind, though they are probably reasonably accurate for stable or unstable too.

Installation

Windows Installer

This laptop is free from legacy devices such as CD/DVD so installation is a bit trickier than the average laptop. I first attempted to install using the Goodbye Microsoft installer from Vista. To get the menu visible in the Vista version I used I had to type this into a priviliged cmd.exe:

bcdedit.exe /timeout 5

A couple of reboots later I gave up on this method as the menu item refused to boot with the reason that it couldn't find the "\g2lbr.mbr" file, or that it might be corrupt. Before giving up I tried changing this path. This can be done by issuing:

bcdedit.exe 

This will print all the boot alternatives. You'll see a long id-hash associated with the Debian Installer. Grab that and go ahead with the next:

bcdedit.exe /set {the-long-id-hash} path WHAT-YOU-BELIVE-IS-CORRECT

I tried changing this to "c:\g2lbr.mbr" as that's where the file is located, but without any luck.

USB CD

Next up.. I grabbed a legacy-device, USB DVD drive ;). Netinst went fine and after booting up the system I installed the 2.6.26 package from a USB stick and ethernet was up and running. I'm still fighting with X and wifi, so I'll update this page later.

USB Memory Stick

This is probably the smoothest way of installing. Lenny now has 2.6.26 as the installer image so ethernet works out of the box. Details on how to gett the lenny installer on a memory stick can be found here.

PXEBoot

PXEBoot is also an option, though the Debian installer uses too old a kernel to recognize any of the X200's network devices. My workaround was to PXEBoot the Debian installer using the integrated ethernet, and after boot plug directly into my cable router's USB interface. I can provide a more thorough how-to if there is a request.

TODO
Verify the rumor that Debian installer now supports X200's ethernet adapter and write a PXEBoot HOWTO that recognizes this.

Ethernet

Ethernet works after upgrading to version 2.6.26 of the Linux kernel.

[    1.533055] eth0: (PCI Express:2.5GB/s:Width x1) 00:1f:16:06:ee:ec
[    1.533055] eth0: Intel(R) PRO/1000 Network Connection
[    1.533055] eth0: MAC: 5, PHY: 8, PBA No: 1008ff-0ff

Wireless

Still haven't got wifi to work. It should be possible to use the 2.6.26 version of the kernel together with 'iwlagn' wifi driver from:

git-clone git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/compat-wireless-2.6-old.git

The firmware can be found here:

http://intellinuxwireless.org/iwlwifi/downloads/iwlwifi-5000-ucode-5.4.A.11.tar.gz

And should be put in '/lib/firmware/'

I tried building this but it turned out to be a nasty soup of missing symbols so I continued to look for a faster fix. A while later I found that the Debian Kernel Team kindly provided an apt source with snapshots of the latest kernel, bingo!

 deb http://kernel-archive.buildserver.net/debian-kernel trunk main 

Unfortunatly this didn't do the trick either. I can now see the device in dmesg, and even in ifconfig, and even browse wireless networks with iwlist, but it's not usable yet, no idea why.. maybe my wpa_supplicant-fu is too weak. There is also an issue with the driver not exposing the device type correctly to the OS so programs such as NetworkManager identifies the device as a regular wired ethernet device.

Bug filed against Debian Hal package, found here.

<DEPRECATED>The problem had been fixed after Hal 0.5.11 was released, so it was just a matter of backporting those changes and the wifi card was finally detected correctly by network manager. Until a new package hits Sid you can use my packages on your own risk if you so chose.</DEPRECATED>

As of 0.5.11-4 wireless is properly detected.

Atheros Chipset

If your X200 has the Atheros wireless chipset (check with lspci), you need a different fix.

Debian lenny ships with the new nonproprietary Atheros driver ath5k enabled by default, but this driver does not yet support the card in the X200. You'll still have to use the nonfree madwifi driver.

Make sure you have enabled non-free repositories in /etc/apt/sources.list and # apt-get install module-assistant. Run # module-assistant as root, select madwifi, and compile and install it.

The madwifi package should include a file /etc/modprobe.d/madwifi which prevents the ath5k module from loading, but if madwifi does not appear to work on reboot, the first thing to check is if there is a line 'blacklist ath5k' in a file within /etc/modprobe.d/.

If you load ath_pci, you'll find two network devices, wifi0 and ath0. Madwifi allows you to create multiple virtual network cards (see man wlanconfig), but if you are content with just one, you can safely ignore wifi0 and manipulate ath0 with iw- and ifconfig.

NOTE!
Network Manager seems to have trouble with WEP/WPA. Use wicd instead to fix this.

Video Card

The Intel 4500MHD needs a newer Xorg driver (v2:2.4.2-1) than available in Sid so I had to install from experimental:

$ cat /etc/apt/preferences 
Package: *
Pin: release a=experimental
Pin-Priority: 101

$ cat /etc/apt/sources.list | grep experimental
deb http://ftp.port80.se/debian/ experimental main
deb-src http://ftp.port80.se/debian/ experimental main

$ sudo aptitude update

$ sudo aptitude -t experimental install xserver-xorg-video-intel

With this in place, it's only a matter of updating Xorg to have something like this:

Section "Device"
        Identifier      "Configured Video Device"
        Driver          "intel"
EndSection

And something like this:

Section "Screen"
        Identifier      "Default Screen"
        Monitor         "Configured Monitor"
        Defaultdepth    24
        SubSection "Display"
                Modes           "1280x800"
        EndSubSection
EndSection

Tada... accelerated X.. although there seems to be some issue with the resolution. The right side of the desktop is a tiny bit outside of the LCD display. Haven't investigated much.

There are also two completly useless devices that causes issues with using an external monitor:

Section "Device"
	Identifier	"Configured Video Device"
	Option		"monitor-HDMI-1" "HDMI-1"
	Option		"monitor-HDMI-2" "HDMI-2"
EndSection
 
Section "Monitor"
	Identifier	"Configured Monitor"
EndSection
 
Section "Monitor"
	Identifier	"HDMI-1"
	Option		"Ignore" "True"
EndSection
 
Section "Monitor"
	Identifier	"HDMI-2"
	Option		"Ignore" "True"
EndSection

Console

The console defaults to a smaller display resolution than the X200's native resolution of 1280x800. The fix this, add the argument vga=0x0368 to the "# defoptions" line of your /boot/grub/menu.lst and remember to # update-grub.

Trackpoint

The integrated orgasmic educator works out of the box.

[    8.516313] IBM TrackPoint firmware: 0x0e, buttons: 3/3
[    8.536456] input: TPPS/2 IBM TrackPoint as /class/input/input9

See How to configure the TrackPoint for further tweaks.

Web Camera

The built-in webcam works out of the box.

[    8.004081] uvcvideo: Found UVC 1.00 device <unnamed> (17ef:480c)
[    8.004361] input: UVC Camera (17ef:480c) as /class/input/input8
[    8.010590] usbcore: registered new interface driver uvcvideo
[    8.010594] USB Video Class driver (v0.1.0)
NOTE!
V4L2 works out of the box, but V4L does not appear to support this camera.

Fingerprint Reader

This laptop uses the new Fingerprint reader that's currently missing a driver in libfprint. As this is the same reader that is used in a heap of other laptops it will probably not take that long until it works.

Thread: http://www.mail-archive.com/fprint@reactivated.net/msg00781.html

[    3.811560] usb 2-1: configuration #1 chosen from 1 choice
[    3.813590] usb 2-1: New USB device found, idVendor=08ff, idProduct=2810
[    3.813593] usb 2-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[    3.813595] usb 2-1: Product: Fingerprint Sensor

HSDPA Modem

Here's some dmesg output:

[    4.332132] usb 8-4: new high speed USB device using ehci_hcd and address 2
[    4.518071] usb 8-4: configuration #1 chosen from 2 choices
[    4.558431] usb 8-4: New USB device found, idVendor=0bdb, idProduct=1900
[    4.558434] usb 8-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    4.558436] usb 8-4: Product: Ericsson F3507g Mobile Broadband Minicard Composite Device
[    4.558438] usb 8-4: Manufacturer: Ericsson
[    4.558440] usb 8-4: SerialNumber: ............

Detailed lsusb output can be found here.

$ cu -l /dev/ttyACM0 
Connected.
AT+CFUN=1
OK
AT+CPIN="YOUR-PIN-CODE-GOES-HERE"
OK
*EMWI: 1,0
+PACSP0

If you want a GUI to connect to the intartubes a newer version of Network Manager with ppp support can be found here:

deb http://debs.michaelbiebl.de/network-manager ./

But then you realise that not even a newer Network Manager helps and you resort to using wvdial:

[Dialer Defaults]
Init1 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = Analog Modem
Baud = 460800
New PPPD = yes
Modem = /dev/ttyACM0
ISDN = 0
Dial Command = ATDT
Phone = *99#
Username = username
Password = password
Init4 = AT+CGDCONT=1,"IP","internet.telenor.se"

Is what I'm using right now on the train. \o/

ACPI Power Management

Haven't tried any PM yet but here's what the kernel has to say. The error might be caused by me not having any docking station, just a guess though.

[    7.610770] ACPI: \_SB_.PCI0.SATA.PRT1: found ejectable bay
[    7.610770] ACPI: \_SB_.PCI0.SATA.PRT1: Adding notify handler
[    7.610770] ACPI: Error installing bay notify handler
[    7.621495] thinkpad_acpi: ThinkPad ACPI Extras v0.20
[    7.621495] thinkpad_acpi: http://ibm-acpi.sf.net/
[    7.621495] thinkpad_acpi: ThinkPad BIOS 6DET28WW (1.05 ), EC 7XHT21WW-1.03
[    7.621495] thinkpad_acpi: Lenovo ThinkPad X200, model 74585MG
[    7.625495] thinkpad_acpi: radio switch found; radios are enabled
[    7.625495] thinkpad_acpi: This ThinkPad has standard ACPI backlight brightness control, supported by the ACPI video driver
[    7.625495] thinkpad_acpi: Disabling thinkpad-acpi brightness events by default...
[    7.629495] Registered led device: tpacpi::thinklight
[    7.629495] Registered led device: tpacpi::power
[    7.629495] Registered led device: tpacpi:orange:batt
[    7.629495] Registered led device: tpacpi:green:batt
[    7.629495] Registered led device: tpacpi::dock_active
[    7.629495] Registered led device: tpacpi::bay_active
[    7.629495] Registered led device: tpacpi::dock_batt
[    7.629495] Registered led device: tpacpi::unknown_led
[    7.629495] Registered led device: tpacpi::standby

Suspend To RAM

After upgrading Xorg to experimental and enabling the intel driver (v2:2.4.2-1) suspend to ram started to work (should have tried from console to start with *doh*). The only problem is now that X kind of hangs, still closable with ctrl+alt+backspace which wasn't the case with the intel driver from Sid. After a restart of X everything is back to normal, wifi still works etc. Humm... that problem with X seems unpredictable, last time I suspended it worked perfectly.

Suspend (or more specifically resumes) can indeed be unpredictable. Bug #17807 over at the FreeDesktop.org bugzilla describes similar (if not identical) symptoms and also provides a couple of solutions:
  • Set Option "NoAccel" "true" in the Device section of your xorg.conf. The disadvantage is, of course, you get no hardware acceleration. Still not that slow, though.
  • Take one of the CPU cores offline before suspending and bring it back online a few seconds after resuming. See Install Ubuntu 8.10 (Intrepid_Ibex) on a Thinkpad_T400#Suspend/Hibernate for a method.
I find the second method to work great. It's not noticable in everyday use and works well in a hibernate scriptlet. –Jtmorken 22:37, 17 November 2008 (CET)

Copy following code into /etc/hibernate/scriptlets.d/cpu to use the second method

AddSuspendHook 00 cpuSuspend
AddResumeHook 00 cpuResume

cpuSuspend() {
    for i in /sys/devices/system/cpu/cpu*/online ; do
        echo 0 > $i
    done
    return 0
}

cpuResume() {
    for i in /sys/devices/system/cpu/cpu*/online ; do
        echo 1 > $i
    done
    return 0
}

Suspend To Disk

Works out of the box.

TODO
And if it doesn't work out of the box...