From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg KH Date: Sat, 21 Feb 2004 00:47:00 +0000 Subject: Re: [PATCH] udev - create all partitions of blockdevice Message-Id: <20040221004700.GA18346@kroah.com> List-Id: References: <20040216033452.GA3523@vrfy.org> In-Reply-To: <20040216033452.GA3523@vrfy.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On Mon, Feb 16, 2004 at 06:25:35PM -0800, Patrick Mansfield wrote: > On Mon, Feb 16, 2004 at 01:59:27PM -0800, Greg KH wrote: > > On Mon, Feb 16, 2004 at 04:34:52AM +0100, Kay Sievers wrote: > > > Here is the first try to create all partitons of a blockdevice, since > > > removable media devices may need to acces the expected partition to > > > revalidate the media. > > > > > > It uses the attribute syntax introduced with the last %s{file} patch. > > > I'm using this with my multi-slot-flash-card-reader: > > > > > > SYSFS{model}="USB Storage-SMC ", NAME{all_partitions}="smartmedia" > > > SYSFS{model}="USB Storage-CFC ", NAME{all_partitions}="compactflash" > > > SYSFS{model}="USB Storage-MSC ", NAME{all_partitions}="memorystick" > > > SYSFS{model}="USB Storage-MMC ", NAME{all_partitions}="multimedia" > > > > If needed, we can make the number of partions to create > > > adjustable with the attribute? > > > > Nice, this is great. I don't think we need to change the number of > > partitions. > > > > I've applied this, and checked in a fix for udev-add.c if 'fake' was > > true (which it is for udevtest). I'll go test this for my devices with > > partitions. > > Should we export the scsi 'removable' flag via sysfs attribute for > use with all_partitions? Kernel patch is a trivial: Yes, this is a good idea. Then we can just trigger off of this, right? Will this flag always be correct, even for the very cheap flash readers on the market? > So you could have rules such as: > > KERNEL="sd*", BUS="scsi", SYSFS{removable}="1", NAME{all_partitions}="%k" > KERNEL="sd*", BUS="scsi", SYSFS{removable}="0", NAME="%k" > > AFAIUI CD-ROM never wants all_partitions even though they are marked > removable. Tape is also removable. So, the KERNEL="sd*". Yeah, that would make sense. > Though it won't help for non-scsi (implies non-usb mass storage) media. Do you know of any? Old zip drives use scsi, right? What about floppy drives? > A global rule affecting all partitions or naming would be nice, so you > would not have to have a separate rule, but then like Kay's example rules > above, if you are specifically naming a device, you already know it is > removable, and can set all_partitions. > > For example, you only need the first rule below, but if in some simliar > case, you required two rules, that is ugly: > > SYSFS{model}="USB Storage-SMC ", SYSFS{removable}="1", NAME{all_partitions}="smartmedia" > SYSFS{model}="USB Storage-SMC ", SYSFS{removable}="0", NAME="smartmedia" Yeah, it's cumbersome, I agree. Any one have any other ideas on how to do this? thanks, greg k-h ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id56&alloc_id438&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