Archive for March, 2009

Thinkpad R400

Monday, March 2nd, 2009

After years of service, I finally retired my trusty old Dell. The HD crashed, again, and I promised myself I would get a new laptop when it was time to replace the third disk. I also promised my next laptop would be a thinkpad, so I’m typing this on a Lenovo thinkpad R400. The budget model, it has a 14.1″ screen and coreduo processor, so I can go wild installing operating systems in vmware.

Mostly everything worked out of the box, but of course, the devil is in the details. Because Mandriva sales pissed me off recently, i decided to give debian a try. It is all the hype among geeks nowadays. What did not work right after I installed ‘lenny’ (yes, debian uses stupid mnemonic version names instead of numbers like sane people) was the wifi and suspend/resume. Yes, notorious items, I know.

Wireless was easily fixed by installing the latest linux kernel (2.6.28). However, the compiled version available from apt-get didn’t work out for me, because vmware needs the kernel headers and for some reason the debian team never got around to properly uploading those to the repositories. So, with some help I found out the procedure to create a debian package from a kernel source pulled from kernel.org:

  1. Download kernel into /usr/src (eg cd /usr/src ; wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.28.7.tar.bz2);
  2. Unpack (eg tar -jxvf http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.28.7.tar.bz2);
  3. Configure the kernel (I did so by a ‘make menuconfig’ and then importing the 2.6.26 configuration from /boot);
  4. Build it ‘the debian way’ (which is make-kpkg clean ; fakeroot make-kpkg –revision=custom.1.0 kernel_image);
  5. Now install the kernel (cd .. ; dpkg -i linux-image-2.6.28.7_custom.1.0_amd64.deb);
  6. Finally, you need to regenerate the initramfs (cd /boot ; mkinitramfs -o /boot/initrd.img-2.6.28.7 2.6.28.7);
  7. And upgrade grub (update-grub);
  8. Done!

So that worked nicely for me. One small bug remains: kernel crashes when I connect to an airport extreme wifi thingy. I blame Apple :)

On to suspend / resume. Suspend worked nicely, but on resume the backlight would not come on. I could see that the machine resumed and I tried various solutions to get the backlight lit again, in the end I found that a combination of chvt and vbetool did the trick. To make it work, I put the following content in /etc/pm/sleep.d/00LCD (the name is arbitrary, and you probably want to use something else than00 to start with):

#!/bin/sh
# Enable backlight after suspend

. “${PM_FUNCTIONS}”

case “$1” in
thaw|resume)
/usr/bin/chvt 1
/usr/sbin/vbetool post
/usr/bin/chvt 7
;;
*)
;;
esac

It is a bit of a hack, but it does the trick for me. I do a ‘chvt 1’ because according to man vbetool, you should do a ‘vbetool post’ only from console because it interferes with X.

So, i’m quite happy with my new laptop. The keyboard is comfortable, the touchpad has nice scrolling features, the on-board UMTS/HSDPA interface works like a charm and it is much faster than my previous laptop. I think it’s a keeper.

Flattr this