:: Re: [DNG] What's /dev/bus/usb?
Top Page
Delete this message
Reply to this message
Author: tilt!
Date:  
To: dng
Subject: Re: [DNG] What's /dev/bus/usb?
Hi Steve,

On 08/27/2015 03:43 PM, Steve Litt wrote:
> Hi all,
>
> What's /dev/bus/usb? On Wheezy, this is where you must aim your
> inotifywait command to detect insertion and removal of flash drives.


As I understand it, it is a concatenation from the dev directory
root (which is /dev) and a "syspath", provided by the kernel
(that is bus/usb). The concatenation is performed by udev and
applied as result of a builtin rule (i.e. this is not in
/lib/udev/rules.d or whatever).

> Is /dev/bus/usb used on Devuan?


Apparently so.

  lsb_release -id && ls -ld /dev/bus/usb/001/001
  Distributor ID:    Devuan
  Description:    Devuan GNU/Linux 2.0 (ascii)
  crw-rw-r-- 1 root root 189, 0 Aug 19 04:55 /dev/bus/usb/001/001


It is a drop-in replacement for the previous usbfs which was mounted
at /proc/bus/usb. As I understand it, it has the same layout and
implements a subset of the former's features.

> Is /dev/bus/usb a udev thang, and if so, does vdev continue the
> tradition?


I could not yet identify the exact code that accomplishes this
syspath and/or device path naming either in kernel or in udev.

On the vdev end, it's much easier, the code that implements is:

https://github.com/jcnelson/vdev/blob/master/vdevd/helpers/LINUX/usb-name.sh

So the answer to the second part of your question is yes.

Kind regards,
T.