busybox/util-linux
Peter Korsgaard 5e0e54827f util-linux/lsusb.c: print manufacturer/product strings if available
Just listing the vendor/product IDs is not always very helpful, so add logic
to print the manufacturer and product strings similar to the "big" usbutils
versions.

Not all devices provide sensible strings though.  The usbutils version works
around this by falling back to looking up the vendor/product IDs in the hwdb
and using those strings instead, which is not an option here - Instead
simply trim() the strings for readability.

lsusb | sort
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 0bda:5539 Realtek Semiconductor Corp. Integrated_Webcam_HD
Bus 001 Device 003: ID 0a5c:5842 Broadcom Corp. 58200
Bus 001 Device 030: ID 8087:0aaa Intel Corp. Bluetooth 9460/9560 Jefferson Peak (JfP)
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 002: ID 0bda:5487 Realtek Semiconductor Corp. Dell dock
Bus 006 Device 003: ID 0bda:5413 Realtek Semiconductor Corp. Dell dock
Bus 006 Device 004: ID 413c:b06e Dell Computer Corp. Dell dock
Bus 006 Device 005: ID 0451:8142 Texas Instruments, Inc. TUSB8041 4-Port Hub
Bus 006 Device 006: ID 0bda:402e Realtek Semiconductor Corp. USB Audio
Bus 006 Device 007: ID 413c:1010 Dell Computer Corp. USB 2.0 Hub [MTT]
Bus 006 Device 008: ID 413c:b06f Dell Computer Corp. Dell dock
Bus 006 Device 009: ID 046d:c016 Logitech, Inc. Optical Wheel Mouse
Bus 006 Device 010: ID 413c:2110 Dell Computer Corp. Dell Wired Multimedia Keyboard
Bus 006 Device 011: ID 0451:8142 Texas Instruments, Inc. TUSB8041 4-Port Hub
Bus 006 Device 012: ID 0451:3410 Texas Instruments, Inc. TUSB3410 Microcontroller
Bus 007 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 007 Device 002: ID 0bda:0487 Realtek Semiconductor Corp. Dell dock
Bus 007 Device 003: ID 0bda:0413 Realtek Semiconductor Corp. Dell dock
Bus 007 Device 004: ID 0bda:8153 Realtek Semiconductor Corp. RTL8153 Gigabit Ethernet Adapter

./busybox lsusb | sort
Bus 001 Device 001: ID 1d6b:0002 Linux 6.1.0-13-amd64 xhci-hcd xHCI Host Controller
Bus 001 Device 002: ID 0bda:5539 CNFHH53Q0324300ACA10 Integrated_Webcam_HD
Bus 001 Device 003: ID 0a5c:5842 Broadcom Corp 58200
Bus 001 Device 030: ID 8087:0aaa
Bus 002 Device 001: ID 1d6b:0003 Linux 6.1.0-13-amd64 xhci-hcd xHCI Host Controller
Bus 003 Device 001: ID 1d6b:0002 Linux 6.1.0-13-amd64 xhci-hcd xHCI Host Controller
Bus 004 Device 001: ID 1d6b:0003 Linux 6.1.0-13-amd64 xhci-hcd xHCI Host Controller
Bus 005 Device 001: ID 1d6b:0002 Linux 6.1.0-13-amd64 dummy_hcd Dummy host controller
Bus 006 Device 001: ID 1d6b:0002 Linux 6.1.0-13-amd64 xhci-hcd xHCI Host Controller
Bus 006 Device 002: ID 0bda:5487 Dell Inc. Dell dock
Bus 006 Device 003: ID 0bda:5413 Dell Inc. Dell dock
Bus 006 Device 004: ID 413c:b06e Dell dock
Bus 006 Device 005: ID 0451:8142
Bus 006 Device 006: ID 0bda:402e Generic USB Audio
Bus 006 Device 007: ID 413c:1010 USB 2.0 Hub [MTT]
Bus 006 Device 008: ID 413c:b06f Dell dock
Bus 006 Device 009: ID 046d:c016 Logitech Optical USB Mouse
Bus 006 Device 010: ID 413c:2110 Dell Dell Wired Multimedia Keyboard
Bus 006 Device 011: ID 0451:8142
Bus 006 Device 012: ID 0451:3410 Texas Instruments TUSB3410 Boot Device
Bus 007 Device 001: ID 1d6b:0003 Linux 6.1.0-13-amd64 xhci-hcd xHCI Host Controller
Bus 007 Device 002: ID 0bda:0487 Dell Inc. Dell dock
Bus 007 Device 003: ID 0bda:0413 Dell Inc. Dell dock
Bus 007 Device 004: ID 0bda:8153 Realtek USB 10/100/1000 LAN

./scripts/bloat-o-meter busybox_unstripped{_orig,}
function                                             old     new   delta
trim                                                   -     101    +101
fileAction                                           338     431     +93
add_sysfs_prop                                         -      70     +70
open_read_close                                        -      54     +54
read_close                                             -      35     +35
.rodata                                             3268    3294     +26
------------------------------------------------------------------------------
(add/remove: 5/0 grow/shrink: 2/0 up/down: 379/0)             Total: 379 bytes

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2023-12-13 15:59:47 +01:00
..
volume_id decrease paddign: gcc-9.3.1 slaps 32-byte alignment on arrays willy-nilly 2020-11-30 13:03:03 +01:00
Config.src restore documentation on the build config language 2018-06-06 15:16:48 +02:00
Kbuild.src Convert all util-linux/* applets to "new style" applet definitions 2016-11-23 11:46:32 +01:00
acpid.c Update applet size estimates 2023-07-10 17:25:21 +02:00
blkdiscard.c Update applet size estimates 2023-07-10 17:25:21 +02:00
blkid.c Remove "select PLATFORM_LINUX" 2022-11-29 14:14:06 +01:00
blockdev.c Update applet size estimates 2023-07-10 17:25:21 +02:00
cal.c Update applet size estimates 2023-07-10 17:25:21 +02:00
chrt.c Update applet size estimates 2023-07-10 17:25:21 +02:00
dmesg.c Update applet size estimates 2023-07-10 17:25:21 +02:00
eject.c Update applet size estimates 2023-07-10 17:25:21 +02:00
fallocate.c Update applet size estimates 2023-07-10 17:25:21 +02:00
fatattr.c Update applet size estimates 2023-07-10 17:25:21 +02:00
fbset.c Update applet size estimates 2023-07-10 17:25:21 +02:00
fdformat.c Update applet size estimates 2023-07-10 17:25:21 +02:00
fdisk.c Update applet size estimates 2023-07-10 17:25:21 +02:00
fdisk_aix.c fdisk_aix: fix aliasing warning, comment out unused global variables 2019-10-04 17:16:15 +02:00
fdisk_gpt.c libbb: introduce and use fputs_stdout 2021-02-03 20:52:40 +01:00
fdisk_osf.c libbb: code shrink: introduce and use [_]exit_FAILURE() 2023-06-15 11:55:56 +02:00
fdisk_sgi.c decrease paddign: gcc-9.3.1 slaps 32-byte alignment on arrays willy-nilly 2020-11-30 13:03:03 +01:00
fdisk_sun.c *: add more beneficial NOINLINEs 2021-10-10 14:32:05 +02:00
findfs.c Update applet size estimates 2023-07-10 17:25:21 +02:00
flock.c Update applet size estimates 2023-07-10 17:25:21 +02:00
freeramdisk.c Update applet size estimates 2023-07-10 17:25:21 +02:00
fsck_minix.c libbb: code shrink: introduce and use [_]exit_SUCCESS() 2022-01-05 22:16:06 +01:00
fsfreeze.c Update applet size estimates 2023-07-10 17:25:21 +02:00
fstrim.c Update applet size estimates 2023-07-10 17:25:21 +02:00
getopt.c Update applet size estimates 2023-07-10 17:25:21 +02:00
hexdump.c Update applet size estimates 2023-07-10 17:25:21 +02:00
hexdump_xxd.c Update applet size estimates 2023-07-10 17:25:21 +02:00
hwclock.c hwclock: force LONG_OPTS, stop accepting non-compatible -t 2023-07-14 16:37:24 +02:00
ionice.c Update applet size estimates 2023-07-10 17:25:21 +02:00
ipcrm.c Update applet size estimates 2023-07-10 17:25:21 +02:00
ipcs.c Update applet size estimates 2023-07-10 17:25:21 +02:00
last.c Update applet size estimates 2023-07-10 17:25:21 +02:00
last_fancy.c libbb: factor out fflush_stdout_and_exit(EXIT_SUCCESS) 2022-01-04 23:31:58 +01:00
losetup.c Update applet size estimates 2023-07-10 17:25:21 +02:00
lspci.c Update applet size estimates 2023-07-10 17:25:21 +02:00
lsusb.c util-linux/lsusb.c: print manufacturer/product strings if available 2023-12-13 15:59:47 +01:00
mdev.c Update applet size estimates 2023-07-10 17:25:21 +02:00
mesg.c Update applet size estimates 2023-07-10 17:25:21 +02:00
minix.h more bionic fixes 2016-03-14 19:34:15 +01:00
mkfs_ext2.c Remove "select PLATFORM_LINUX" 2022-11-29 14:14:06 +01:00
mkfs_ext2.txt mkfs_ext2: use compatible inode sizes; add -I <inodesize>. (by Vladimir) 2009-10-22 12:12:17 +02:00
mkfs_ext2_test.sh fix more instances of ": $((a++))" in shell scripts 2017-07-15 19:20:45 +02:00
mkfs_minix.c build system: drop PLATFORM_LINUX 2020-08-13 17:12:56 +02:00
mkfs_reiser.c build system: drop PLATFORM_LINUX 2020-08-13 17:12:56 +02:00
mkfs_vfat.c Update applet size estimates 2023-07-10 17:25:21 +02:00
mkswap.c Update applet size estimates 2023-07-10 17:25:21 +02:00
more.c Update applet size estimates 2023-07-10 17:25:21 +02:00
mount.c Update applet size estimates 2023-07-10 17:25:21 +02:00
mountpoint.c Update applet size estimates 2023-07-10 17:25:21 +02:00
nologin.c nologin: make it possible to build it as single applet 2020-06-24 15:05:22 +02:00
nsenter.c Update applet size estimates 2023-07-10 17:25:21 +02:00
pivot_root.c Update applet size estimates 2023-07-10 17:25:21 +02:00
rdate.c Update applet size estimates 2023-07-10 17:25:21 +02:00
rdev.c Update applet size estimates 2023-07-10 17:25:21 +02:00
readprofile.c Update applet size estimates 2023-07-10 17:25:21 +02:00
renice.c introduce and use exitcode_t 2023-07-17 17:29:36 +02:00
rev.c introduce and use exitcode_t 2023-07-17 17:29:36 +02:00
rtcwake.c Update applet size estimates 2023-07-10 17:25:21 +02:00
script.c Update applet size estimates 2023-07-10 17:25:21 +02:00
scriptreplay.c Update applet size estimates 2023-07-10 17:25:21 +02:00
setarch.c Update applet size estimates 2023-07-10 17:25:21 +02:00
setpriv.c Update applet size estimates 2023-07-10 17:25:21 +02:00
setsid.c Update applet size estimates 2023-07-10 17:25:21 +02:00
swaponoff.c Remove "select PLATFORM_LINUX" 2022-11-29 14:14:06 +01:00
switch_root.c Update applet size estimates 2023-07-10 17:25:21 +02:00
taskset.c Update applet size estimates 2023-07-10 17:25:21 +02:00
uevent.c Update applet size estimates 2023-07-10 17:25:21 +02:00
umount.c introduce and use exitcode_t 2023-07-17 17:29:36 +02:00
unshare.c Update applet size estimates 2023-07-10 17:25:21 +02:00
wall.c Update applet size estimates 2023-07-10 17:25:21 +02:00