usbutils – USB userspace utilities for Linux, how to compile, install and use on Ubuntu

Clone the source code using below command,

 $ git clone git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usbutils.git
 $ cd usbutils/

first get usbhid-dump :

 $ git submodule init

Submodule ‘usbhid-dump’ (https://github.com/DIGImend/usbhid-dump.git) registered for path ‘usbhid-dump’

 $ git submodule update

initialize autobuild with:

 $ autoreconf --install --symlink

Create an temporary directory if you just want to compile and install in local folder instead of standard directories like /usr/bin etc,

 $ mkdir out

configure with:

 $ ./configure --prefix=/home/devbee/wp/usbutils

Above command generated an error like below,

checking pkg-config is at least version 0.9.0… yes
checking for LIBUSB… no
configure: error: Package requirements (libusb-1.0 >= 1.0.9) were not met:

No package ‘libusb-1.0’ found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables LIBUSB_CFLAGS
and LIBUSB_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

Which means our ubuntu is lacking libusb installation.

You can check the currently installed libusb version as,

 $ dpkg -l libusb*

Make sure you have both of the below packages installed,

 sudo apt-get install  libusb-1.0-0 libusb-1.0-0-dev

After running configure command, we got following error,

checking for UDEV… no
configure: error: Package requirements (libudev >= 196) were not met:

No package ‘libudev’ found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables UDEV_CFLAGS
and UDEV_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

 sudo apt-get install libudev-dev
 $ ./configure --prefix=/home/devbee/wp/usbutils/out

Now compile with:

 $ make

and install as,

 $ make install
$ tree out/
out/
├── bin
│   ├── lsusb
│   ├── lsusb.py
│   ├── usb-devices
│   └── usbhid-dump
└── share
    └── man
        ├── man1
        │   └── usb-devices.1
        └── man8
            ├── lsusb.8
            └── usbhid-dump.8

5 directories, 7 files
Android Android Commands Android Java Applications Application Libraries Bash / Shell Scripts Bluetooth driver Build Frameworks Commands and Packages Core Kernel C Programs Development Environment Setup Documents / Books Errors & Failures File Systems Framebuffer / Display Driver git Go Language Programs Hardware Platforms Home Kernel & Device Drivers Kernel Booting and Porting Linux, OS Concepts and Networking Linux Device Drivers Linux Host, Ubuntu, SysAdmin Linux Kernel Linux Networking Middleware Libraries, HAL NDK / Middleware / HAL Network Driver OS Concepts PHP Procfs Filesystem Programming Languages RaspberryPi Scripting and Automation Search Engine Optimisation ( SEO ) Social Media Socurce Code Management ( SCM ) System Administration, Security Testing and Debugging Uncategorized Userspace Utilities Web design and development Wordpress Yocto / Bitbake / Openembedded
Tags:

Leave a Reply