Skip to contentSkip to conversation

how to notify blindly created 'all_partitions' to dbus, HAL, gvm

DISCUSSION Kay Sievers 2 participants 3 messages Apr 11, 2004

lore
Share & tools
lore
#0 lore raw

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...?

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_id70&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#1 lore raw

Re: how to notify blindly created 'all_partitions' to dbus, HAL,

Quoted 11 lines · Kay Sievers

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_id70&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#2 lore raw
In reply to Kay Sievers
Quoted 13 lines · David Zeuthen
Quoted 11 lines · Kay Sievers

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...?

Quoted 7 lines

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.

Quoted 7 lines

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 :-)

Quoted 5 lines

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_id70&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel