linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: linux-hotplug@vger.kernel.org
Subject: Re: [PATCH] udev - create all partitions of blockdevice
Date: Sat, 21 Feb 2004 00:47:00 +0000	[thread overview]
Message-ID: <20040221004700.GA18346@kroah.com> (raw)
In-Reply-To: <20040216033452.GA3523@vrfy.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:

<snip patch>

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_id\x1356&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

  parent reply	other threads:[~2004-02-21  0:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-16  3:34 [PATCH] udev - create all partitions of blockdevice Kay Sievers
2004-02-16 21:59 ` Greg KH
2004-02-17  2:25 ` Patrick Mansfield
2004-02-21  0:47 ` Greg KH [this message]
2004-02-22 23:03 ` Patrick Mansfield
2004-03-07 14:01 ` Olaf Hering
2004-03-07 17:41 ` Olaf Hering

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=20040221004700.GA18346@kroah.com \
    --to=greg@kroah.com \
    --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).