Bug 248916

Summary: No /dev/bus/usb nodes
Product: [Fedora] Fedora Reporter: Tim Waugh <twaugh>
Component: udevAssignee: Harald Hoyer <harald>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: rawhideCC: fabrice, hdegoede, kay.sievers
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-07-23 12:04:35 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Bug Depends On:    
Bug Blocks: 248740    

Description Tim Waugh 2007-07-19 12:18:54 EDT
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 12:29:46 EDT
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 12:41:03 EDT
SUBSYSTEM=="usb_device" changed to SUBSYSTEM=="usb_endpoint" in the kernel it
seems... :-/
Comment 3 Hans de Goede 2007-07-19 13:15:50 EDT
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 18:03:47 EDT
Comment 5 Tim Waugh 2007-07-20 04:15:02 EDT
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 06:49:58 EDT

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 07:33:26 EDT
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 07:58:22 EDT
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 07:53:14 EDT
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 16:10:04 EDT
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 05:58:30 EDT
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 09:48:56 EDT

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 12:04:35 EDT
Closing as fixed in rawhide. Bug for Fedora 7 is #249211.