Bug 178994 - Device search order
Device search order
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: libusb (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jindrich Novy
:
Depends On:
Blocks: 177650 178543
  Show dependency treegraph
 
Reported: 2006-01-26 05:04 EST by Linus Walleij
Modified: 2013-07-02 19:13 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-01-27 04:25:34 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Linus Walleij 2006-01-26 05:04:57 EST
Debian has applied the following patch to libusb-0.1.11:

--- libusb-0.1.11.orig/linux.c
+++ libusb-0.1.11/linux.c
@@ -633,14 +633,11 @@
   }

   if (!usb_path[0]) {
-    if (check_usb_vfs("/proc/bus/usb")) {
-      strncpy(usb_path, "/proc/bus/usb", sizeof(usb_path) - 1);
-      usb_path[sizeof(usb_path) - 1] = 0;
-    } else if (check_usb_vfs("/sys/bus/usb")) { /* 2.6 Kernel with sysfs */
-      strncpy(usb_path, "/sys/bus/usb", sizeof(usb_path) -1);
+    if (check_usb_vfs("/dev/bus/usb")) {
+      strncpy(usb_path, "/dev/bus/usb", sizeof(usb_path) - 1);
       usb_path[sizeof(usb_path) - 1] = 0;
-    } else if (check_usb_vfs("/dev/usb")) {
-      strncpy(usb_path, "/dev/usb", sizeof(usb_path) - 1);
+    } else if (check_usb_vfs("/proc/bus/usb")) {
+      strncpy(usb_path, "/proc/bus/usb", sizeof(usb_path) - 1);
       usb_path[sizeof(usb_path) - 1] = 0;
     } else
       usb_path[0] = 0; /* No path, no USB support */

This has been done so that devices in /dev/bus/usb be tried first,
then /proc/bus/usb, and never try /sys/bus/usb.

Can this be applied to Fedoras libusb also? (Or is it already?) 
It is in line with the rest of our architectural choices.
Comment 1 Linus Walleij 2006-01-26 05:10:13 EST
Notice: udev was altered to provide the devices in /dev/bus/usb,
not in /dev/usb as libusb expects, so this is also a consistency
issue.
Comment 2 Jindrich Novy 2006-01-26 07:28:19 EST
Looks good to me. I'm looking at the upstream discussion you contributed, so if
there's no fatal objection to it, I'll apply it today.
Comment 3 Linus Walleij 2006-01-27 02:46:41 EST
The patch has been applied to upstream CVS and will be in libusb 0.1.12,
so it's quite safe I guess.
Comment 4 Jindrich Novy 2006-01-27 04:25:34 EST
Applied since libusb-0.1.11-2. Thanks!

Note You need to log in before you can comment on or make changes to this bug.