[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: CD/DVD ROM eject: решение (или грабли?) вместо ivman



В сообщении от 28 февраля 2006 08:33 Victor Wagner написал(a):

> В общем, этот способ чреват разнообразными граблями, и скорее всего
> разработчики ядра на сообщения об этих граблях будут реагировать словами
> "А вы так не делайте".

Выяснилось, однако, что разработчик ivmfn сейчас реализует тот же самый 
способ. Ну, почти тот же самый. Вот цитата из его письма, просьба сказать, 
будут ли здесь те же грабли.

(From: Rohan McGovern <rohan.pm@gmail.com>)

Here is the ideal solution:
 - you press 'eject' on your drive
 - HAL generates an EjectPressed event
 - Ivman notices the EjectPressed event, and calls 'umount' and then
   'eject'

The problem with this is that a lot of CD/DVD drives don't implement 
whatever is necessary for HAL to generate EjectPressed.  The EjectPressed 
event was even removed from HAL for a while because so few drives 
supported it.  I see you e-mailed the HAL mailing list too, so you 
probably know about this.  It is for this reason that Ivman doesn't have 
support for EjectPressed built in (although you could write a rule for it 
in IvmConfigConditions.xml, though I've never tried it).

Here is what currently happens:
 - Ivman unlocks your CD/DVD drive when it starts, to allow ejecting even 
when the CD/DVD is being used
 - you press 'eject' on your drive
 - the filesystem gets yanked out from under Linux
 - HAL notices the CD/DVD is no longer in the drive and generates a 
DeviceRemoved event
 - Ivman receives the DeviceRemoved event, and if Ivman mounted the drive, 
it then calls umount or pumount on the already-removed disc, which seems 
to shut up the kernel complaining about "VFS: busy inodes on changed 
media", and everything is OK.

As you can see, at the moment it is kind of hacky.  Also, Ivman will only 
unlock your CD/DVD drive if you run it as root.

-- 
Yours, Mikhail Ramendik



Reply to: