[BLFS Trac] #1680: /proc/bus/usb is obsolete

Alexander E. Patrakov patrakov at ums.usu.ru
Sun May 7 20:31:02 PDT 2006

Bruce Dubbs wrote:

> Alexander,
> I'm getting frustrated here.  Which is it?  Should libusb have a udev
> rule or not? Is the rule above the complete rule?

LFS already has a rule for raw USB devices. But it doesn't set the group. Since 
the "usb" group is still in LFS, this is a bug in LFS.

> The rule now 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"

This rule was supposed to create _symlinks_ /dev/bus/usb/1/2 -> /dev/usbdev1.2. 
This no longer works because of this new rule in LFS, which makes 
/dev/bus/usb/1/2 real device _nodes_.

> which *you* originally put into the ticket.

And the consensus upon "real node vs symlink" has changed since then.

> I put the rule at /etc/udev/rules.d/23-usb-rules, which comes before the
> 25-lfs-rules.  My understanding, admittedly incomplete, is that the
> first rule encountered will be executed and others skipped.  Is this not
> true?

This is not true.

> Secondly, this is a ticket about libusb.  Don't start introducing issues
> with libgphoto2 and sane here.  If there are multiple issues to be
> discussed, lets do it on blfs-dev.

OK, but this has to be coordinated with LFS. Please solve the following 
political question before we can continue:

1) What should be done with the "usb" group in the short term.

Possible answers:

a) keep it in LFS (then LFS should assign the group, and BLFS should show how to 
override that, as in the "scanner" example),
b) move to BLFS (in this case, BLFS should create this group and add a rule: 
SUBSYSTEM=="usb_device", GROUP="usb", and there is already some example text 
about the "scanner" group),
c) drop it immediately (in this case, only the example rule with the "scanner" 
group should remain).

Then there are technical non-problems:

2) What should be done with the "usb" group in the long term.

Here no discussion is possible. It was introduced as a hack to make USB scanners 
and cameras work for non-root without the "hotplug" package in LFS-6.0. It gives 
too-broad rights, and should be either removed completely or strongly advised to 
remain empty.

3) What should be done with scanners and cameras.

There is already an example how to override the group, so scanners won't be made 
non-functional. In the future, we should mass-install rules for SANE and 
libgphoto2. Text will be posted after solving the first (political) issue I raised.

Alexander E. Patrakov

More information about the lfs-dev mailing list