Linux and others

 The Long Dark Tea-Time of the Soul

Table of Content

  1. Adventure Link Station LS-XHS
  2. Speedcontrol for DVD drives
  3. Patch for Ubuntu 7.10's intel xorg driver to enable overlay video for i965 (and disable textured video)
  4. Patch for Ubuntu 8.40 intel xorg (2.2.1) driver to fix XV attribute setting
  5. Stopping nm-applet 0.6.5 from asking you for the keyring password with ThinkFinger (Ubuntu 7.10)
  6. XOrg Keyboard driver

Adventure Link Station LS-XHL

This is not a particular Linux specific topic, but I put it on the page as I'm to lazy creating a new one.

These days I bought a Link Station LS-XHL from to gain some free and flexible space. I liked the fact it's Linux based and they released some source about their product.

However I had bad luck the product come delivered today with damaged HD. After initial boot-up the system showed red LED indicating problem accessing HR or booting.

Intending to get some support to quickly fix this issue I contacted amazon and got quite fast (English!) reply that I first need to contact Buffalo to get it fixed, so I contacted Buffalo next. On my Email inquiry I have not get a reply to far and calling the support hotline (Japanese only :-)() cost me a lot of money and was not useful at all  as I just get forwarded to the repair center (修理センター)and these guys just started their summer vacation... at least I learned some new Japanese Kanji :-)

So here how is how to fix the LS-XHL our self!

Situation: Link Station is not booting and as such all the standard (windows tools from Buffalo are not working).

  1. Checked the network traffic with wireshark [link] and nmap [link]
    Result: the LS-XHL is a brick,.... but hold on... pressing the function button the the device issues ARP packages (source checking for address
  2. Connected the LS-XHL directly with my laptop (@Buffalo-Support: X-over cable is really not needed!!)
  3. Continued to monitor the network traffic and after successful ARP address resolution the device starts requesting TFTP boot images. This is a remote boot function! Correct keyword: google search found different community sites that create custom FW for this device (I love Linux!). But here I just like to fix the device and not use a custom FW.
  4. Need to install TFTP server. As I worked with Japanese Windows PC (only supported by Buffalo support JP :-( )
    Quick Google I found:
  5. Meanwhile I found the US-Buffalo Support forum with more information about boot process and that I'm not the only one suffering for this boot problem with red LED: [link]
  6. Let's boot this brick! Here a Japanese instruction: [link]
    basically we need two files (can be seen in wireshark log): uImage.buffalo and initrd.buffalo
  7. Where to get these files? I use the official FW update from the Buffalo home page: [link]
    This file (used Japanese version 1.20) contains already uImage.buffalo and can be simply extracted with 7-zip.
    The other files is initrd.img, but care full this is actually an encrypted ZIP archive containing the actually needed file. So the trick is to simply uncompress the archive. The password can be simply found with Google (I got a list of 4 potential PW and the 3rd or 4th did the job).
  8. Now booting works: TFTP is listen on the network (direct link to LinkStation) and a folder with the 2 extracted boot images are used and the LinkStation is brought into the remote boot with pressing function:
  9. Finally the LinkStation is rebooting and the actual FW tool (link above) finds the link station, BUT it doesn't flash as the version we used to boot the device is to new.
  10. Here is the US-Buffalo support helpful, we need to bring the tool into debuging mode as explained here:
    In addition to this instruction I just enabled rebuild of partition tables recreation and delete user data.
    (First flash trial without this options failed (so my partition table was most likely broken)
  11.  Finally the device is operating normally and I can carefully re-boot. In the real run the device tries to change the IP again, but I keep the current IP we just used until the restore is complete done.
  12. Currently I copy data for test purpose, but at the moment system is working 100% normal and I just hope I don't need to the help from the Buffalo support center.

Speedcontrol for DVD drives

This is a small program that I wrote back in 2004 to reduce the speed of my NEC-3550A DVD drive.

This program sends a command to the DVD drive that gives a recommendation on what speed the drive is expected to play. In general it works similar to the command "hdparm" with option -X. However hdparm uses an IDE command that didn't work with my drive and this version is using the "SET STREAM" command that is effective for my drive.

Here it is the source: [LINK]

Note: Some DVD drives have not implemented this feature at all. Also it's just a "recommendation" after the standard, so this program is not effective for some DVD drives.

If you have the Gnu C compiler with standard libs installed you can compile the program as follows:

gcc -o speedcontrol speedcontrol.c

Execution is as following:

./speedcontrol -x1 /dev/dvd

The parameter -x1 determines that the DVD should be played with lowest speed. Actually 1 is one 1xCD-ROM speed and the drive is setting a minimum speed.

Patch for Ubuntu 7.10's intel xorg driver to enable overlay video for i965 (and disable textured video)

This patch is based on 2 patches on the xorg mailing list ([PATCH 1/2],[PATCH 2/2]), posted by Maxim Levitsky.

I changed the following:

  • adjustments to fit intel driver in version 2.1.1
  • merged both original patches in one
  • added option "OverlayVideo"

The intention of this patch is to enable XV video playback using Compiz. Using textured video playback while running Compiz is causing the video applications to crash ([link]) This resulted in the fact that i965 cards are blacklisted for Compiz ([link]).

This patch "should" enable you to use overlay video (that doesn't crash with Compiz) and to disable textured video. Other option would be using EXA mode instead of XAA. This works with textured video, but sufferers from performance problems for glyph rendering.

To compile a new Intel driver for Ubuntu 7.10 with this patch is very easy:

  1. Install the tool apt-src if you not have it already installed "sudo apt-get install apt-src"

  2. Create a new directory: "mkdir intel ; cd intel"

  3. Download the Intel source package and install dependent packages:

    "apt-src install xserver-xorg-video-intel"

  4. Download the following patch and copy to the "intel" folder: [link]

  5. Patch the original driver: "patch -p1 < ubuntu-intel-overlay.diff"

  6. Build the patched driver: "apt-src build xserver-xorg-video-intel"

  7. Install the new build driver: "sudo dpkg -i xserver-xorg-video-intel_2.1.1-0ubuntu9.1_i386.deb"

You can try to give the pre-compiled package a try: [link]

Now you can control the created xv adapter with parameters in "/etc/X11/xorg.conf":

In the "Device" section of this configuration file you can use the options "TexturedVideo" and "OverlayVideo" to control the xv adapter created. Example:

Option "TexturedVideo" "false"
Option "OverlayVideo" "true"
This example turns Textured Video Off and Overlay Video On. This setting should allow you to playback video with your i965 while using Compiz.

After updating the driver and xorg.conf, don't forget to restart your X-server.

Reminder: To enable compiz for i965 (even it's blacklisted) you need to create a file "compiz-manager" in the folder

"~/.config/compiz" with the content "SKIP_CHECKS="yes"".

Patch for 

Patch to enable the correct XV attribute setting for Intel-2.2.1(Ubuntu 8.04 Intel X driver)

 Here a patch that allows to have the correct XV attribute setting for Intel (830-Based) XV Overlay Video: [PATCH]

 A pre-compiled Ubuntu (8.04) package can be downloaded here (Version: 2.2.1-1ubuntu13.4): [LINK]

Stopping nm-applet 0.6.5 from asking you for the keyring password with ThinkFinger (Ubuntu 7.10)

If you are using ThinkFinger for your Thinkpad you got always asked for a keyring password for the nm-applet (if you are using encrypted wireless LAN). The nm-applet is the gnome frontend for the network manager. This applet however tries to store the wireless password using the gnome-keyring.

Not using ThinkFinger you probably not getting asked for the password due to the following setting in in file "/etc/pam.d/gdm":

auth requisite
auth required readenv=1
auth required readenv=1 envfile=/etc/default/locale
@include common-auth
auth optional
@include common-account
session required
@include common-session
session optional auto_start
@include common-password

Ubuntu 7.10 will use the users password to unlock the gnome keyring using a pam module.

Attention: Upgrade users might have different settings here (package and pam-module was renamed) so if you keep the old version it might now work any longer.

There are different problems:

1) You login password and the keyring password needs to be the same.

2) If you are using ThinkFinger, you are login in WITHOUT password, so the gnome keyring can't be unlocked.

How to change the password of the gnome keyring?

Method 1) You can delete your old key's in the folder "$HOME/.gnome2/keyrings" and selecting a new password later.

Method 2) You can install the package "seahorse". Then "System -> Preferences -> Encryption Preferences" and click on "Gnome Keyring"

How does it help with ThinkFinger?

Not really, because you still need a password, so that the pam_gnome_keyring module will unlock the gnome keyring during logon. However I created a patch for the gnome keyring, that will always use the password "login" for unlocking no matter what password you enter.

So you just change the password of you keyring to "login" and then install the patched version of gnome keyring.

Warning: This can be a security problem, if you store any important password in the keyring!

How to build a patched gnome keyring from source?

  1. Install the tool apt-src if you not have it already installed "sudo apt-get install apt-src"
  2. Create a new directory: "mkdir keyring ; cd keyring"
  3. Download the Intel source package and install dependent packages: "apt-src install gnome-keyring"
  4. Download the following patch and copy to the "keyring" folder: [link]
  5. Change directory: "cd gnome-keyring-2.20 "
  6. Patch the original package "patch -p1 <../gnome-keyring-2.20.diff" and change directory back "cd .."
  7. Build the package: "apt-src build gnome-keyring"
  8. Install the newly build package "sudo dpkg -i libpam-gnome-keyring_2.20-0ubuntu4_i386.deb"

A pre-build patched package can be downloaded here: [link]

Patch for gnome-keyring-2.22.1 for ThinkFinger

Here the links for gnome-keyring-2.22.1 [patch]

Pre-build patched package can be found here: [link]

Keyboard driver patch for xorg

Patch for the keyboard driver from Peter Hutterer for the bug I found when using diffferent keyboard layout groups:

Please see above for instructions how to build from source with apt-src.