Debian on a Fujitsu Lifebook T2010

TuxMobil

Debian 'unstable' (as of Dec 26th 2008) seems to have everything needed and there is no longer the need to by hand compile kernels and what-not in the general case. Worth bearing in mind, is that I opted for the 64bit install and so far had no problems.

Installing the OS

Not much to say about this. Of course the laptop does not come with any kind of DVD or CD drive which defeats the usual Windoze, Ubuntu and Gentoo weenies. Fortunately being a clever lad, having had the experience and enjoyed watching the pansies cry online "I don't know how to install an OS without a CD drive" I just smiled and PXE booted the thing.

Whining Weiners....you should all be ashamed. For those wishing to learn what real computing hardware is about, buy a secondhard Sun, or Alpha, boxen from fleabay and install Linux on that. Once you have done that you will be able to join the rest of us in our intrinsic hatred for x86....anyone want to give me a Tadpole laptop? :)

Why people still burn CD's when they could just PXE boot in 95% of situations, especially so when you can get even Windoze to bootstrap, is beyond me... I guess you could USB boot, however that really is wimping out. :)

/etc/rc.local

No idea why but it took me a while to work out, but /etc/rc.local does not take effect (although it seems to run from slipping 'set -x' into it) when you set "CONCURRENCY=shell" in '/etc/init.d/rc'. Make sure you have it set to 'none' instead and you should be fine.

Newer Kernel

I have recently been using 2.6.29 which is easily installed by adding the following to your apt-get sources listings:

berk:~# cat /etc/apt/sources.list.d/debian-kernels.list 
deb http://kernel-archive.buildserver.net/debian-kernel trunk main

Touchscreen

This is actually a serial port device, tricky to find the base port number on the Internet however I found it through trial'n'error, and then promptly found it all available in the ACPI DSDT. Bah.

However, of course Linux with ACPI PNP support enabled will automatically configure it for you, so really things just work, you just need to have the relevant bits in your xorg.conf file now.

N.B. the pen fails to align properly with the edge of the screen which needs adjusting. When I find it becomes annoying (when I actively use the pen) I'll post up some xsetwacom options that should fix the problem.

Xorg

Here is my xorg.conf is available for download. I use wmii with xdm as the login session manager, I would recommend you have yourself a custom '~/.xsession' file.

'xbacklight' works generally fine, however before it starts funtioning you will need to put the following into your '~/.xsession' file:

# otherwise xbacklight does nothing 
# TODO: try to work out how to do this without xrandr 
( xrandr --output LVDS --set BACKLIGHT_CONTROL legacy && xbacklight -set 40 ) & 

The screen is very bright at 100% I would recommend you drop it to aroun the 40% mark.

N.B. if you are running 2.6.29 then the 'xrandr' legacy tweak is unnecessary

Fujitsu Buttons

All the hard work has been done already, it's lurking in the fjbtndrv package. To fetch it type:

$ svn co http://fjbtndrv.svn.sourceforge.net/svnroot/fjbtndrv/trunk fjbtndrv 

This downloads the latest version of the whole lot, however the whole thing is pretty sucky except for '/usr/src/fjbtndrv/src/linux/' bit, go into that directory, type 'make' and then as root type 'make install'. Afterwards you can slip 'fjbtndrv' into your '`/etc/modules`' and xorg will start seeing keyboard events.

We need a few udev rules though, so in '/etc/udev/rules.d/99-local.rules' add:

SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{name}=="fsc tablet buttons", SYMLINK+="input/by-path/platform-fsc_btns-event-kbd"
# as xorg does not support sw events we use evrouter which means we need global readable 
# N.B. no a risk as the most people can do is read when we go into tablet mode :) 
SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{name}=="fsc tablet switch", SYMLINK+="input/by-path/platform-fsc_tab-event-sw", MODE="644" 

To make use of the buttons I would recommend you use 'xbindkeys' and also a patched version of evrouter will give you the support for the 'tablet mode' switch (the bit that tells your computer that you have tabletised the screen). I rolled the patch to add switch event support to evrouter as xorg does not support switch events.

Once compiled (with 'debuild') and installed you will need to create '`~/.evrouterrc`' and then you should start being able to run scripts on this event.

Annoyingly the screen brightness hotkeys are non-functional here, they pop up as ACPI events so you will need to add to '/etc/rc.local' (you will need 'acpi-support' installed too but thats a good thing anyway):

# fujitsu t2010 brightness keys 
/usr/bin/setkeycodes e0e0 224 # brightness down 
/usr/bin/setkeycodes e0e1 225 # brightness up 

'xbindkeys' will run a script when you press the screen rotate button and also for the volume hotkeys when you add to your '~/.xbindkeysrc':

alex@berk:~$ grep "^[^#].*" ~/.xbindkeysrc 
"tabletRotateScreen"
  XF86RotateWindows
"amixer sset Master,0 mute"
  XF86AudioMute
"amixer sset Master,0 unmute; amixer sset Master,0 5%-"
  XF86AudioLowerVolume 
"amixer sset Master,0 unmute; amixer sset Master,0 5%+"
  XF86AudioRaiseVolume
"xbacklight -steps 5 -time 50 -dec 5"
  XF86MonBrightnessDown
"xbacklight -steps 5 -time 50 -inc 5"
XF86MonBrightnessUp

You will need to fixup the keymap slightly to make the onscreen buttons more useful than they are by default, best to put in your '~/.xsession' file:

# sort out the tablet keys to be sane 
xmodmap -e 'keycode 161 = XF86RotateWindows' 
xmodmap -e 'keycode 185 = Prior' # XF86ScrollUp 
xmodmap -e 'keycode 186 = Next' # XF86ScrollDown 

OpenGL 3D Acceleration

It works, but the 3D acceleration is not great, glxgears comes back with a unstunning 925fps. I feel it should be faster but others are reporting a similar value...

'British' Support

Nice to get to the good old British pound symbol on my keyboard :) Add to your '~/.xsession' file something like:

# give me sterling for Shift-Alt-3 
xmodmap -e 'keycode 12 = 3 numbersign sterling' 
xmodmap -e 'keycode 26 = e E EuroSign cent' 

Fingerprint Reader

The fingerprint reader is an "AuthenTec, Inc. AES2501 Fingerprint Sensor" (USB-ID: 08ff:2580) and is supported via the userspace debian tool 'aes2501-wy'. It works fine when you call it via 'su -c aes2501' creating PNM files...fingerprint readers are really just scanners anyway. Apparently if you use the Debian experimental bits then you get 'libpam-fprint' which will give you an easy way to do fingerprint authentication.

I personally think fingerprint authentication is a joke (you could use it combined with some other method though, or maybe as a quick xscreensaver unlocker...) and should be avoided, two main reasons:

One thing that I might look into using it for is as an extended keyboard. Some ideas:

Wireless

The ath5x driver, the driver that comes with the regular Debian 2.6.26 kernel, does not work with the card, an AR242x 802.11abg 1, instead you have to use the madwifi driver. If however you

Driver

Kernel Native

If you are using kernel 2.6.29 then you should find the native 'ath5k' driver works fine:

# we blacklist ath5x to prevent it loading on boot/resume
# echo "blacklist ath5x" >> /etc/modprobe.d/local

Madwifi

# # we blacklist ath_pci to prevent it loading on boot/resume
# echo "blacklist ath_pci" >> /etc/modprobe.d/local
# echo "options ath_pci ratectl=amrr intmit=1" >> /etc/modprobe.d/local
# aptitude install madwifi-tools madwifi-source
# module-assistant build madwifi
# dpkg -i /usr/src/madwifi-modules-2.6.26-1-amd64_0.9.4+r3772.20080716-1+2.6.26-13_amd64.deb

Region Woes

The only issue I had to overcome was the braindeadness of the HAL refusing to accept my region settings, as I'm a UK dweller. To deal with this you type the following as root:

ath_info -v -g 3:0 -w fc200000 regdomain 0x00 

For more details on this have a read of the madwifi ticket 2156.

AP Association

Now in your /etc/network/interfaces file you should have something like (if you are using madwifi, replace 'wlan0' with 'ath0' throughout and 'ath5k' with 'ath_pci'):

#allow-hotplug wlan0
iface wlan0 inet dhcp
        wpa-conf /etc/wpa_supplicant/wlan0.conf

        pre-up      modprobe ath5k
        up          ifmetric wlan0 5
        post-down   modprobe -r ath5k

Your /etc/wpa_supplicant/wlan0.conf file should look like:

ctrl_interface=/var/run/wpa_supplicant.wlan0
ctrl_interface_group=netdev
update_config=1

ap_scan=1
fast_reauth=1

network={
        ssid="bayesian"

        key_mgmt=WPA-PSK
        psk="whatever"
        proto=WPA
        pairwise=TKIP

#       peerkey=1
#       proactive_key_caching=1
}

network={
        ssid="eduroam"

        key_mgmt=WPA-EAP
        eap=TTLS

        # points to GTE_CyberTrust_Global_Root.pem
        ca_cert="/etc/ssl/certs/4d654d1d.0"
        subject_match="/CN=eduroam.soas.ac.uk"

        anonymous_identity="@soas.ac.uk"
        phase2="auth=PAP"

        identity="ac56@soas.ac.uk"
        password="cough splutter"

#        peerkey=0
#        proactive_key_caching=1
}

You should now be able to ifup/ifdown to your hearts content, those chasing after a GUI should add themselves to the 'netdev' group and install 'wpagui'.

Bluetooth

The switch on the side turns on and off the bluetooth device, like most laptops I have seen with Bluetooth it 'plugs in' the USB dongle when flipped to the on position. The regular 'hci_usb' driver works great.

Audio

With older kernels you used to have to pass 'model=fujitsu' to the 'snd_hda_intel' module, however now-a-days it seems to just work fine; if you of course overlook the fact Fujitsu put a naff tinny mono speaker on it :-/

You should slip into your /etc/modprobe.d/local file though:

options snd_hda_intel model=auto

MMC/SD Reader

Works fine however there is no DMA mode, just PIO mode (not surprising though).

sdhci:slot0: Unknown controller version (2). You may experience problems. 
mmc0: SDHCI at 0xfc402800 irq 18 PIO 
mmc0: new SD card at address 1234 
mmcblk0: mmc0:1234 SD02G 1992704KiB 
mmcblk0: p1 

Some speed statistics, bear in mind the CPU becomes busy and even the mouse jerks around the screen when I do the following:

berk:/home/alex# dd if=/dev/mmcblk0 of=/dev/null bs=1M count=100 
100+0 records in 
100+0 records out 
104857600 bytes (105 MB) copied, 42.258 s, 2.5 MB/s 

I had a brief go at forcing DMA mode in the sdhci.c (using SDHCI_QUIRK_FORCE_DMA, SDHCI_QUIRK_32BIT_DMA_ADDR and SDHCI_QUIRK_32BIT_DMA_SIZE) source code for the controller but had no joy; let me know if anyone finds out something.

Smartcard Reader

The smartcard reader works with the o2scr driver, however there are some problems with it. I spoke to the authors on the mailing list and the following patches make the thing functional:

$ svn co http://svn.gna.org/svn/o2scr/trunk o2scr 

If you then patch up the code as per the following thread on the o2scr-main mailing list.

N.B. bear in mind, that smartcards under Linux is currently not too great. Brace yourself for some work on this, once I have fully gotten a working setup into place, I will slap some instructions on my site under a seperate section.

KVM Support

Nice, finally I get to completely dispose of VMWare and know I am not clobbering my poor CPU needlessly. I have to say KVM and SMP makes a lot of sense, I do not notice several guests running at the same time anymore :)

One problem, Intel decided not to deal with 16bit realmode instructions and so some OS's explode when trying to boot. Plan9 for example is one of them but sometimes there are workarounds. To make this more usable it is worth installing the kqemu modules that can be installed by typing:

# aptitude install kqemu-source
# module-assistant build kqemu
# dpkg -i /usr/src/kqemu-modules-2.6.26-1-amd64_1.4.0~pre1-1+2.6.26-13_amd64.deb

ACPI and Power

Putting the Baby to Sleep

Okay, this sholud go under 'ACPI' below however not much needs to be said other than it's a pain that there is no hibernate or suspend to RAM hotkeys, instead I have opted for:

Hibernate

Add the following line to your sudoers file via "visudo":

%staff  ALL=NOPASSWD: /usr/sbin/s2disk

Now you can just type "sudo s2disk". To speed up resuming at the expense of a slower hibernate you should amend the following lines in "/etc/uswsusp.conf":

compress = y
early writeout = y
image size = 0

Suspend-to-RAM

The BIOS that came with my laptop (1.04) had a bug so that about 30% of the time on a resume after a Suspend-to-RAM event would fire off the LID event once every second; effectively killing any ACPI functionality afterwards. A reboot would be needed to fix it. When I upgraded to 1.08, things started to work fine.

berk:~# cat /etc/acpi/local/lid.sh.post 
#!/bin/sh

WLAN=wlan0

RUNLEVEL=$(/sbin/runlevel | awk '{ print $2 }')

if [ "$RUNLEVEL" = "0" ] || [ "$RUNLEVEL" = "5" ]; then
  exit 0
fi

if [ $(cat /proc/acpi/button/lid/LID/state | awk '{ print $2 }') != "open" ]; then
  if [ -d "/sys/class/net/$WLAN" ]; then
    ifdown --force $WLAN &> /dev/null
  fi

  sync

  /usr/sbin/s2ram -f -a3
fi

exit 0

ACPI

Okay, if we overlook the bouncing keyboard and the crappy tinny speaker, the only other problem with the laptop is that the ACPI bits suck:

So to fix up the DSDT, you need to compile a custom kernel (I actually could not be bothered with the Debian kernel and now have gone with the vanilla/git kernels) annoyingly as Debian refuses to add the very helpful feature of loading the DSDT from initramfs:

You will need the ACPI DSDT in initrd patch.

N.B. provide fixed up DSDT once I have finished fiddling :)

Now the DSDT playing:

# aptitude install iasl
$ mkdir /usr/src/dsdt
$ cd /usr/src/dsdt
$ cat /sys/firmware/acpi/tables/DSDT DSDT.aml
$ iasl -d DSDT.aml
$ patch < fujitsu-t2010-dsdt-fixup.diff
$ iasl DSDT.dsl
# cp dsdt-v1.04.aml /etc/initramfs-tools/DSDT.aml

PowerTOP

PowerTOP alas will only show me getting down to about 16 (no-X11) to 26 (with X11) wakeup's per second which is a bit naff, however to get this you need to do the following (remember to turn off bluetooth with the physical switch too when not using it).

Tweak your '/etc/rc.local' file to include:

/sbin/sysctl -q -w vm.dirty_writeback_centisecs=1500
/sbin/sysctl -q -w fs.xfs.xfsbufd_centisecs=3000
echo 1 > /sys/devices/system/cpu/sched_mc_power_savings 
echo 10 > /sys/module/snd_hda_intel/parameters/power_save 

N.B. ignore the powertop usbcore autosuspend stuff, it does not know what it is talking about.

XFS 'Pain'

Annoying, according to PowerTOP, XFS adds a wakeup for every XFS mounted filesystem which shows up as the process xfsaild. I annoyingly have 19 LV, excluding my root filesystem, XFS filesystems so I'm annoyed, but what can I do.

I used the automounter ('autofs5') to reduce this problem so I could still abuse LVM to my liking. I added the following to my /etc/auto.master file:

/mnt/auto.xfs /etc/auto.xfs --timeout=300

My /etc/auto.xfs file looks like:

backupninja     -fstype=xfs,rw,relatime,nodev,nosuid,noexec             :LABEL=backupninja

src             -fstype=xfs,rw,relatime,nodev,nosuid                    :LABEL=src
ts7800          -fstype=xfs,rw,relatime,nodev,nosuid                    :LABEL=ts7800
wag54g          -fstype=xfs,rw,relatime,nodev,nosuid                    :LABEL=wag54g

bitbucket       -fstype=xfs,rw,relatime,nodev,nosuid,noexec             :LABEL=bitbucket
photos          -fstype=xfs,rw,relatime,nodev,nosuid,noexec             :LABEL=photos

old             -fstype=xfs,ro,relatime,nodev,nosuid,noexec             :LABEL=old

You then can comment out the entries from your /etc/fstab file that you have added to your /etc/auto.xfs file and then replace all your mount points with softlinks to /mnt/auto.xfs/<NAME>.

TPM Chip

All seems to work fine with the tpm_infineon module:

berk:/home/alex# dmesg | grep -i tpm 
pnp: the driver 'tpm_inf_pnp' has been registered 
tpm_inf_pnp 00:03: Found TPM with ID IFX0102 
tpm_inf_pnp 00:03: TPM found: config base 0x4e, data base 0xfd00, chip
version 0x000b, vendor id 0x15d1 (Infineon), product id 0x000b (SLB 9635 TT 1.2) 
tpm_inf_pnp 00:03: driver attached 

Using the TPM is outside the scope of this page. The Infineon TPM chip series supposedly generates True RNG which means we could use it as an entropy source through rng-tools.

I2C Bus

For the sake of completeness, the single nagging device that I'm yet to find is the accelerometer on the laptop. The last place I can think of is the I2C bus however I guess I should spend more time digging through the ACPI DSDT.

An initial nosey on the i801 smbus (SMBus I801 adapter at 18e0) gives me:

berk:/home/alex# i2cdetect -y 0 
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f 
00:          -- -- -- -- -- 08 09 0a 0b -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- 19 -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- 44 -- -- -- -- -- -- -- -- -- -- -- 
50: 50 51 52 -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- 69 -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- -- 

From my guess work I have found by using "i2cdump -y 0 0x??" where '??' is the address I'm probing and also noseying in '/sys/bus/i2c/devices/':

As for the rest, no idea what they are however the lm-sensors website helps fill in some of the blanks potentially:

  1. it looks like its working but you will see no AP's when you scan and thus be unable to do anything with your wireless card (1)

www: debian/fujitsu/t2010 (last edited 2010-01-24 00:52:49 by alex)