* Re: how to notify blindly created 'all_partitions' to dbus, HAL,
2004-04-11 12:11 how to notify blindly created 'all_partitions' to dbus, HAL, gvm Kay Sievers
@ 2004-04-11 13:57 ` David Zeuthen
2004-04-11 14:42 ` how to notify blindly created 'all_partitions' to dbus, HAL, gvm Kay Sievers
1 sibling, 0 replies; 3+ messages in thread
From: David Zeuthen @ 2004-04-11 13:57 UTC (permalink / raw)
To: linux-hotplug
On Sun, 2004-04-11 at 14:11, Kay Sievers wrote:
> We have a feature in udev to create all 15 partitions for a removable
> media device without looking at it. It's needed cause most of the devices
> never notify about a media change and with a fully dynamic /dev we need
> to access one partition to force the kernel to revalidate the device.
> This all couldn't be avoided without polling :(
>
> Now as we create nodes, should we execute the /etc/dev.d/ programs for
> the "blind" partition nodes? What are the implications for HAL, gvm?
>
> And should we fake the DEVPATH for it, huhh...?
>
FWIW, I don't think it's necessary to execute the /etc/dev.d/ programs
for this. Since HAL actually poll the top-level block devices, e.g.
/dev/sda, it means that when media is inserted, the kernel invokes
hotplug for the appropriate block device, e.g. /dev/sda1 and then
everything is business as usual. Same story for when the media is
removed because HAL keeps on polling even though there is media
inserted.
This works pretty well with my 6in1 card reader and inserting/removing a
CF card, in fact it feels pretty sleek to see the icon appear on the
desktop. Wrt. gnome-volume-manager, this is just a simple policy engine
that listens for events from HAL, mounts volumes as appropriate and
optionally stars some programs if it detects pictures on the device
(yeah, layers upon layers :-)
On the other hand it doesn't hurt a lot to exec the programs, HAL will
just ignore it since the DEVPATH is invalid, but note that for my 6in1
reader (with 4 LUN's) this means 60 extra invocations! As far as I
recall the only reason for creating all the 15 devices is compatibility
and convenience, right?
Cheers,
David
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id\x1470&alloc_id638&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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: how to notify blindly created 'all_partitions' to dbus, HAL, gvm
2004-04-11 12:11 how to notify blindly created 'all_partitions' to dbus, HAL, gvm Kay Sievers
2004-04-11 13:57 ` how to notify blindly created 'all_partitions' to dbus, HAL, David Zeuthen
@ 2004-04-11 14:42 ` Kay Sievers
1 sibling, 0 replies; 3+ messages in thread
From: Kay Sievers @ 2004-04-11 14:42 UTC (permalink / raw)
To: linux-hotplug
On Sun, Apr 11, 2004 at 03:57:33PM +0200, David Zeuthen wrote:
> On Sun, 2004-04-11 at 14:11, Kay Sievers wrote:
> > We have a feature in udev to create all 15 partitions for a removable
> > media device without looking at it. It's needed cause most of the devices
> > never notify about a media change and with a fully dynamic /dev we need
> > to access one partition to force the kernel to revalidate the device.
> > This all couldn't be avoided without polling :(
> >
> > Now as we create nodes, should we execute the /etc/dev.d/ programs for
> > the "blind" partition nodes? What are the implications for HAL, gvm?
> >
> > And should we fake the DEVPATH for it, huhh...?
> >
>
> FWIW, I don't think it's necessary to execute the /etc/dev.d/ programs
> for this. Since HAL actually poll the top-level block devices, e.g.
> /dev/sda, it means that when media is inserted, the kernel invokes
> hotplug for the appropriate block device, e.g. /dev/sda1 and then
> everything is business as usual. Same story for when the media is
> removed because HAL keeps on polling even though there is media
> inserted.
Cool, problem is gone. I like it.
> This works pretty well with my 6in1 card reader and inserting/removing a
> CF card, in fact it feels pretty sleek to see the icon appear on the
> desktop. Wrt. gnome-volume-manager, this is just a simple policy engine
> that listens for events from HAL, mounts volumes as appropriate and
> optionally stars some programs if it detects pictures on the device
> (yeah, layers upon layers :-)
>
> On the other hand it doesn't hurt a lot to exec the programs, HAL will
> just ignore it since the DEVPATH is invalid, but note that for my 6in1
> reader (with 4 LUN's) this means 60 extra invocations! As far as I
> recall the only reason for creating all the 15 devices is compatibility
> and convenience, right?
Yes right. After a discussion on lkml, Linus asked for it.
I just stumbled upon, cause I have a similar device and the following udev rule:
BUS="scsi", KERNEL="sd*", SYSFS{model}="USB Storage-CFC", NAME{all_partitions}="compactflash"
The first partition is called compactflash1 and it's in /etc/fstab, but
gvm wasn't recognizing my "photos" ...
A simple explicit rule for the partition and this name in fstab fixes this,
but anyway, seems with HAL, I will never need 'all_partitions' again. :)
thanks,
Kay
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id\x1470&alloc_id638&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
^ permalink raw reply [flat|nested] 3+ messages in thread