From: Kay Sievers <kay.sievers@vrfy.org>
To: linux-hotplug@vger.kernel.org
Subject: Re: Wishlist + bugs for udev-058
Date: Tue, 31 May 2005 22:10:37 +0000 [thread overview]
Message-ID: <20050531221037.GA27926@vrfy.org> (raw)
In-Reply-To: <Pine.LNX.4.58.0505311913410.5087@be1.lrz>
On Tue, May 31, 2005 at 08:54:44PM +0200, Bodo Eggert wrote:
>
> I tried to make udev create the following device nodes for my usb
> stick(s):
>
> /udev/usb/stick%E/disk
> /udev/usb/stick%E/part%n
> /udev/usb/stick%E/sg
> /udev/usb/stick%E/default -> part1, if -e part1
> /udev/usb/stick%E/default -> disk , otherwise
>
> where %E is the same number for each node pointing to a given device,
> starting with 0 (or 1, if you're a pascal programmer:).
>
> The best I could do was usb/%k/* without "default", and I had to use some
> very ugly tricks.
SCSI-devices are not numerically enumerated, so this will not work.
Well, device node enumeration in general is a very bad idea on systems
where devices can come and go at any time. Just forget the enumeration
and switch to a naming-scheme, that uses persistent/unique attributes.
> For those interested, I ended with:
>
> BUS="usb", DRIVER="usb-storage", KERNEL="sg*", PROGRAM="/bin/sh -c
> '/usr/bin/readlink /sys/%p/device/block|/usr/bin/sed -e s,.\*/,,'"
> NAME="usb/%c/sg", GROUP="root", OWNER="root", Mode="600"
> BUS="usb", DRIVER="usb-storage", PROGRAM="/bin/bash -c 'a=%P;echo
> ${a%%/disk};[ $a ]'", NAME="%c/part%n", GROUP="users", OWNER="root",
> Mode="660"
> BUS="usb", DRIVER="usb-storage", NAME="usb/%k/disk", GROUP="users",
> OWNER="root", Mode\x0660
>
> These are the missing features and the bugs I encountered while I tried:
>
> Wish: Make sg devices be a child of their corresponding devices
That's a kernel thing. Try to convince the scsi-guys. :)
> Wish: Support really fprintf-like syntax
>
> Bug: PROGRAM="/bin/sh -c '/usr/bin/readlink \
> /sys/%p/device/block|/usr/bin/sed -e \
> s,.\*/,,'" will be run with an empty extra parameter
Use a script for stuff like that.
> Wish: Comparing using !
Doesn't it work?
> Wish: Comparing and string replacement using extended regex
> (compiletime-optional)
Again, use a script if you need this. Udev supports only simple pattern
matching like fnmatch().
> Wish: Direct access to the "parent device" variable.
What does 'variable' mean? The name of the node?
> Wish: Query the existence and the number of partitions.
Look at sysfs for yourself. It's beyond the scope of udev.
> Wish: User variables. I'd like to use e.g. V{name}="foo", V{name}="foo"
> and NAME="%v{name}"
Care to give a good real-world example why this is needed.
> Wish: Remove empty directories on unlinking device nodes
Doesn't it work?
> Bug?: SYSFS{removable}="1" is found for /block/sdd, but not for
> /block/sdd/sdd1. Is that intentional?
How does the failing rule look like? You can match only against sysfs
files in one and the same directory. SYSFS{../removable} may work as a
bad trick. :)
> Bug: udev stops to honor rules containing NAME="foo" after it has found
> the first one. This behaviour is undocumentated.
Fixed with the next version.
> Misfeature: udevtest will not give debugging output unless udev will do
> the same, and there is no way to get the debugging output without
> reconfiguring syslog or changing the source code. If debugging is enabled,
> the config parsing will be too chatty to be useful.
Compile with debug, disable debug in the config and try:
UDEV_LOG=7 ./udevinfo ...
> Bug: Dependencies on logging.h are missing in the Makefile.
Fixed with the next version.
> Misfeature: Fancy make output on non-ttys, will mess up IDEs like jstar
> and emacs.
pass V=1
Kay
-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
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:[~2005-05-31 22:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-31 18:54 Wishlist + bugs for udev-058 Bodo Eggert
2005-05-31 22:10 ` Kay Sievers [this message]
2005-06-01 1:00 ` Patrick Mansfield
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=20050531221037.GA27926@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).