Bug 248916 - No /dev/bus/usb nodes
Summary: No /dev/bus/usb nodes
Alias: None
Product: Fedora
Classification: Fedora
Component: udev   
(Show other bugs)
Version: rawhide
Hardware: All Linux
Target Milestone: ---
Assignee: Harald Hoyer
QA Contact: Fedora Extras Quality Assurance
Keywords: Reopened
Depends On:
Blocks: 248740
TreeView+ depends on / blocked
Reported: 2007-07-19 16:18 UTC by Tim Waugh
Modified: 2007-11-30 22:12 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-07-23 16:04:35 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Tim Waugh 2007-07-19 16:18:54 UTC
Description of problem:
There are no /dev/bus/usb/ nodes any more.  This breaks HPLIP.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Plug in a USB device.
2. ls /dev/bus/usb
Actual results:
ls: cannot access /dev/bus/usb: No such file or directory

Expected results:

Comment 1 Harald Hoyer 2007-07-19 16:29:46 UTC
Hmm, the rule:
ACTION=="add", SUBSYSTEM=="usb_device", \
        PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; printf bus/usb/%%03i/%%03i
$${K%%%%.*} $${K#*.}'", \
        NAME="%c", MODE="0644"

didn't change... will debug..

Comment 2 Harald Hoyer 2007-07-19 16:41:03 UTC
SUBSYSTEM=="usb_device" changed to SUBSYSTEM=="usb_endpoint" in the kernel it
seems... :-/

Comment 3 Hans de Goede 2007-07-19 17:15:50 UTC
Harald, I've been bitten by this and would like to confirm its fixed, in which
version is it fixed?

Comment 4 Harald Hoyer 2007-07-19 22:03:47 UTC

Comment 5 Tim Waugh 2007-07-20 08:15:02 UTC
I installed that package and rebooted, but it still doesn't seem to have helped:

[root@hoopoe rules.d]# lsusb
Bus 002 Device 001: ID 0000:0000  
Bus 001 Device 008: ID 03f0:3304 Hewlett-Packard DeskJet 990c
Bus 001 Device 005: ID 046d:c03f Logitech, Inc. 
Bus 001 Device 003: ID 045e:00db Microsoft Corp. 
Bus 001 Device 002: ID 050d:0234 Belkin Components F5U234 USB 2.0 4-Port Hub
Bus 001 Device 001: ID 0000:0000  
[root@hoopoe rules.d]# rpm -q udev
[root@hoopoe rules.d]# ls /dev/bus
ls: cannot access /dev/bus: No such file or directory

Comment 6 Harald Hoyer 2007-07-20 10:49:58 UTC

Jul 20 12:48:19 localhost udevd-event[6004]: run_program: '/bin/sh -c
'K=usbdev5.5_ep82; K=${K#usbdev}; printf bus/usb/%03i/%03i ${K%%.*} ${K#*.}''
Jul 20 12:48:19 localhost udevd-event[6004]: run_program: '/bin/sh' (stdout)
Jul 20 12:48:19 localhost udevd-event[6004]: run_program: '/bin/sh' (stderr) ':
line 0: printf: 5_ep82: invalid number'
Jul 20 12:48:19 localhost udevd-event[6004]: run_program: '/bin/sh' returned
with status 1
Jul 20 12:48:19 localhost udevd-event[6003]: run_program: '/bin/sh -c
'K=usbdev5.5_ep01; K=${K#usbdev}; printf bus/usb/%03i/%03i ${K%%.*} ${K#*.}''
Jul 20 12:48:19 localhost udevd-event[6003]: run_program: '/bin/sh' (stdout)
Jul 20 12:48:19 localhost udevd-event[6003]: run_program: '/bin/sh' (stderr) ':
line 0: printf: 5_ep01: invalid number'
Jul 20 12:48:19 localhost udevd-event[6003]: run_program: '/bin/sh' returned
with status 1

Comment 7 Harald Hoyer 2007-07-20 11:33:26 UTC
ok, got it:

ACTION=="add", SUBSYSTEM=="usb", ATTR{devnum}=="?*", ATTR{busnum}=="?*", \
PROGRAM="/bin/sh -c 'printf bus/usb/%%03i/%%03i $attr{busnum} $attr{devnum}'", \
NAME="%c", MODE="0644"

.. the question is, if we need %03i ... if not the rule would be:ACTION=="add", 

SUBSYSTEM=="usb", ATTR{devnum}=="?*", ATTR{busnum}=="?*", \
NAME="bus/usb/$attr{busnum}/$attr{devnum}", MODE="0644"

Comment 8 Tim Waugh 2007-07-20 11:58:22 UTC
Yes, the simpler two-line rule works fine here. (Needed some other HPLIP and
SELinux changes, but now the device node is correct.)

Comment 9 Fabrice Bellet 2007-07-21 11:53:14 UTC
Hi! The rule should be backported to F-7, as kernel- in F-7 updates is
concerned too. And the nut udev rule (nut-usbups.rules) should also be changed.

Comment 10 Kay Sievers 2007-07-21 20:10:04 UTC
There is no incompatible change unless you disable CONFIG_USB_DEVICE_CLASS
(defaults to yes) in the kernel. Old distros should not need anything here.

For new distros it is recommended to switch entirely to the new device nodes, as
the old ones have unsolvable event timing problems.

Btw, the simplest rule to create the same nodes from the new devices is:
  SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", NAME="bus/usb/$env{
BUSNUM}/$env{DEVNUM}", MODE="0644"

Comment 11 Hans de Goede 2007-07-22 09:58:30 UTC
These nodes now get created correctly under rawhide with udev-113-6.fc8 (and
printing works). I think that maybe this can be closed, I say maybe, because if
comment #9 is correct this needs to be fixed for F-7 too.

Comment 12 Patrick Boutilier 2007-07-23 13:48:56 UTC

I ran into this bug trying to use a Creative Zen Vplus MP3 player with Amarok
and gnomad2. Could not connect to the device unless I used root user. I used the
udev rule suggested in the kernel source to solve the problem since
CONFIG_USB_DEVICE_CLASS is not enabled in the kernel. From Kconfig:


Userspace access to USB devices is granted by device-nodes exported            
directly from the usbdev in sysfs. Old versions of the driver                  
core and udev needed additional class devices to export device nodes.          
These additional devices are difficult to handle in userspace, if              
about USB interfaces must be available. One device                             
                                                        contains the device
node, the other device contains the interface                                  
                                                data. Both devices are at the
same level in sysfs (siblings) and one                                         
                                   can't access the other. The device node
created directly by the                                                        
                            usb device is the parent device of the interface and
                 easily accessible from the interface event.                   
This option provides backward compatibility for libusb device                  
(lsusb) when usbfs is not used, and the following udev rule                    
                                                              doesn't exist:   

   SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", \              
   NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", MODE="0644"                       

Comment 13 Chuck Ebbert 2007-07-23 16:04:35 UTC
Closing as fixed in rawhide. Bug for Fedora 7 is #249211.

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