* Wishlist + bugs for udev-058
@ 2005-05-31 18:54 Bodo Eggert
2005-05-31 22:10 ` Kay Sievers
2005-06-01 1:00 ` Patrick Mansfield
0 siblings, 2 replies; 3+ messages in thread
From: Bodo Eggert @ 2005-05-31 18:54 UTC (permalink / raw)
To: linux-hotplug
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.
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
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
Wish: Comparing using !
Wish: Comparing and string replacement using extended regex
(compiletime-optional)
Wish: Direct access to the "parent device" variable.
Wish: Query the existence and the number of partitions.
Wish: User variables. I'd like to use e.g. V{name}="foo", V{name}="foo"
and NAME="%v{name}"
Wish: Remove empty directories on unlinking device nodes
Bug?: SYSFS{removable}="1" is found for /block/sdd, but not for
/block/sdd/sdd1. Is that intentional?
Bug: udev stops to honor rules containing NAME="foo" after it has found
the first one. This behaviour is undocumentated.
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.
Bug: Dependencies on logging.h are missing in the Makefile.
Misfeature: Fancy make output on non-ttys, will mess up IDEs like jstar
and emacs.
--
Top 100 things you don't want the sysadmin to say:
31. I hate it when that happens.
-------------------------------------------------------
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
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: Wishlist + bugs for udev-058
2005-05-31 18:54 Wishlist + bugs for udev-058 Bodo Eggert
@ 2005-05-31 22:10 ` Kay Sievers
2005-06-01 1:00 ` Patrick Mansfield
1 sibling, 0 replies; 3+ messages in thread
From: Kay Sievers @ 2005-05-31 22:10 UTC (permalink / raw)
To: linux-hotplug
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
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: Wishlist + bugs for udev-058
2005-05-31 18:54 Wishlist + bugs for udev-058 Bodo Eggert
2005-05-31 22:10 ` Kay Sievers
@ 2005-06-01 1:00 ` Patrick Mansfield
1 sibling, 0 replies; 3+ messages in thread
From: Patrick Mansfield @ 2005-06-01 1:00 UTC (permalink / raw)
To: linux-hotplug
On Wed, Jun 01, 2005 at 12:10:37AM +0200, Kay Sievers wrote:
> On Tue, May 31, 2005 at 08:54:44PM +0200, Bodo Eggert wrote:
> >
> > Wish: Make sg devices be a child of their corresponding devices
>
> That's a kernel thing. Try to convince the scsi-guys. :)
I assume he means put sg under sd, that can't be done as sg is at the same
level as sd, and can even show up if sd is not loaded (and shows up for
all scsi devices, not just block ones ...).
If all your scsi devices are block devices, you likely can run without
loading sg, and just send SG_IO ioctl's to the block device.
sg does show up under the sys device tree, as the "generic" link:
[elm3b79 0:0:0:0]$ ls -l /sys/devices/pci0000:00/0000:00:0a.0/host0/target0:0:0/0:0:0:0/generic
lrwxrwxrwx 1 root root 0 May 31 17:54 /sys/devices/pci0000:00/0000:00:0a.0/host0/target0:0:0/0:0:0:0/generic -> ../../../../../../class/scsi_generic/sg0
-- Patrick Mansfield
-------------------------------------------------------
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-06-01 1:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-31 18:54 Wishlist + bugs for udev-058 Bodo Eggert
2005-05-31 22:10 ` Kay Sievers
2005-06-01 1:00 ` Patrick Mansfield
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).