Opened 19 years ago
Closed 19 years ago
#1976 closed task (fixed)
Udev rule required to support non-root use of lsusb
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Milestone: | 6.2.0 |
Component: | BOOK | Version: | SVN |
Severity: | normal | Keywords: | lsusb |
Cc: |
Description ¶
http://sourceforge.net/projects/linux-usb/
This provides an lsusb command similar to lspci.
I'll leave it to Bruce and Randy as to what milestone this should be assigned to.
Change History (10)
comment:1 by , 19 years ago
comment:2 by , 19 years ago
Keywords: | lsusb added |
---|---|
Milestone: | → 6.2 |
Owner: | changed from | to
Status: | new → assigned |
comment:3 by , 19 years ago
Good idea. As it happens I just yesterday successfully came up on udev 092, with libusb 0.1.12, and usbfs removed from the kernel. The rule
SUBSYSTEM=="usb_device", PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; printf bus/usb/%%03i/%%03i $${K%%%%.*} $${K#*.}'", MODE="0644", NAME="%c"
that is suggested in udev-092 works well. The mode 644 is needed for lsusb to display anything when it is not root.
comment:4 by , 19 years ago
Owner: | changed from | to
---|---|
Status: | assigned → new |
Summary: | New package usbutils to complement pciutils → Udev rule required to support non-root use of lsusb |
Type: | enhancement → task |
Updated the book by adding the usbutils package. However, the Udev rule above needs to be placed on the new devices page. As I'm not fully in tune with all the Udev rules, I'll defer to someone with a bit more knowelege to review the suggestion above and implement it.
I can confirm that non-root users do not see any output when running the lsusb program.
I'm leaving the bug open, removing myself as the owner and updating the subject description.
comment:5 by , 19 years ago
Doesn't this bug belong to LFS, as opposed to BLFS? Default USB permissions are set in LFS.
comment:6 by , 19 years ago
This ticket may belong to either BLFS or LFS depending on the final LFS udev rules.
One question I'd like to dicusss is whether this is a problem at all. The ticket implies that regular users should be able to list usb devices, but should they? Perhaps it should be root only. After all, the program is installed in /usr/sbin.
On a related note, I'm not if its because I don't have the latest udev rules installed (they are about two weeks old), but when executing as root, I get:
cannot open /proc/bus/usb/devices, No such file or directory
My /proc/bus/usb directoy is empty, even though I am using a usb mouse.
comment:7 by , 19 years ago
For lsusb to work you either need usbfs mounted on /proc/bus/usb or you need a udev rule that populates /dev/bus/usb and libusb 0.1.12 (that looks in /dev/bus/usb).
comment:8 by , 19 years ago
As to who should be allowed to do what, it is no different than any other permissions policy decision that the system administration might make.
I mentioned the mode because we are in a little bit of uncharted water here moving away from usbfs, and it took me a while to figure out that was the missing piece, as opposed to some missing piece of implementation in libusb or lsusb, or something else not set up properly. Hopefully it would save someone else some time.
As to the origin of /sbin, "If these were truly "root only" commands, then /sbin and /usr/sbin would have 700 permissions. Long, apparently too long ago, /sbin (and /usr/sbin) were reserved by informal convention for commands that were statically linked". Although, it has become the practice not to have /sbin and /usr/sbin in the path for regular users.
- Marty Jack
comment:9 by , 19 years ago
The libusb style udev rule is now part of stable LFS. And the libusb page adds the udev rule to set the group for these devices to "usb". I think this part is taken care of and this bug can be closed.
comment:10 by , 19 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
This one's done. The package is in the book, and the appropriate udev rules are in place from the LFS udev-config tarball and on the libusb page.
I would love to see this go into the book ASAP.
Bruce, any objections? If not, I'll put it in today.