Package: usbmount
Version: 0.0.10
Severity: normal
Tags: patch

usbmount doesn't find the vendor and model for my 
Kingston DataTraveler usb keychain.  For some reason,
the files it looks for:

  /sys/block/uba/uba1/[../]device/{vendor,model}

don't exist on my machine.  There is no symlink

  /sys/block/uba/uba1/device 

There is a symlink from /sys/block/uba/device to

  ../../devices/pci0000:00/0000:00:1d.0/usb1/1-1/1-1:1.0/

But that directory only contains

  bAlternateSetting  bInterfaceProtocol  block@        driver@
  bInterfaceClass    bInterfaceSubClass  detach_state  power/
  bInterfaceNumber   bNumEndpoints       diag

However, one directory up, i.e. 

  ../../devices/pci0000:00/0000:00:1d.0/usb1/1-1

contains

  1-1:1.0/             bMaxPower           configuration  idVendor      serial
  bConfigurationValue  bNumConfigurations  detach_state   manufacturer  speed
  bDeviceClass         bNumInterfaces      devnum         maxchild      version
  bDeviceProtocol      bcdDevice           driver@        power/
  bDeviceSubClass      bmAttributes        idProduct      product

and the files manufacturer and product contain

  Kingston

and

  DataTraveler 2.0

The patch below makes usbmount find these files.  But it's a bit of a
hack.  Maybe this is a bug in udev, or a bug in my device?  If you do
add something like this patch, maybe it should instead be more
systematic, e.g. something like (untested):

  for pth1 in "" "../"; do
    for pth2 in "" "../"; do
      for fn in vendor manufacturer; do
        if test -r "/sys$DEVPATH/${pth1}device/${pth2}$fn"
          vendor=...
          break

and similarly for model/product.

I should also point out that udevinfo finds this info:

# udevinfo -a -p /sys/block/uba/uba1 | grep Kings\\\|DataT
    SYSFS{manufacturer}="Kingston"
    SYSFS{product}="DataTraveler 2.0"

I wonder if usbmount should just use udevinfo instead of
searching through /sys?

Thanks for any help,

Dan

--- usbmount.orig       2005-04-12 11:37:23.000000000 -0400
+++ usbmount    2005-06-20 22:04:46.000000000 -0400
@@ -108,6 +108,8 @@
                        vendor="`cat \"/sys$DEVPATH/device/vendor\"`"
                    elif test -r "/sys$DEVPATH/../device/vendor"; then
                        vendor="`cat \"/sys$DEVPATH/../device/vendor\"`"
+                   elif test -r "/sys$DEVPATH/../device/../manufacturer"; then
+                       vendor="`cat 
\"/sys$DEVPATH/../device/../manufacturer\"`"
                    fi
                    vendor="`echo \"$vendor\" | sed 's/^ *//; s/ *$//'`"
                    model=
@@ -115,6 +117,8 @@
                        model="`cat \"/sys$DEVPATH/device/model\"`"
                    elif test -r "/sys$DEVPATH/../device/model"; then
                        model="`cat \"/sys$DEVPATH/../device/model\"`"
+                   elif test -r "/sys$DEVPATH/../device/../product"; then
+                       model="`cat \"/sys$DEVPATH/../device/../product\"`"
                    fi
                    model="`echo \"$model\" | sed 's/^ *//; s/ *$//'`"
 

-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.11.11
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages usbmount depends on:
ii  lockfile-progs                0.1.10     Programs for locking and unlocking
ii  udev                          0.056-3    /dev/ management daemon

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to