jdb wrote: ↑Sat Jan 23, 2021 11:42 pm
What happens if you use lsusb as someone who isn't root?
same thing, it still works:
Code: Select all
[clever@amd-nixos:~/apps/rpi/rpi-tools]$ lsusb
Bus 006 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 013 Device 030: ID 0000:0000 cleverca22 lk
checking strace i see:
Code: Select all
[clever@amd-nixos:~/apps/rpi/rpi-tools]$ strace -e open,openat lsusb
...
openat(AT_FDCWD, "/sys/bus/usb/devices/usb6/descriptors", O_RDONLY|O_CLOEXEC) = 7
Bus 006 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
openat(AT_FDCWD, "/sys/bus/usb/devices/13-1/manufacturer", O_RDONLY) = 10
openat(AT_FDCWD, "/sys/bus/usb/devices/13-1/product", O_RDONLY) = 10
Bus 013 Device 030: ID 0000:0000 cleverca22 lk
Bus 013 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 012 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
...
Code: Select all
[clever@amd-nixos:~/apps/rpi/rpi-tools]$ strace -e open,openat lsusb 2>&1 | grep product
openat(AT_FDCWD, "/sys/bus/usb/devices/13-1/product", O_RDONLY) = 10
openat(AT_FDCWD, "/sys/bus/usb/devices/8-2/product", O_RDONLY) = 10
[clever@amd-nixos:~/apps/rpi/rpi-tools]$ cat /sys/bus/usb/devices/13-1/product
lk
[clever@amd-nixos:~/apps/rpi/rpi-tools]$ cat /sys/bus/usb/devices/8-2/product
CORSAIR DARK CORE RGB PRO Gaming Dongle
it only tries to read the raw name from the descriptors for 2 of my devices, it might be that my version falls back to the usb descriptors, when the vid:pid database lacks an answer
Code: Select all
[clever@amd-nixos:~/apps/rpi/rpi-tools]$ lsusb --version
lsusb (usbutils) 012
and my pi400 is using an older version!
Code: Select all
pi@pi400:~ $ lsusb --version
lsusb (usbutils) 010
edit:
yep, and that confirms it!
on the desktop:
Code: Select all
[clever@amd-nixos:~/apps/rpi/rpi-tools]$ lsusb
Bus 008 Device 006: ID 1b1c:1b81 Corsair CORSAIR DARK CORE RGB PRO Gaming Dongle
but on the pi400:
Code: Select all
pi@pi400:~ $ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 04d9:0007 Holtek Semiconductor, Inc.
Bus 001 Device 004: ID 1b1c:1b81 Corsair
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub