From: Kay Sievers <kay.sievers@vrfy.org>
To: linux-hotplug@vger.kernel.org
Subject: Re: [Libusb-devel] udev craze: need /dev/bus/usb rationale
Date: Fri, 27 Jan 2006 02:17:47 +0000 [thread overview]
Message-ID: <20060127021747.GA27555@vrfy.org> (raw)
In-Reply-To: <20060126094517.GA4063@bode.aurel32.net>
On Thu, Jan 26, 2006 at 06:08:11PM -0800, Johannes Erdfelt wrote:
> On Wed, Jan 25, 2006, Linus Walleij <triad@df.lth.se> wrote:
> > Having fun making packages for Fedora we have run into a coordination
> > issue between udev and libusb.
> >
> > As you know libusb programs (like SANE custom USB backends or my own pet
> > libnjb) use raw device nodes with no kernel drivers attached to them. A
> > suitable udev rule found in this mail:
> >
> > http://sourceforge.net/mailarchive/message.php?msg_id\x12695893
> >
> > looks like this:
> >
> > SUBSYSTEM="usb_device", PROGRAM="/bin/sh -c 'X=%k X=$${X#usbdev}
> > B=$${X%%%%.*}
> > D=$${X#*.}; echo bus/usb/$$B/$$D'", SYMLINK="%c"
> >
> > has been applied to most distributions set of default rules. (Well Debian
> > and Fedora atleast, I guess SuSE too.)
> >
> > This rule creates a dynamic device hierarchy belowe /dev/bus/usb similar
> > to the good 'ol /proc/bus/usb and everyone is happy. Libusb was patched
> > to support this device hierarchy. But wait. We found an inconsistency:
> > that script will create hex-named nodes:
> >
> > /dev/bus/usb/01AB1/01BCF
> >
> > However libusb has this code in linux.c row 336 or so:
> >
> > if (!strchr("0123456789", entry->d_name[strlen(entry->d_name) - 1]))
> >
> > Of course it could be fixed with a patch:
> >
> > if (!strchr("0123456789ABCDEF", entry->d_name[strlen(entry->d_name) - 1]))
> >
> > But we need a clear rationale:
> >
> > * How shall /dev/bus/usb subdirs and device files be named?
> >
> > * If they shall be all decimal figures, change all rules accordingly and
> > libusb will work fine as it is.
> >
> > * If they shall be hex, make the above suggested change to libusb.
>
> Coming in late to this thread and I see that the node has been changed
> from hexadecimal to decimal.
Well, they never have been hex. I expect its a "bug" in some shell, I've
never seen this or can reproduce it, even with the old version of the rule
that seems to produce this for some people.
> I want to understand the reason for these device nodes since they seem
> to duplicate the nodes found in /proc/bus/usb. Is this just part of the
> long term plans to remove usbdevfs?
Yes, we want to leave /proc with all stuff that isn't process related.
And as all the major distros depend on udev and have /dev on tmpfs, having
usb devices in /proc makes no sense anymore.
We also want the option to apply access control lists to device nodes,
to allow a set of users (fast-user-switching) access to a device and
this would not work with /proc files, which can only have primary
ownership.
Kay
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x103432&bid#0486&dat\x121642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
next prev parent reply other threads:[~2006-01-27 2:17 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-26 9:45 [Libusb-devel] udev craze: need /dev/bus/usb rationale Aurelien Jarno
2006-01-26 10:16 ` Linus Walleij
2006-01-27 2:08 ` Johannes Erdfelt
2006-01-27 2:17 ` Kay Sievers [this message]
2006-01-27 2:25 ` Greg KH
2006-01-27 2:26 ` Johannes Erdfelt
2006-01-27 3:01 ` Kay Sievers
2006-01-27 3:17 ` Greg KH
2006-01-27 3:38 ` Charles Lepple
2006-01-27 3:51 ` Kay Sievers
2006-01-27 3:53 ` Kay Sievers
2006-01-27 4:01 ` Andrey Borzenkov
2006-01-27 4:05 ` Andrey Borzenkov
2006-01-27 4:11 ` Kay Sievers
2006-01-27 4:20 ` Greg KH
2006-01-27 4:21 ` Greg KH
2006-01-27 4:23 ` Greg KH
2006-01-27 7:50 ` Linus Walleij
2006-01-27 11:56 ` Olivier Blin
2006-01-27 17:04 ` David Zeuthen
2006-01-27 17:15 ` Olivier Blin
2006-01-27 17:28 ` Darren Salt
2006-01-27 17:33 ` Bill Nottingham
2006-01-27 19:29 ` Johannes Erdfelt
2006-01-27 19:39 ` Linus Walleij
2006-01-27 19:44 ` Johannes Erdfelt
2006-01-27 20:45 ` Greg KH
2006-01-28 0:12 ` Greg KH
2006-02-06 23:29 ` Johannes Erdfelt
2006-02-06 23:53 ` Greg KH
2006-02-07 0:00 ` Johannes Erdfelt
2006-02-07 0:23 ` Greg KH
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=20060127021747.GA27555@vrfy.org \
--to=kay.sievers@vrfy.org \
--cc=linux-hotplug@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).