[Toybox] new toy: lsusb

Rob Landley rob at landley.net
Tue May 14 16:06:41 PDT 2013


On 05/14/2013 12:56:00 AM, Andre Renaud wrote:
> Hi,
> Attached is a pretty simple implementation of lsub. It doesn't
> implement any of the flags/options, but does the raw output. I believe
> this is essentially the same functionality as what is available from
> busybox.

Very nice. (Applied.)

Is there something special about the entries that have DEVTYPE= as the  
first line? Depending on the ordering seems darn subtle here. I did a  
quick:

   for i in /sys/bus/usb/devices/*/uevent; do echo $i; cat $i; done

And for example:

   /sys/bus/usb/devices/usb4/uevent

Has DEVTYPE= as entry #4, but will be skipped because it doesn't come  
_first_. (This matches what the host's lsusb is doing, but strace never  
has it opening uevent.)

It looks like the displayed devices are filenames [0-9].*:.* so starts  
with a digit, contains a colon?

Rob
 1368572801.0


More information about the Toybox mailing list