Installing Debian Sid (October 2008) on a ThinkPad X200

From ThinkWiki
Revision as of 17:34, 10 January 2010 by Rdemaria (Talk | contribs) (Suspend)
Jump to: navigation, search

Introduction

Amazing machine: light, quiet, large battery life, ideal for travels, great value for money compared to X200T and X300.


Creating installation device

The X200 has no cd/dvd but can boot from USB. On the X200 BIOS settings, the USB disk boot option needed to be raised to be used first. Using F1 at boot gives access to the BIOS.

I created an USB bootable iso from another linux installation. I had an usb stick with a FAT32 partition on /dev/sdc1. I dowloaded the boot and iso file and installed the image using:

 wget http://people.debian.org/~joeyh/d-i/images/daily/hd-media/boot.img.gz
 wget http://cdimage.debian.org/cdimage/daily-builds/daily/arch-latest/i386/iso-cd/debian-testing-i386-netinst.iso
 zcat boot.img.gz >/dev/sdc1
 mkdir /mnt/sdc1
 mount /dev/sdc1 /mnt/sdc1
 cp debian-testing-i386-netinst.iso /mnt/sdc1

The boot stick will use the network to install the package but a more complete ISO image can be dowloaded.

The wifi will not work (see Installing_Debian_on_an_X200) but the Ethernet card will. In theory it should be possible build custom Debian Live USB stick, using the latest package and install from there, I didn't manage so far.

Sid installation

To install sid use the expert installation support and choose unstable for the repository.


Backup hard drive data

In order to save the hard drive content, I created complete hard drive image on another hard disk. During the installation procedure I activated another shell with CTRL-ALT-F3, mounted an external HD (/dev/sdb1) and copied the image with:

 mkdir /mnt/sdb1
 mount /dev/sdb1 /mnt/sdb1/
 dd if=/dev/sda of=/mnt/sdb1/sda-image

In principle partimage is better option but the installation image does not have it. Also gzipping the partition on the fly would have bin better, but the gzip or bzip2 were not present. Using a custom Debian Live installation image would solve the problem.

Kernel

Some kernel options here for /boot/grub/menu.lst:

 # kopt=root=/dev/sda1 ro acpi_sleep=s3_bios vga=0x0368 video=vesafb

Update the real items using

 update-grub

or

 update-grub2

if you are using grub2.

vga parameters does not work in grub2. To see the boot process on high resolution modify the file

 /etc/grub.d/00_header

adding the line

 set gfxpayload=keep

just after

 set gfxmode=${GRUB_GFXMODE}

Video

Intel drivers 2.9.1-2 appears to work well on a sid system.

Some options are necessary in xorg.conf:

 $ awk '!/#/ {print " ",$0}' /etc/X11/xorg.conf
 Section "Screen"
         Identifier      "Default Screen"
         Monitor         "Configured Monitor"
         Defaultdepth    24
         SubSection "Display"
                  Modes           "1280x800"
                  Virtual    2560 1280
         EndSubSection
 EndSection
 
 
 Section "Monitor"
         Identifier      "Configured Monitor"
         DisplaySize     231 233.5
 EndSection
  
 Section "Monitor"
         Identifier      "HDMI-1"
         Option          "Ignore" "True"
 EndSection
  
 Section "Monitor"
         Identifier      "HDMI-2"
         Option          "Ignore" "True"
 EndSection
 
 Section "Device"
         Identifier      "Configured Video Device"
           Driver          "intel"
         Option          "monitor-HDMI-1" "HDMI-1"
         Option          "monitor-HDMI-2" "HDMI-2"
 EndSection

Fonts

Default fonts are a bit ugly. Things get better by creating some symbolic link:

 cd /etc/fonts/conf.d
 ln -s ../conf.avail/10-autohint.conf
 ln -s ../conf.avail/10-sub-pixel-rgb.conf
 ln -s ../conf.avail/70-no-bitmaps.conf

For GTK and Firefox

Fonts size are too large. Solution:

 $cat ~/.gtkrc-2.0
 # -- THEME AUTO-WRITTEN DO NOT EDIT
 include "/usr/share/themes/Industrial/gtk-2.0/gtkrc"
 
 include "/home/rdemaria/.gtkrc-2.0.mine"
 
 # -- THEME AUTO-WRITTEN DO NOT EDIT
 $cat ~/.gtkrc-2.0.mine
 gtk-font-name = "Sans 8"

Bold font are also ugly on xvrt (in xterm the bold font control seems always broken). See below for the solution.

Terminal

I tried several terminals. But I found rxvt-unicode the easiest and fastest. This resources allow 4 terminals in one window. Bold font (unreadable to me) are disabled.

 $cat ~/.Xresources
 rxvt*cutchars: \$:[]
 rxvt*visualBell: true
 rxvt*foreground: white
 rxvt*background: black
 rxvt*geometry: 80x27
 rxvt*jumpScroll: true
 rxvt*skipScroll: true
 rxvt*scrollBar: false
 rxvt*boldFont:
 rxvt*boldItalicFont:
 rxvt*saveLines: 9096
 rxvt*mouseWheelScrollPage: false

Wifi

It should work out of the box.

For 2.6.27 kernels put in the /etc/apt/source.list

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

Installed linux-image-2.6.27-1 and firmware

 wget http://intellinuxwireless.org/iwlwifi/downloads/iwlwifi-5000-ucode-5.4.A.11.tar.gz
 tar xvfz iwlwifi-5000-ucode-5.4.A.11.tar.gz
 cp  iwlwifi-5000-ucode-5.4.A.11/iwlwifi-5000-1.ucode /lib/firmware
 aptitude install linux-image-2.6.27-1-686 hal

Suspend

Suspend to disk works using the button Fn+F12.

Suspend to ram works using the button Fn+F4. Sometime wlan is no reconnected.


Using vesa driver, it works if the i915 driver is installed. I put the line:

 modprobe i915

in /etc/rc.local.

Sound

Everything works, but in a strange way. The hardware volume control is managed by acpi

 $ cat /proc/acpi/ibm/volume
 level:          8
 mute:           off
 commands:       up, down, mute
 commands:       level <level> (<level> is 0-15)

The mute button is linked to the mute command, but volume up and down are passed to X with keycode 122 123. I thought that acpi was intercepting the key and send them to X using fakekey. I played in /etc/acpi/events but I didn't managed to change the behavior.

Skype

Everything works downloading the skype version for Etch. After suspending and resuming the video does not work anymore. The error message is:

 Skype V4L2: Could not find a suitable capture format

Several people propose to update the uvcvideo driver.

 svn checkout http://svn.berlios.de/svnroot/repos/linux-uvc/
 cd linux-uvc/linux-uvc/trunk/
 make
 make install
 modprobe uvcvideo

But I didn't tried yet cause I'm still using the experimental kernel that does not come with packages for compiling modules.

GTK and Firefox

Font size is too large. Solution:

 $cat /home/rdemaria/.gtkrc-2.0
 # -- THEME AUTO-WRITTEN DO NOT EDIT
 include "/usr/share/themes/Industrial/gtk-2.0/gtkrc"
 
 include "/home/rdemaria/.gtkrc-2.0.mine"
 
 # -- THEME AUTO-WRITTEN DO NOT EDIT
 $cat /home/rdemaria/.gtkrc-2.0.mine
 gtk-font-name = "Sans 8"

Printer and scanner

Usb printer and scanner (HP Officejet J4580) works perfectly using cups, hpoj, xsane, hplib.


RAM upgrade

My X200 came with 2G of ram and 1 free slots. I bought:

  Crucial 2GB 204-Pin DDR3 SO-DIMM DDR3 1066 (PC3 8500) Laptop Memory Model CT25664BC1067 - Retail

installed and replace the kernel with a bigmem one.

Hard disk upgrade

My X200 came with a 160GB hardrive. I bought the 500GB hard drive

  Western Digital Scorpio Blue WD5000BEVT 500GB 5400 RPM SATA 3.0Gb/s Notebook Hard Drive - OEM

and the adapter

 Link Depot USB2-SATA USB2.0 TO IDE/SATA Adapter Cable - Retail

for transfer the data.

I connected the new hard drive using the usb port. The drive was recognized as /dev/sdb. I create the partitions that reads:

 $ sfdisk -d /dev/sdb
 # partition table of /dev/sdb
 unit: sectors
 /dev/sdb1 : start=       63, size= 71553447, Id=83
 /dev/sdb2 : start= 71553510, size=905214555, Id= 5
 /dev/sdb3 : start=        0, size=        0, Id= 0
 /dev/sdb4 : start=        0, size=        0, Id= 0
 /dev/sdb5 : start= 71553573, size=894467007, Id=83
 /dev/sdb6 : start=966020643, size= 10747422, Id=82

Then made the filesystem and copy the files:

 $ sudo mkfs.ext3 /dev/sdb1
 $ sudo mkfs.ext3 /dev/sdb5
 $ sudo mkswap    /dev/sda6
 $ sudo mount /mnt/sdb1
 $ sudo mount /mnt/sdb5
 $ sudo rsync -a --delete \
 --exclude /mnt/sdb1 \
 --exclude /mnt/sdb5 \
 --exclude /home \
 --exclude /proc \
 --exclude /sys \
 --exclude /lib/init/rw \
 --exclude /dev \
 / /mnt/sdb1
 $ cd /mnt/sdb1; mkdir /home /proc /sys /lib/init/rw /dev; cd 
 $ sudo rsync -a /home/ /mnt/sdb5
 $ sudo umount /mnt/sdb5; sudo umount /mnt/sdb1

Finally install grub

 $ sudo grub --no-floppy
 $ geometry (hd1)
 > root (hd1,0)
 > setup (hd1)
 > quit

and replace the disk. (I tried to boot from the usb to check the new hard drive, but I messed up the old installation...)

For some reason the suspend to disk was not working anymore. But

 $ sudo aptitude reinstall uswsusp

fixed the problem answering yes to use the swap disk.

Keyboard

In recent versions of xserver (as of version 1.4.0.90-7) keyboard-layout is handled by hal, so settings done will be overridden. Settings should be put in:

  /etc/default/console-setup

For a double layout us, us(intl) I put:

 XKBMODEL="pc104"
 XKBLAYOUT="us,us(intl)"
 XKBVARIANT=""
 XKBOPTIONS="compose(lwin),compose(rwin),grp:shifts_toggle,grp_led:scroll"

Special keys

Some keys are intercepted by X Windows. The keycodes are

 151 XF86WakeUp Fn
 167 XF86Forward
 166 XF86Back
 122 XF86AudioLower
 123 XF86AudioRaiseVolume


Mute switch the hardware volume which is not controlled by ALSA.

ACPI links suspend to ram and to disc to Fn+F4 and Fn+F12 respectively. Screen brightness, thinklight, bluetooth works as well.

In fluxbox I used for:

 ".fluxbox/keys"


 Menu  :Exec rxvt
 Shift Menu :Exec fbrun
 XF86Forward  :NextWorkspace
 XF86Back  :PrevWorkspace
 F86AudioRaiseVolume :Exec amixer sset Master,0 1+
 XF86AudioLowerVolume :Exec amixer sset Master,0 1-

Trackpoint

As for the keyboard, options are not handled anymore from xorg.cong. Apparently we are in a transition period and HAL is soon to be deprecated. As of Jan 10 2010 this is what works on my system.

The output of

 $ lshal|grep input.product
 input.product = 'Video Bus'  (string)
 input.product = 'ThinkPad Extra Buttons'  (string)
 input.product = 'Lid Switch'  (string)
 input.product = 'ACPI Virtual Keyboard Device'  (string)
 input.product = 'Sleep Button'  (string)
 input.product = 'Power Button'  (string)
 input.product = 'PC Speaker'  (string)
 input.product = 'PS/2 Generic Mouse'  (string)
 input.product = 'AT Translated Set 2 keyboard'  (string)
 input.product = 'HDA Intel Headphone'  (string)
 input.product = 'HDA Intel Headphone'  (string)
 input.product = 'UVC Camera (17ef:480c)'  (string)

So to enable scrooling and emulate third button (e.g. to change view in blender) edit:

 /etc/hal/fdi/policy/mouse-wheel.fdi

as

<match key="info.product" string="PS/2 Generic Mouse">
<merge key="input.x11_options.EmulateWheel" type="string">true</merge>
<merge key="input.x11_options.EmulateWheelButton" type="string">2</merge>
<merge key="input.x11_options.EmulateWheelTimeout" type="string">250</merge>
<merge key="input.x11_options.XAxisMapping" type="string">6 7</merge>
<merge key="input.x11_options.YAxisMapping" type="string">4 5</merge>
<merge key="input.x11_options.ZAxsisMapping" type="string">4 5</merge>
<merge key="input.x11_options.Emulate3Buttons" type="string">true</merge>
</match>

For updated information look at How_to_configure_the_TrackPoint.

TO BE CONTINUED