Re: removable media revalidation - udev vs. devfs or static /dev

From: Martin J. Bligh
Date: Wed Jan 07 2004 - 20:51:47 EST


> The problem is the following:
> - user plugs in their usb flash reader with no media in it
> - the main block device is create, no partitions
> - user plugs a flash stick/whatever into the reader
> - kernel gets no notification of this event
> - userspace gets no notification of this event

You can solve the partitions bit by rescanning when someone opens
the "/dev/hdaX" directory, was my only point. Which was just a little
twist on Linus's thing, only a bit simpler. And no, it doesn't work
unless that dir is a virtual thing that's "magic".

> How can userspace know to open the main block device now? Require that
> we put a big "Rescan media now" button on the desktop? That's one way,
> but users are used to having to not do that.

I don't think you should have to press something explicit for the udev
stuff to be correct. But you should to start an application that does
pretty stuff with pictures, like you mention below.

> If a daemon does the scanning every so often, the media can be

As Linus pointed out ... "every so often" has to be horribly frequent, so
I don't see how that can work. How often are you proposing? once a second?

> automatically mounted, and an application can pop up saying that it
> found some pictures on the new device, do you want to open up your image
> application?

Ick. You mean like the Windows crap than autoruns stuff off your CD?
If you really, really want that, then yes you'd have to poll, but it
would be nice to solve the partitions bit without that, IMHO. I'd
see a lot more demand for the partitions being correctly populated
than magically triggered GUI stuff.

M.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/