usbutils-012

#### Beyond Linux® From Scratch (systemd Edition) - Version 9.0

### Chapter 12. System Utilities

- Prev

  UPower-0.99.10

- Next

  Which-2.21 and Alternatives

- Up
- Home

# usbutils-012

## Introduction to USB Utils

The USB Utils package contains utilities used to display information about USB buses in the system and the devices connected to them.

This package is known to build and work properly using an LFS-9.0 platform.

### Package Information

- Download (HTTP): https://www.kernel.org/pub/linux/utils/usb/usbutils/usbutils-012.tar.xz

- Download MD5 sum: 0da98eb80159071fdbb00905390509d9

- Download size: 100 KB

- Estimated disk space required: 6.6 MB

- Estimated build time: 0.2 SBU

### USB Utils Dependencies

#### Required

libusb-1.0.22 and Wget-1.20.3

User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/usbutils

## Installation of USB Utils

Install USB Utils by running the following commands:

    ./autogen.sh --prefix=/usr --datadir=/usr/share/hwdata &&
    make

This package does not come with a test suite.

Now, as the `root` user:

    make install

To install the `usb.ids` data file, using Wget-1.20.3, run, as the `root` user:

    install -dm755 /usr/share/hwdata/ &&
    wget http://www.linux-usb.org/usb.ids -O /usr/share/hwdata/usb.ids

The script lsusb.py displays information in a more easily readable form than lsusb. To find the options, use lsusb.py -h. One form of use recommended by the developer is lsusb.py -ciu.

## Configuring USB Utils

You should update the `/usr/share/hwdata/usb.ids` file periodically. Execute the following commands, as the `root` user, to create a systemd timer to update it weekly on Sundays at 2:30 A.M. (local time):

    cat > /lib/systemd/system/update-usbids.service << "EOF" &&
    [Unit]
    Description=Update usb.ids file
    Documentation=man:lsusb(8)
    DefaultDependencies=no
    After=local-fs.target network-online.target
    Before=shutdown.target

    [Service]
    Type=oneshot
    RemainAfterExit=yes
    ExecStart=/usr/bin/wget http://www.linux-usb.org/usb.ids -O /usr/share/hwdata/usb.ids
    EOF
    cat > /lib/systemd/system/update-usbids.timer << "EOF" &&
    [Unit]
    Description=Update usb.ids file weekly

    [Timer]
    OnCalendar=Sun 03:00:00
    Persistent=true

    [Install]
    WantedBy=timers.target
    EOF
    systemctl enable update-usbids.timer

## Contents

Installed Programs: lsusb, lsusb.py, usb-devices, and usbhid-dump
Installed Libraries: None
Installed Directories: None

### Short Descriptions

lsusb | is a utility for displaying information about all USB buses in the system and all devices connected to them, but not in human friendly form.
lsusb.py | displays information about all USB buses in the system and all devices connected to them in reasonable human friendly form.
usb-devices | is a shell script that displays details of USB buses and devices connected to them. It is designed to be used if /proc/bus/usb/devices is not available on your system.
usbhid-dump | is used to dump report descriptors and streams from HID (human interface device) interfaces of USB devices.

Last updated on 2019-08-17 15:16:30 -0700

- Prev

  UPower-0.99.10

- Next

  Which-2.21 and Alternatives

- Up
- Home