Debian Linux on Lenovo/IBM Thinkpad Z60m |
Last update: October 28th, 2007 |
I will try to install Debian 4.0 (Etch). Pre-installed Windows was already erased earlier, and I am using a new disk anyway now so I can play with the volume manager without overwriting my old system (yes, I am pessimistic and in the worst case, I wanted to be able to revert to Sarge within a few minutes by putting back the old hard disk).
Important bit of information: yes, it works and it works much better than Sarge. It's recommendable and installation is quite easy.
Be sure to check ThinkWiki for refrence, I will more or less list distro specific traps and solutions here.
I also installed Etch on a Thinkpad R60e.
Overview |
※ |
Model: | 2529-FKG |
Part: | UH3FKGE |
Not working out of the box in Sarge, but working out of the box in Etch: | xorg: no backports needed anymore, hard disk: SATA support now during installation, ethernet: driver is automatically detected, ethernet hotplugging: dhcp3, encrypted disk: may now be enabled during installation (incl. swap!), xdm, gdm, ..., beeping with loaded sound drivers: Doh! I need to disable this quickly! :-), |
Not working out of the box anymore in Etch: | closing the lid now blanks screen 1: acpi lid event |
Not working out of the box | CPU frequency scaling: enabling this is trivial, X with fglrx: enabling this is possible, some ThinkPad buttons: same solution as in Sarge, Wrong DPI settings under X11: same solution as in Sarge, |
Not working perfectly: | suspend to RAM usually works, but sometimes does not sleep and sometimes crashes or leaves screen blank when trying to wake up (needs more investigation). Further, with a docking station, it is unusable. |
Not working (yet): | docking station eject: there was no need in Sarge for this, since my Laptop did not suspend to RAM: I had to reboot anyway. Maybe I need to in Etch, too? |
Not yet checked | suspend to disk, bluetooth (I want this with SyncML), wlan, pcmcia, irda, firewire, svideo out, |
Kernel Modules |
※ |
To enable CPU frequency scaling and some Thinkpad features, edit /etc/modules and add:
nvram ibm_acpi cpufreq_conservative speedstep_centrino
X Driver |
※ |
X works out of the box with the free ati/radeon driver. Although fglrx must be installed manually, a matching driver is now part of the distro. Basically, you need to do this:
apt-get install fglrx-control fglrx-driver fglrx-kernel-src module-assistant prepare fglrx module-assistant a-i fglrx
Edit /etc/X11/xorg.conf to use the "fglrx" driver instead of "ati", then reboot.
I should note that I think that the proprietary fglrx driver is the cause of many unnecessary problems and instabilities (e.g. crashes during suspending and additional compilation trouble for kernel upgrades). If you don't need 3D acceleration, try using it without the kernel module (no DRI then). Why use it anyway? It is faster than ati/radeon, it works better with multiple screens, and it seems to make the GPU dissipate less power.
The graphics drivers for the R60e graphics work much better. If you can, prefer a laptop for which there are open source graphics drivers.
Hopefully ATI will fully support Linux one day.
ACPI Lid Event |
※ |
Some developers seem to have been a little over-aggressive handling the lid switch: when watching a film on screen 1 (e.g. on a projector) and closing the lid to blank a disturbing screen 0, then screen 1 now also blanks spoiling the fun of watching a film on it a bit...
Since in Sarge the lid switch triggered blanking worked perfectly for watching films -- disabled screensaver, blank screen 0, working screen 1 -- I decided to cut off all smart handling of the lid switch and to disable the ACPI script for it completely. You might decide to do something less radical, but I added the following line just after #!/bin/bash in /etc/acpi/lid.sh:
exit 0
Graphical Booting |
※ |
There are potentially four things to set up to have graphical booting from power-up to display manager login screen:
- BIOS splash screen
- GRUB background
- Console background
- Display manager background
I think for this installation, I want all four to be defined by myself.
This section will show how to set up the four things in the order of ascending difficulty which probably coincides with ascending danger of seriously breaking the boot sequence...
Preparations |
※ |
I started by creating a theme folder in /boot/theme which has subdirs for each possible theme and one link /boot/theme/current pointing to the selected subdir.
The goal is to switch a boot theme by simply changing the /boot/theme/current link.
It's not as easy as that, however, since some of the steps need additional updating after that link is changed, mainly because they cannot access the boot partition: the BIOS, the kernel in its initial boot-up phase. Anyway, this setup is neat and tidy.
Display Manager |
※ |
This is probably the easiest thing. I use XDM, so I edited /etc/X11/xdm/Xsetup to load the background image (of size 1680x1050) for the login screen:
xli -onroot /boot/theme/current/xdm.jpg
Then I edited /etc/X11/xdm/Xstartup and added a line for the background to install when the user logs in -- the welcome image:
xli -onroot /boot/theme/current/xdm-log-in.jpg
More can be done, of course. It's up to your phantasy.
GRUB |
※ |
Grub is prepared for a splash screen and Debian recognises this by the presence of /boot/grub/splash.xpm.gz. So the first thing was to add a link to the theme file:
ln -s ../theme/current/bootsplash.xpm.gz /boot/grub/splash.xpm.gz
Now, make a boot splash screen. It must be a gzipped XPM file at 640x480 pixels with maximally 14 colours. You can use The Gimp to make such an image (use scale, then convert to indexed with 14 colours). Save it as bootsplash.xpm.gz in your theme folder so that /boot/grub/splash.xpm.gz points to it.
When you design the image, note that 640x480 is 4:3 aspect ratio, while the image will be displayed in a 16:10 aspect ratio. Design the image accordingly (e.g. by first drawing at a higher solution with 16:10 aspect ration and then scaling down to 640x480).
Well, that's basically it. Let Debian add the splash screen to menu.lst by running:
update-grub
It should tell you that it found a splash screen for grub.
Graphical Console |
※ |
You need to recompile the kernel. Yes, unfortunately, the necessary bootsplash patch is not in the standard Debian kernel. No idea why -- it seems nowadays all major distros have it and there are even bootsplash themes among the standard Debian packages, so everything is well-prepared. Only the kernel patch is missing.
Anyway, it's not too hard to compile a kernel with Debian. First, install all the necessary stuff (kernel sources, kernel compilation tools, bootsplash packages):
cd /usr/src apt-get install linux-source-2.6.18 kernel-package apt-get install linux-patch-bootsplash bootsplash bootsplash-theme-debian tar xjvpf linux-source-2.6.18.tar.bz2
Maybe more stuff to install? I forget. Well, you will see. :-)
To compile a patched kernel with the same settings as the binary vanilla kernel, do the following (I assume you installed the 686 kernel variant, otherwise the cp is slightly different):
cd /usr/src/linux-source-2.6.18 ../kernel-patches/all/apply/bootsplash cp /boot/config-2.6.18-4-686 .config make oldconfig # this asks you one question: answer 'y' for bootsplash support make-kpkg clean make-kpkg --rootcmd fakeroot --append-to-version -4-splash --revision 1.ht --initrd kernel_image
You might want to adjust the revision to make the kernel look more individually you. :-)
After a while the kernel image will have materialised. You can now install it (this keeps your old kernel, in case something went wrong):
cd /usr/src dpkg -i linux-image-2.6.18-4-splash_1.ht_i386.deb
Replace the 1.ht (the revision) if you changed it.
Now, edit /etc/grub/menu.lst to switch to VESA mode when booting, which is required for the boot splash. The corresponding line in should read:
# defoptions=vga=791 splash=verbose
Note that it is in a comment. It will be read by update-grub and added to the standard kernel parameters. So run that tool now:
update-grub
BTW, vga=791 selects a resolution of 1024x768x16.
Check that grub is configured well (by checking /boot/grub/menu.lst again), cross fingers, and reboot. A Debian boot theme should now be used.
You can customise it in /etc/bootsplash/... (I added links to /boot/theme/... so that I can configure this in that directory, too. After each customisation, re-create the RAM-fs images so that the changes will be visible to the kernel at startup:
update-initramfs -u
BTW, as you are compiling the kernel, you might take the opportunity to add more patches and tweak the settings a little. I am thinking about kernel-patch-exec-shield, for example. I also changed 1 kernel option (by running make xconfig after make oldconfig): the CPU type is now Pentium M.
BIOS Image |
※ |
To be continued. In short: you need to flash a patched BIOS.