Installing OpenSuse 11 on an X61 Tablet

From ThinkWiki
Revision as of 05:22, 27 July 2008 by Timbelina (Talk | contribs) (Packages and updates)
Jump to: navigation, search

Installing OpenSuSE on the Lenovo X61 tablet

Please note: This is a work in progress.  I'm new to both the X61 and public-Wiki editing, so please excuse the mess until I get sorted :-)

This page describes how I configured OpenSuSE 11 on my new X61 tablet. Note: My config settings may not work for you; they may even break your computer or cause your hair to fall out so I disclaim any responsibility for any problems which may occur as a result of you reading this document.

OK. My tablet has an Intel(R) Core(TM)2 Duo CPU L7500 @ 1.60GHz, 4GB RAM, and an Intel 965 GM card that I've configured to run at 1400x1050 with 24-bit colour. I have installed OpenSUSE 11, currently running 2.6.25.11-0.1-default kernel.

Most of the installation is trivial, but there are a couple of things that I had to spend time on, including:

1. Encrypted HDD (everything except /boot)
2. The Wacom tablet and tablet buttons
3. An external monitor
4. A Telstra 3G wireless Internet card
5. Gimp and pressure-sensitive lines
6. VMWare server

I've described my experience with these points in more detail below.

Packages and updates

I added the following packages to the default installation:

1. KDE3 and KDE4.  KDE4 looks great, but I hit some screen-refresh failures when using xrandr. I'll come back to KDE4 it one day, but I run KDE3.4 now. 
2. Most of the laptop packages.  In particular, the packages for kpowersave, xournal, jarnal, xvkbd.

Then update everything. This might sound obvious, but there is lots of great development work going on so make sure you have the latest version of everything before starting.

Encrypted HDD

I followed the excellent instructions from the "How to set up an encrypted root file system with SuSE" page. The only thing I would add is that kernel updates will result in changes to the kernel minor version number. YaST rewrites the /boot/grub/menu.lst file to reflect that change whenever a kernel update occurs, and this of course means that your custom Grub menu entry will be lost. I have written a backup menu.lst file in /boot, just in case I forget to re-edit the file one day following a kernel update; all I'll have to do then is copy it back and manually change the kernel version number, after booting from a rescue disk.

In case its of use, here is my current /boot/grub/menu.lst file:

# Modified by YaST2. Last modification on Thu Jul 24 12:43:09 EST 2008
default 0
timeout 8
gfxmenu (hd0,0)/message
##YaST - activate
title OpenSUSE 11.0 - ENC
   root(hd0,0)
   kernel /vmlinuz-2.6.25.11-0.1-default root=/dev/mapper/root luks_root=/dev/sda3 luks_swap=/dev/sda2 luks_home=/dev/sda4 luks="root swap home" vga=0x317 resume=/dev/mapper/swap splash=silent showopts
   initrd /initrd-2.6.25.11-0.1-default
###Don't change this comment - YaST2 identifier: Original name: linux###
title openSUSE 11.0 - 2.6.25.11-0.1
   root (hd0,0)
   kernel /vmlinuz-2.6.25.11-0.1-default root=/dev/disk/by-id/scsi-SATA_WDC_WD1600BEVS-_WD-WXE208AY4245-part4 resume=/dev/sda2 splash=silent showopts vga=0x317
   initrd /initrd-2.6.25.11-0.1-default

Last up, I have a plan to use Samhain to check the integrity of /boot, since it is not encrypted and could be modified if an attacker gets his/her hands on my laptop. I haven't done that yet, but I've used Samhain before, and it is very good and easy to use.

The Wacom tablet and stylus

This pretty much works out of the box with OpenSuSE 11.

To configure the tablet and stylus, I used YaST to fire up SaX2. From there I edited my "Card and Monitor" properties as follows:

1. Check my card was set to "Intel 965 GM".
2. My monitor is set to "LEN LENOVO LCD MONITOR".
3. Resolution is set to 1400x1050 (SXGA+) with 16.7Mio.[24 bit] colours.
4. Under the "Tablet" section of SaX2, I set the tablet to "Lenovo X61 TABLET PC (Serial)".
5. Under the same tab, check the "Activate this tablet" box.
6. Under the "Electronic Pens" tab, check the "Add Pen" and "Add Eraser" boxes.
4. I have an external 19" Benq monitor, and I have that configured with cloned multi-head, at 1280x1024.

External monitor screen-size bug

I had a problem with SaX and my external monitor in that, irrespective of what Dual Head settings I used, the external monitor display was too large for the screen, and I could not get it to fit correctly. The SaX2 test looked fine, but upon restart, the external monitor changes appear to not have stuck. I couldn't fix this with SaX2, but I did sort it out with krandrtray simply by checking the "Unified outputs" option; once that is set to "Yes", the external monitor resolution was perfect. Note that the "Unified outputs" option only appears when the external monitor is connected.

Hardware acceleration bug

There is also a bug with hardware acceleration which I only hit when rotating the screen so alas, that means no Compiz and no 3D hardware acceleration. The bug appears when I rotate the screen (see below) and 3D hardware acceleration is switched on. In that case, the screen blanks out during rotation, and then the X server crashes and restarts. So, I switched off hardware acceleration in SaX2.

Rotating the tablet

I followed the excellent instructions at this other ThinkWiki page and, with some minor changes, came up with the file below, which I saved to /usr/local/bin/xrotate:

#!/bin/sh

output=LVDS
if [ "$XROT_OUTPUT" ]
then
        output=$XROT_OUTPUT;
fi
devices="Mouse[3] Mouse[5]"

geomnbr=0
xrandr=normal
wacom=normal
if [ "$1" == "-" ] || [ "$1" == "+" ] || ! [ "$1" ];
then
        operator="$1";
        [ "$1" ] || operator='+';
        case `xrandr --verbose | grep "^$output " | sed "s/^[^ ]* [^ ]* [^ ]* ([^(]*) \([a-z]*\).*/\1/"` in
                normal)         geom=0;;
                left)           geom=1;;
                inverted)       geom=2;;
                right)          geom=3;;
        esac
        let geom=${geom}${operator}1+4
        let geom=${geom}%4
else
        geom="$1"
fi

case $geom in
        1)      wacom=2; xrandr=left ;;
        2)      wacom=3; xrandr=inverted ;;
        3)      wacom=1; xrandr=right ;;
        *)      wacom=0; xrandr=normal ;;
esac

if xrandr --output "$output" --rotate "$xrandr"; then
        for d in $devices
        do
                xsetwacom set $d Rotate "$wacom"
        done
fi

I then added the following files:

/etc/acpi/events/swiveldown

#
# called when tablet screen swivels down (into tablet mode)
event=ibm/hotkey HKEY 00000080 00005009
action=/usr/local/bin/xrotate +

/etc/acpi/events/swivelup

#
# called when tablet screen swivels up (into tablet mode)
event=ibm/hotkey HKEY 00000080 00005009
action=/usr/local/bin/xrotate +

/etc/acpi/events/acpid_thinkpad_hotkeysevent=ibm/.*

event=ibm/.*
action=/usr/lib/hotkey-setup/thinkpad_hotkey_handler "%e"

There are no other files in the /etc/acpi/events directory, except for the two screen-brightness ones described below. All files in that dir are owned by root, and are chmod 644.

Restart acpid with :

# /etc/init.d/acpid restart

And that's it! Active screen rotate!

Must go back to work!

I'll do more on this entry later. All questions and comments most welcome. Thanks, Tim.