From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kay Sievers Date: Sat, 29 Jan 2005 19:53:15 +0000 Subject: Re: Problem in udev with %e device numbering Message-Id: <1107028395.15849.21.camel@localhost.localdomain> List-Id: References: <200501291853.30595.gutmann@uni-duesseldorf.de> In-Reply-To: <200501291853.30595.gutmann@uni-duesseldorf.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On Sat, 2005-01-29 at 18:53 +0100, Michael Gutmann wrote: > device numbering with %e breaks with NAME{all_partitions} when using > usb-devices that attach more than one virtual scsi-disk. I've got a > multi-card-reader that announces itself as four scsi-drives, even if > no card is plugged in. Partitions certainly can be found only when a > card is put into the card reader. Unfortunately they are only found if > something tries to use the card, f.e. fdisk. If you don't use anything that polls the device for a media change, which is what all major desktop installation do today, you don't get these nodes, yes. > So I have to use NAME(all_partitions}. No problem so far, but I want to > use symbolic names instead of sd?. But if I use SYMLINK="cardreader%e" > f.e. there are only links to sd[abcd] and not to the partitions. > The only way I see is using NAME{all_partitions}="card%e". There is no sane way to use the %e key in cases you get concurrent events asking for enumeration of the same name. It's a too simple hack and there is no way with the current udev model to get this fixed inside of udev. The only sane solution, I can imagine would be an external program, that does the enumeration and returns the value to udev. This external program would need to maintain its own database in a dotfile in /dev and must use a file lock to serialize concurrent processes asking for the value. This topic was already discussed on this list, you may look at the archives... Kay ------------------------------------------------------- This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl _______________________________________________ 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