Linux and others
The Long Dark Tea-Time of the Soul
- Adventure Link Station LS-XHS
- Speedcontrol for DVD drives
- Patch for Ubuntu 7.10's intel xorg driver to enable overlay video for i965 (and disable textured video)
- Patch for Ubuntu 8.40 intel xorg (2.2.1) driver to fix XV attribute setting
- Stopping nm-applet 0.6.5 from asking you for the keyring password with ThinkFinger (Ubuntu 7.10)
- XOrg Keyboard driver
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 amamzon.co.jp 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).
- 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 192.168.11.150) checking for address 192.168.11.1
- Connected the LS-XHL directly with my laptop (@Buffalo-Support: X-over cable is really not needed!!)
- 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.
- Need to install TFTP server. As I worked with Japanese Windows PC (only supported by Buffalo support JP :-( )
Quick Google I found: http://tftpd32.jounin.net/
- 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]
- 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
- 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).
- 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:
- 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.
- 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)
- 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.
- 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.
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)
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:
Install the tool apt-src if you not have it already installed "sudo apt-get install apt-src"
Create a new directory: "mkdir intel ; cd intel"
Download the Intel source package and install dependent packages:
"apt-src install xserver-xorg-video-intel"
Download the following patch and copy to the "intel" folder: [link]
Patch the original driver: "patch -p1 < ubuntu-intel-overlay.diff"
Build the patched driver: "apt-src build xserver-xorg-video-intel"
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"".
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]
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 pam_nologin.so
auth required pam_env.so readenv=1
auth required pam_env.so readenv=1 envfile=/etc/default/locale
auth optional pam_gnome_keyring.so
session required pam_limits.so
session optional pam_gnome_keyring.so auto_start
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.
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"
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!
- Install the tool apt-src if you not have it already installed "sudo apt-get install apt-src"
- Create a new directory: "mkdir keyring ; cd keyring"
- Download the Intel source package and install dependent packages: "apt-src install gnome-keyring"
- Download the following patch and copy to the "keyring" folder: [link]
- Change directory: "cd gnome-keyring-2.20 "
- Patch the original package "patch -p1 <../gnome-keyring-2.20.diff" and change directory back "cd .."
- Build the package: "apt-src build gnome-keyring"
- 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]
Here the links for gnome-keyring-2.22.1 [patch]
Pre-build patched package can be found here: [link]
Patch for the keyboard driver from Peter Hutterer for the bug I found when using diffferent keyboard layout groups:
- xorg mailing list posts: [link]
- Ubuntu bug report: [link]
- I ported Peter's patch to Ubuntu's xorg server version 1.5.2: [patch]
- Build Ubuntu packages: [intrepid][jaunty]