From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kay Sievers Date: Wed, 08 Sep 2004 22:40:46 +0000 Subject: Re: can udev SYMLINK{all_partitions} ? Message-Id: <1094683247.3375.12.camel@localhost.localdomain> List-Id: References: <20040908193625.26490.h64.wm@smtp.sc0.cp.net> In-Reply-To: <20040908193625.26490.h64.wm@smtp.sc0.cp.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On Wed, 2004-09-08 at 12:36 -0700, linux-hotplug-devel@digitalride.net wrote: > I've been using the NAME{all_partitions} syntax successfully for a usb card reader, but I also need a symlink created for each partition as > well. For example, I would like both the normal /dev/sda1,/dev/sda2, etc. AND /dev/usb/cf1,/dev/usb/cf2, etc. accessible. The goal is to > use udev to maintain all the normal kernel names while creating symlinks to more intuitive spots that may be automounted for other users who > don't want to mess with /dev/sdX. > Going out on a limb, I tried the syntax SYMLINK{all_partitions} with several variations (which didn't work) including: > BUS="scsi", KERNEL="sd*", SYSFS{model}="*HS-CF*" ,SYSFS{vendor}="*IN-WIN*", NAME{all_partitions}="%k", SYMLINK{all_partitions}="usb/cf" > BUS="scsi", KERNEL="sd*", SYSFS{model}="*HS-CF*" ,SYSFS{vendor}="*IN-WIN*", NAME{all_partitions}="%k", SYMLINK{all_partitions}="usb/cf%n" > > Am I missing an easy way to achieve this, There is currently no way to do this with the built-in features of udev. If you don't care about stale symlinks (ones that don't get removed on device removal) you may create them with a simple CALLOUT shell-script. It's a bit ugly, but it should work. Or just consider using any of the volume daemons that poll your device for media changes. This way you don't need the all_partitions feature at all. I'm using HAL for this, which polls all removable devices and have long forgotten the all_partitions :) > or is someone already working on a SYMLINK{all_partitions} syntax? No, it's not easy to reach this. The symlink feature in udev is a very simple implementation, only one string with all the symlinks separated by spaces is stored in the udevdb. So there is currently no way to store how many all_partitions-symlinks need to be removed on the "remove" event. Thanks, Kay ------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_idP47&alloc_id808&op=click _______________________________________________ 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