Opened 17 years ago

Closed 17 years ago

#1680 closed defect (fixed)

/proc/bus/usb is obsolete

Reported by: alexander@… Owned by: bdubbs@…
Priority: normal Milestone: 6.2.0
Component: BOOK Version: SVN
Severity: normal Keywords:

Description (last modified by alexander@…)

While the instructions at the libusb page still work with linux-2.6.14, they describe the obsolete setup. The /proc/bus/usb mount should go away, and libusb should be patched to take advantage of real raw usb device nodes. Use this raw message as a patch for libusb:

The udev rule that is equivalent to the current setup WRT permissions is:

SUBSYSTEM=="usb_device", PROGRAM="/bin/sh -c 'X=%k X=$${X#usbdev} B=$${X%%%%.*} D=$${X#*.}; echo bus/usb/$$B/$$D'", SYMLINK+="%c", GROUP="usb"

(that is one long line)

Fine-tunuing of permissions is possible by creating extra rules, matching on something like this:

SUBSYSTEM=="usb_device", SYSFS{idVendor}=="05d8", SYSFS{idProduct}=="4002", GROUP:="scanner"

Change History (5)

comment:1 by alexander@…, 17 years ago

Description: modified (diff)

LFS should integrate the udev rule above.

The patch is no longer needed with libusb-0.1.12. This version of libusb first tries /dev/bus/usb (where udev creates real device nodes with the above rule) and then falls back to /proc/bus/usb (should not happen with linux >= 2.6.14 with proper udev rules, because /dev/bus/usb is always available). Thus, if all applications requiring raw access to USB devices used libusb, one could remove the /proc/bus/usb mount. Unfortunately, VMware and other proprietary apps beyond BLFS may still need this obsolete mount point because they don't use libusb.

/dev/bus/usb and /proc/bus/usb don't conflict. It's just that udev can't be used to set /proc/bus/usb permissions reliably.

comment:2 by archaic@…, 17 years ago

After a very informative conversation with Alexander on this subject it looks like a compromise may be reachable that serves the purpose of base-system configuration, and educational value through BLFS extending that configuration. Details forthcoming on lfs-dev.

comment:3 by bdubbs@…, 17 years ago

Milestone: future6.2
Owner: changed from blfs-book@… to bdubbs@…
Priority: highnormal
Status: newassigned

I've made some changes to the config section of libusb.

Leaving the ticket open for now waiting for critiques.

comment:4 by alexander@…, 17 years ago

There is a conflict between the LFS and BLFS rules. LFS already names USB devices (basically the first rule but with NAME=... instead of SYMLINK), thus, the BLFS rule should be:

SUBSYSTEM=="usb_device", GROUP="usb"

But, that's insecure. The "usb" group must die (it was a hack invented by me in order to avoid the dependency of SANE on Hotplug). Rules of the second kind (matching on vendor and product IDs are already a part of SANE package, but are not installed in BLFS (that's a bug). For libgphoto2, there is a Debian-specific patch that adds a generator for such rules.

As for the /proc/bus/usb mount point, it would be nice to list an example of an application that does require it: VMware.

comment:5 by bdubbs@…, 17 years ago

Resolution: fixed
Status: assignedclosed

Added comment about /proc/bus/usb in "About Devices" page.

Committed revision 6099.

Note: See TracTickets for help on using tickets.