From: Frank Peters <frank.peters@comcast.net>
To: gentoo-amd64@lists.gentoo.org
Subject: Re: [gentoo-amd64] Re: USB Scanner Problems with Newer Kernels/Libusb [Solved]
Date: Sat, 9 Nov 2013 21:36:02 -0500 [thread overview]
Message-ID: <20131109213602.38a24c9a1acfa85a00a6c2e0@comcast.net> (raw)
In-Reply-To: <20131110015302.GA6695@crud>
On Sat, 9 Nov 2013 19:53:02 -0600
Barry Schwartz <chemoelectric@chemoelectric.org> wrote:
>
> I figured as much. Please let us know if you come up with a good
> technique that can be adapted to a MAKEDEV script or such. It is nice
> to know how to dump e?udev, just in case; and I also use a scanner.
>
As soon as I plugged in the scanner (after starting the udev daemon)
an entry was created in /run/udev/data for c189:131. This obviously
refers to a device node for a character (c) file with a major number
of 189 and a minor number of 131. This is all that is needed to access
the device through the kernel.
However, with udev and libusb there are user-space conventions.
A utility such as libusb expects device nodes to be in a certain
location, i.e. /dev/bus/usb, and to be named a certain name, i.e.
001, 002, etc. If not for these conventions the device node could
be placed anywhere and named anything.
So, to stick to conventions, create the node in /dev/bus/usb:
mknod --mode=0666 /dev/bus/usb/001 c 189 131
That's it. Now the scanner can be detected by libusb and SANE.
Furthermore, this is a *permanent* device node. It will not
disappear upon reboot. The udev daemon is needed only once
to get the major/minor numbers.
However, if the device is unplugged and then plugged back in again
the minor number usually jumps. So just create a sequence of
nodes to allow for this:
mknod --mode=0666 /dev/bus/usb/002 c 189 132
mknod --mode=0666 /dev/bus/usb/003 c 189 133 ...
Upon reboot, the node will reset back to the first minor number.
If you check devices.txt in the kernel source documentation, these
particular major/minor numbers are not listed for any device. I don't
know where they come from, but as long as they work I don't care.
However, this would preclude using something like MAKEDEV to pre-build
these nodes. Also, user-space programs expect certain node naming
conventions and I don't know where such conventions are listed.
A new issue is determining how udev gets its device info. The kernel
sends out a notice when it detects a new device and the udev daemon
gets the notice and then reads the new kernel device parameters
from somewhere. But from where? If this were known then any script
could read the same parameters.
In short, if udev reads data from the kernel then a simple custom
program or script could accomplish the same thing.
Frank Peters
next prev parent reply other threads:[~2013-11-10 2:36 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-09 3:25 [gentoo-amd64] USB Scanner Problems with Newer Kernels/Libusb Frank Peters
2013-11-09 12:29 ` [gentoo-amd64] " Duncan
2013-11-09 16:45 ` Frank Peters
2013-11-09 20:40 ` Barry Schwartz
2013-11-09 21:38 ` Frank Peters
2013-11-09 22:11 ` Barry Schwartz
2013-11-09 22:57 ` Mark Knecht
2013-11-09 23:10 ` Barry Schwartz
2013-11-10 16:54 ` Tanstaafl
2013-11-10 17:08 ` Barry Schwartz
2013-11-09 23:25 ` Frank Peters
2013-11-09 23:57 ` Barry Schwartz
2013-11-10 1:30 ` [gentoo-amd64] Re: USB Scanner Problems with Newer Kernels/Libusb [Solved] Frank Peters
2013-11-10 1:53 ` Barry Schwartz
2013-11-10 2:36 ` Frank Peters [this message]
2013-11-10 4:26 ` Frank Peters
2013-11-12 0:03 ` Frank Peters
2013-11-12 23:18 ` [gentoo-amd64] " Jörg Schaible
2013-11-13 9:14 ` Paul Jewell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20131109213602.38a24c9a1acfa85a00a6c2e0@comcast.net \
--to=frank.peters@comcast.net \
--cc=gentoo-amd64@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox