Unmounting and 'eject' press

David Zeuthen david at fubar.dk
Sun May 30 16:34:17 PDT 2004


Hi,

It turns out this was actually quite easy to do, there was a good
example of how to do it here

http://www.ussg.iu.edu/hypermail/linux/kernel/0202.0/att-0603/01-cd_poll.c

Only caveat is that is requires MMC-2 drives or higher (all drives
shipped within the past 3-4 years are MMC-2 compliant), but anyway it is
now integrated with HAL. 

If eject is pressed, while a disc is mounted HAL will emit an
'EjectPressed' condition on the HalDevice representing the optical disc.
In hal-device-manager it looks like this

 Condition EjectPressed,
  device=/org/freedesktop/Hal/devices/block_22_0-disc
  message =  ['EjectPressed', '/udev/hdc']
 
Since HAL cowardly refuses to touch policy it's up to higher level
components to actually do something about it :-)

Cheers,
David


_______________________________________________
hal mailing list
hal at freedesktop.org
http://freedesktop.org/mailman/listinfo/hal



More information about the Hal mailing list