> SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", > NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", MODE="0644" Yes, this is exactly what I have in 50-udev-default.rules. > I suspect you'll end up with something like this (make sure it runs > somewhere after the above rule that sets the name): > > SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", > ATTR{idVendor}=="xxxx", ATTR{idProduct}=="yyyy", RUN+="/sbin/fxload -I > /lib/firmware/foo.hex -D $env{DEVNAME}" I tried that, and now the rule wouldn't even apply. It seems that DEVTYPE=="usb_device" is not handled correctly. If I remove this condition, the rule is applied. I have one file 99-sbig.rules which has the following: SUBSYSTEM=="usb", ACTION=="add", SYSFS{idVendor}=="0d97", SYSFS{idProduct}=="0001", ENV{DEVTYPE}=="usb_device", \ RUN+="/sbin/fxload -I /lib/firmware/sbigucam.hex -D $env{DEVNAME}" I don't understand why DEVTYPE is not caught, I ran udev monitor and got the following when I plugged my USB cam: --------------------------------- EVENT[1224070564.432382] add /devices/pci0000:00/0000:00:07.2/usb1/1-1 (usb) ACTION=add DEVPATH=/devices/pci0000:00/0000:00:07.2/usb1/1-1 SUBSYSTEM=usb MAJOR=189 MINOR=24 DEVTYPE=usb_device DEVICE=/proc/bus/usb/001/025 PRODUCT=d97/1/1 TYPE=255/255/255 BUSNUM=001 DEVNUM=025 SEQNUM=1460 UEVENT[1224070564.434702] add /devices/pci0000:00/0000:00:07.2/usb1/1-1/usb_endpoint/usbdev1.25_ep00 (usb_endpoint) ACTION=add DEVPATH=/devices/pci0000:00/0000:00:07.2/usb1/1-1/usb_endpoint/usbdev1.25_ep00 SUBSYSTEM=usb_endpoint MAJOR=253 MINOR=4 SEQNUM=1461 UEVENT[1224070564.435629] add /devices/pci0000:00/0000:00:07.2/usb1/1-1/1-1:1.0 (usb) ACTION=add DEVPATH=/devices/pci0000:00/0000:00:07.2/usb1/1-1/1-1:1.0 SUBSYSTEM=usb DEVTYPE=usb_interface DEVICE=/proc/bus/usb/001/025 PRODUCT=d97/1/1 TYPE=255/255/255 INTERFACE=255/255/255 MODALIAS=usb:v0D97p0001d0001dcFFdscFFdpFFicFFiscFFipFF SEQNUM=1462 UDEV [1224070564.443609] add /devices/pci0000:00/0000:00:07.2/usb1/1-1/usb_endpoint/usbdev1.25_ep00 ( UDEV_LOG=7 ACTION=add DEVPATH=/devices/pci0000:00/0000:00:07.2/usb1/1-1/usb_endpoint/usbdev1.25_ep00 SUBSYSTEM=usb_endpoint MAJOR=253 MINOR=4 SEQNUM=1461 UDEVD_EVENT=1 DEVNAME=/dev/usbdev1.25_ep00 UDEV [1224070564.462839] add /devices/pci0000:00/0000:00:07.2/usb1/1-1/1-1:1.0 (usb) UDEV_LOG=7 ACTION=add DEVPATH=/devices/pci0000:00/0000:00:07.2/usb1/1-1/1-1:1.0 SUBSYSTEM=usb DEVTYPE=usb_interface DEVICE=/proc/bus/usb/001/025 PRODUCT=d97/1/1 TYPE=255/255/255 INTERFACE=255/255/255 MODALIAS=usb:v0D97p0001d0001dcFFdscFFdpFFicFFiscFFipFF SEQNUM=1462 UDEVD_EVENT=1 --------------------------------------------------------------------- If I remove the ENV{DEVTYPE}=="usb_device" from the rule, I can use $env{DEVICE} since it's the closest thing to what I need, albeit it's under /proc and that doesn't work, I need /dev/bus/usb/XXX/YYY. Of course, DEVNAME evaluates to /dev/usbdev1.25_ep00 which is useless. At any rate, here is what I get in /var/log/messages ---------------------------------------------------------------------- Oct 15 14:36:04 linux-j3lx kernel: usb 1-1: new full speed USB device using uhci_hcd and address 25 Oct 15 14:36:04 linux-j3lx kernel: usb 1-1: configuration #1 chosen from 1 choice Oct 15 14:36:04 linux-j3lx kernel: usb 1-1: New USB device found, idVendor=0d97, idProduct=0001 Oct 15 14:36:04 linux-j3lx kernel: usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0 Oct 15 14:36:04 linux-j3lx udevd[552]: msg_queue_insert: seq 1460 queued, 'add' 'usb' Oct 15 14:36:04 linux-j3lx udevd[552]: udev_event_run: seq 1460 forked, pid [4658], 'add' 'usb', 0 seconds old Oct 15 14:36:04 linux-j3lx udevd[552]: msg_queue_insert: seq 1461 queued, 'add' 'usb_endpoint' Oct 15 14:36:04 linux-j3lx udevd[552]: msg_queue_insert: seq 1462 queued, 'add' 'usb' Oct 15 14:36:04 linux-j3lx udevd-event[4658]: udev_rules_get_name: rule applied, '1-1' becomes 'bus/usb/001/025' Oct 15 14:36:04 linux-j3lx udevd-event[4658]: udev_db_get_device: no db file to read /dev/.udev/db/\x2fdevices\x2fpci0000:00\x2f0000:00:07.2\x2fusb1\x2f1-1: No such file or directory Oct 15 14:36:04 linux-j3lx udevd-event[4658]: udev_node_add: creating device node '/dev/bus/usb/001/025', major=189, minor=24, mode=0660, uid=0, gid=0 Oct 15 14:36:04 linux-j3lx udevd-event[4658]: udev_node_mknod: atomically replace '/dev/bus/usb/001/025' Oct 15 14:36:04 linux-j3lx udevd-event[4658]: udev_node_mknod: mknod(/dev/bus/usb/001/025.udev-tmp, 020660, 189, 24) failed: Operation not permitted Oct 15 14:36:04 linux-j3lx udevd-event[4658]: udev_event_run: seq 1460 finished with -1 Oct 15 14:36:04 linux-j3lx udevd[552]: udev_done: seq 1460, pid [4658] exit with 1, 0 seconds old Oct 15 14:36:04 linux-j3lx udevd[552]: udev_event_run: seq 1461 forked, pid [4659], 'add' 'usb_endpoint', 0 seconds old Oct 15 14:36:04 linux-j3lx udevd-event[4659]: udev_rules_get_name: no node name set, will use kernel name 'usbdev1.25_ep00' Oct 15 14:36:04 linux-j3lx udevd-event[4659]: udev_db_get_device: no db file to read /dev/.udev/db/\x2fdevices\x2fpci0000:00\x2f0000:00:07.2\x2fusb1\x2f1-1\x2fusb_endpoint\x2fusbdev1.25_ep00: No such file or directory Oct 15 14:36:04 linux-j3lx udevd-event[4659]: udev_node_add: creating device node '/dev/usbdev1.25_ep00', major=253, minor=4, mode=0660, uid=0, gid=0 Oct 15 14:36:04 linux-j3lx udevd-event[4659]: name_index: creating index: '/dev/.udev/names/usbdev1.25_ep00/\x2fdevices\x2fpci0000:00\x2f0000:00:07..2\x2fusb1\x2f1-1\x2fusb_endpoint\x2fusbdev1.25_ep00' Oct 15 14:36:04 linux-j3lx udevd-event[4660]: run_program: '/sbin/modprobe usb:v0D97p0001d0001dcFFdscFFdpFFicFFiscFFipFF' Oct 15 14:36:04 linux-j3lx udevd-event[4659]: pass_env_to_socket: passed 272 bytes to socket '/org/freedesktop/hal/udev_event', Oct 15 14:36:04 linux-j3lx udevd-event[4659]: pass_env_to_socket: passed 272 bytes to socket '@/org/kernel/udev/monitor', Oct 15 14:36:04 linux-j3lx udevd-event[4659]: udev_event_run: seq 1461 finished with 0 Oct 15 14:36:04 linux-j3lx udevd[552]: udev_event_run: seq 1462 forked, pid [4660], 'add' 'usb', 0 seconds old Oct 15 14:36:04 linux-j3lx udevd[552]: udev_done: seq 1461, pid [4659] exit with 0, 0 seconds old Oct 15 14:36:04 linux-j3lx udevd-event[4660]: run_program: '/sbin/modprobe' (stderr) 'FATAL: Module usb:v0D97p0001d0001dcFFdscFFdpFFicFFiscFFipFF not found.' Oct 15 14:36:04 linux-j3lx udevd-event[4660]: run_program: '/sbin/modprobe' returned with status 1 Oct 15 14:36:04 linux-j3lx udevd-event[4660]: pass_env_to_socket: passed 335 bytes to socket '/org/freedesktop/hal/udev_event', Oct 15 14:36:04 linux-j3lx udevd-event[4660]: pass_env_to_socket: passed 335 bytes to socket '@/org/kernel/udev/monitor', Oct 15 14:36:04 linux-j3lx udevd-event[4660]: udev_event_run: seq 1462 finished with 0 Oct 15 14:36:04 linux-j3lx udevd[552]: udev_done: seq 1462, pid [4660] exit with 0, 0 seconds old --------------------------------------------------------------------------------------------------------- Notice that despite the default rule in 50-udev-default.rules (NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}"), the log says: udev_rules_get_name: no node name set, will use kernel name 'usbdev1.25_ep00' Btw, I get the same results in Fedora 9 and openSUSE 11, so it doesn't appear to be distro-specific. Any insights appreciated! Cheers, Jasem -- To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html