Tevion CardReader with RedHat or Fedora Core Linux
Last update: 10.12.2004
This document describes how to configure RedHat 9 or Fedora Core Linux for use with the Tevion card reader, without compiling a new kernel.
All changes and modifications described here work (or worked) for me without any problems. But I do not take responsibility for any changes or modifications on any system anybody might have done as result of this document.
Especially I do not take responsibility for any mischief or destruction which may happen by flashing your card reader. Flashing can make your card reader device completely unusable. You have been warned.
|
Caution! The Tevion Cardreader is buggy. I was not able to read a 256MB SD card correctly. The stored data can be transferred, the file size is also correct. But the file contents become currupted. I've tried it with two different card readers from Tevion. www.traveler-service.com has a firmware update available at http://www.traveler-service.com/upload/firmware/FIRM_UP.ZIP. The description claims this update is usable for devices sold in october 2003. Once the firmware update is ready the UIDs of each card reader device becomes the same, so you cannot distinguish between the slots only by the description. This implies that my "old" solution for Fedora Core 1 won't do it any more. You will have to use the "new" one. |
RedHat and Fedora will recognize only one of the given card slots. This problem exists because the standard kernel has been compiled without the option CONFIG_SCSI_MULTI_LUN=y. In the kernel configuration menu it is called Probe all LUNs on each SCSI device. That is why the SCSI devices with logic unit numbers (LUNs) ≥ 1 will not be scanned automatically. They can be added by hand later. This is done by my script tevion.
Fedora Core 3
Fedora Core 3 awaits with two new surprises: udev and hal. The udev system dynamically creates devices in the /dev directory as well as symlinks to them. hal maintains a database for your hardware, its capabilities and additional information. Both systems have to be convinced to work together with the cardreader.
UDEV
udev is quite easy to convince. One has to add a new rule in the /etc/udev/rules.d directory. It is a bad idea to add your rule for example in 50-udev.rules because it will most sure be overwritte on the next udev update. It is better to create a new file, i.e. 00-tevion.rules containing the following line:
BUS="usb", SYSFS{idVendor}="3538", SYSFS{idProduct}="0015", NAME{all_partitions}="%k"
It creates devices for your cardreader in /dev
HAL
HAL stands for Hardware Abstraction Layer and is a poorly chosen name. HAL already has a meaning in the system kernel which is highly misleading at this point.
HAL needs a XML file, which describes the capabalities of the hardware. I have prepared two files modelled on the existing 6in1-card-reader.fdi. The right place for the .fdi files is /usr/share/hal/fdi/95userpolicy. You will need only one of them!
- 00-tevion-cardreader-1_lun.fdi
This is the right file for kernels, which do not scan all LUNs, therefor also for the original kernel. - 00-tevion-cardreader-multilun.fdi
This is the right file for kernels, which do scan all LUNs.
SCSI devices in /proc filesystem (only for kernels without multi-LUN capabality)
For Fedora Core 3 and other distributions which do not scan all LUNs on SCSI devices, one need an additional script, which adds the remaining three LUNs
A minimalistic version if the cardreader script which I have written for Fedora Core 2 should be enough. I have called it tevion. This script has to be copied to /etc/hotplug/usb. Then you have to add the following line to /etc/hotplug/usb.usermap.
tevion 0x0003 0x3538 0x0015 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
Here the same line for download.
Fedora Core 2
After flashing the device I was faced with the fact, that the UIDs of the 4 slot changed - they became identical. So the devlabel script cannot distinguish between them any more.
I went over my cardreader script. Now it not only adds the card reader in the /proc filesystem but also creates links to the apropriate SCSI devices. Link names can be configured in the script. It also generates a script in /var/run which is called by the hotplug system after the card reader has been removed. It will delete the links and remove the device from the /proc filesystem.
First one has to tell hotplug which device is to be associated with the script. Herefor you must add the following line to /etc/hotplug/usb.usermap
cardreader 0x0003 0x3538 0x0015 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
Here the same line for download.
Now you have to copy the cardreader script to /etc/hotplug/usb and make it executable by the command
chmod 755 /etc/hotplug/usb/cardreader
If you like, you can change the link names in the script. Defaults are /dev/cardreader{cf,sd,sm,ms}. Et voilà, c'est ça.
Fedora Core 1
You will need the hotplug package. The devlabel package which can be used by hotplug also very usefull for our purpose. It creates links to previously configured devices in /dev. Since USB devices can be hotplugged at random order, you cannot assume that a devices always gets the same device file. devlabel recognizes devices by their unique identifier (UID) and creates previously named links for them.
First you will have to make sure that the SCSI devices1 with LUNs 0-3 are scanned on your card reader. This will be done by the script cardreader. hotplug can execute user defined scripts, if it knows the device, which has been plugged in. Copy the script cardreader to /etc/hotplug/usb/cardreader and append the following line to /etc/hotplug/usb.usermap:
cardreader 0x0003 0x3538 0x0015 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
Here the same line for download.
Please check with usbview or lsusb if the VendorID and the DeviceID match the IDs of your device.
Unfortunately, the /sbin/devlabel script is rather picky and will not add empty devices. This means it will not create any links for devices without an inserted card. This is probably not what you want. That's why I've slightly modified the devlabel script. The modifications are not very tricky and documented in devlabel.diff.
Now, when you plug in your card reader hotplug will search for the VendorID and the DeviceID of the recently plugged device in the usb.usermap file. There it will find the script name cardreader and execute it. It will add the missing SCSI devices. Finaly, hotplug executes devlabel and creates links with given names to the correct SCSI devices.
Of course, you will have to configure devlabel, when you plug in your card reader for the first time. The man pages of devlabel will help you here. You will find the SCSI devices of your card reader somewhere in /dev/sda1, /dev/sdb1, and so on...
| File | MD5-Checksum |
|---|---|
| redhat9.zip (7,903 B) | e9ac2fc870b7b93ae2e98417b87580fe |
| fedora-core1.zip (10,153 B) | 152da014ef6befa6f5d9d427ce600f18 |
1: Linux uses a SCSI emulation layer to communicate with USB mass storage devices.(back)
Last changes on: Sunday, 17. April 2011, 20:11:13


