RE: Nautilus unmount volume, also power-off?



On Mon, 2008-02-04 at 13:55 +0100, Jan de Groot wrote:
> > -----Oorspronkelijk bericht-----
> > Van: desktop-devel-list-bounces gnome org [mailto:desktop-devel-list-
> > bounces gnome org] Namens Simos Xenitellis
> > Verzonden: maandag 4 februari 2008 12:58
> > Aan: GNOME Desktop Devel
> > Onderwerp: Nautilus unmount volume, also power-off?
> > 
> > Hi All,
> > 
> > Currently Nautilus offers the option to either unmount or eject (if
> > suitable) a volume, such as an external USB harddisk or flash drive.
> > 
> > There has been discussion in user forums if it is possible to power off
> > those external storage devices as well,
> > http://ubuntuforums.org/showthread.php?mode=hybrid&t=451344
> > http://www.techteam.gr/index.php?showtopic=118719
> > 
> > A way to implement the "unmount+poweroff" in Nautilus is to create a
> > Nautilus action that calls "umount", then "sdparm --command=stop", and
> > there is such a script circulating the forums.
> > 
> > ...
> > 
> > I am wondering if there are any gotchas to this approach.
> 
> Nice proposal, though I think this shouldn't be done by nautilus, but should
> be exported by hal as command so any program can call the specific command
> without adding extra code. Hal knows what volumes on a device are mounted
> and which are not. And hal is the place where we should put these
> platform-specific things (I can imagine that sdparm won't work on FreeBSD or
> Solaris for example).

The way I see it implemented at the moment, I think that it would
require changes in 
http://svn.gnome.org/viewvc/glib/trunk/gio/gunixmount.c?view=annotate
(see around line 350).
That's by following how "umount" and "eject" are implemented.
I think the code uses already HAL to figure out which devices are
mounted.

The changes in Nautilus should be just to figure out which "unmount" to
call, either plain umount or umount+poweroff.

Apparently, both sg3_utils and sdparm have been ported to Solaris,
FreeBSD, etc,
http://kerneltrap.org/Linux/SCSI_Utility_sdparm_1.02
http://sg.torque.net/sg/sg3_utils.html
What I do not know is if they are part of the standard installation.

Simos




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