FYI.  This usb.usermap line works:
usb-storage 0x0380 0x0c0b 0xb001 0x10 0x10 0x00 0x00 0x00 0x08 0x06 0x50
0x00000000

I got the 0x0380 from usb.distmap from the usb-storage lines.  0x000f
didn't work.  What do these flags mean and how can I figure out what
flags are best for each USB device?  The last field, driver info is also
a mystery.

The rest of the data came from cat /proc/bus/usb/devices.

To help the rest of you guys struggling like I am, here's a little PERL
script to generate lines for you automatically.  (Sorry about the line
wraps, but you can neaten it up easily...)

Run it like this:
mkusb.usermap > usb.usermap

Ideally, my setup will invoke a backup script upon insertion of an
external USB device...

========================================================================
#!/usr/bin/perl

@lines = `cat /proc/bus/usb/devices`;

$dev = 0;
foreach $line (@lines) {
  if ($line =~ /^T:  Bus=(\w+) Lev=(\w+) Prnt=(\w+) Port=(\w+) Cnt=(\w+)
Dev#=(\s*\w+) Spd=(\w+)\s*MxCh=(\s*\w+)/) {
    $dev++;
    @{$t{$dev}} = ($1, $2, $3, $4, $5, $6, $7, $8);
  }

  if ($line =~ /^D:  Ver=\s*(\w+\.\w{2}) Cls=(\w{2})\(.{5}\) Sub=(\w+)
Prot=(\w+) MxPS=(\s*\w+) #Cfgs=(\s*\w+)/ ) { 
    @{$d{$dev}} = ($1, $2, $3, $4, $5, $6);
  }

  if ($line =~ /^P:  Vendor=(\w+) ProdID=(\w+) Rev=\s*(\w+)\.(\w+)/) {
    @{$p{$dev}} = ($1, $2, $3, $4);
  }

  if ($line =~ /S:  Product=(.+)/) {
    ${$s{$dev}}[0] = $1;
  }

  if ($line =~ /S:  SerialNumber=(.+)/) {
    ${$s{$dev}}[1] = $1;
  }

  if ($line =~ /I:  If#=\s*(\w+) Alt=\s*(\w+) #EPs=\s*(\w+)
Cls=(\w{2})\((.{5})\) Sub=(\w+) Prot=(\w+) Driver=(.+)/) {
    @{$i{$dev}} = ($1, $2, $3, $4, $5, $6, $7, $8);
  }
  
}
print "# usb
module  match_flags     idVendor        idProduct       bcdDevice_lo    bcdDevice_hi   
 bDeviceClass    bDeviceSubClass bDeviceProtocol bInterfaceClass bInterfaceSubClass    
  bInterfaceProtocol      driver_info\n";

foreach $dv (1 .. $dev) {
  print "# $d ${$s{$dv}}[0] ${$s{$dv}}[1] ${$i{$dv}}[7]\n";
  print "${$i{$dv}}[7] 0x0380 0x${$p{$dv}}[0] 0x${$p{$dv}}[1]
0x${$p{$dv}}[2] 0x${$p{$dv}}[3] 0x${$d{$dv}}[1] 0x${$d{$dv}}[2]
0x${$d{$dv}}[3] 0x${$i{$dv}}[3] 0x${$i{$dv}}[5] 0x${$i{$dv}}[6]
0x00000000\n";
}

=================================================================




On Thu, 2002-03-21 at 15:19, Abe Waranowitz wrote:
I can't get /etc/hotplug/usb/usb-storage script to run.  I suspect my
usb.usermap file is not right.  My storage script has chmod +x on it and
works from the CLI.

I also know the USB device works electronically, I can mount it
manually, fdisk, format, etc. no problem.

Can someone help me with this?  Thanks!


------------------------------
Script:
#!/bin/sh
mount /dev/sdb1 /mnt/disk

------------------------------
/proc/bus/usb/devices:
T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  4 Spd=12  MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=0c0b ProdID=b001 Rev=10.10
S:  Manufacturer=DMI
S:  Product=USB 2.0 Storage Adaptor
C:* #Ifs= 1 Cfg#= 2 Atr=c0 MxPwr= 98mA
I:  If#= 0 Alt= 0 #EPs= 3 Cls=08(stor.) Sub=06 Prot=50
Driver=usb-storage
E:  Ad=01(O) Atr=02(Bulk) MxPS=  64 Ivl=  0ms
E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=  0ms
E:  Ad=83(I) Atr=03(Int.) MxPS=   2 Ivl= 32ms

------------------------------
/etc/hotplug/usb.usermap:
usb-storage 0x0c0b 0xb001 0x1010 0 0 0 0 0 0 0 0 0

------------------------------
dmesg:
hub.c: USB new device connect on bus1/1, assigned device number 4
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 4


-- 

Abe Waranowitz
[EMAIL PROTECTED]
http://abeowitz.da.ru


_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users

Reply via email to