"doing" things to HAL devices
Richard Hughes
richard at hughsie.com
Tue Mar 15 16:41:32 PST 2005
On Tue, 2005-03-15 at 11:06 -0500, David Zeuthen wrote:
> Right, the idea here is that each hal device object will be able to
> implement one or more D-BUS interfaces. Right now, only the interface
> org.freedesktop.Hal.Device is implemented. This interface gives you all
> the property methods as well as the generic Rescan()/Reprobe() methods.
Sure.
> I expect to have a strlist property info.interfaces that says what
> interfaces are supported. I also expect, once D-BUS settles, to export
> this through the org.freedesktop.DBus.Introspection stuff.
> So, this will mean that e.g. the object /org/freedesktop/Hal/computer
> will export the o.fd.Hal.Device and o.fd.Hal.Device.PowerManagement
> interfaces. The latter interface is defined by having the following
> methods:
>
> - bool Suspend() throws o.fd.Hal.NotSupported, .NotPrivileged
> - bool Hibernate() throws o.fd.Hal.NotSupported, .NotPrivileged
> - bool Shutdown() throws o.fd.Hal.NotSupported, .NotPrivileged
>
> and I guess we've would have think very carefully about designing this
> interface correctly (we may need isSuspendSupported(), see below).
Sounds like technically it's no problem :-)
> Now, implementation-wise, I don't think hald should be in the business
> of trying to actually doing these things, it should call out to other
> (distro-specific) programs to do this. So, e.g. for Fedora I would merge
> the properties
>
> info.interface.PowerManagement.Suspend = '/usr/sbin/hal-suspend.sh'
> ...
Okay... shell scripts seem a bit hackish to me...
> Note that distros would also need to specify the security policy here
> with D-BUS; again, on Fedora I would probably use at_console and perhaps
> requiring the caller (gnome-power-manager for instance) to run in a
> specific SELinux security context. Other distros may do different
> things.
My personal opinion is that for 99.9% of people, locking down the "who
can suspend" won't be an option. And the sort of people that will would
know how to edit a config file to change ALLOWSUSPEND=NO :-)
> This is also to be used for e.g. the LUKS stuff that Mike is working on;
> we'd just have
>
> info.interface.Volume.Crypto.Setup = '/usr/sbin/hal-cryptsetup'
>
> and this may not even be distro-specific.
The LUKS stuff does look "well cool".
> The point here really is that the desktop bits can use a single
> well-defined interface. All this just needs some coding, I'd hope to get
> to this soon :-)
Cool, if you need a willing tester/debugger :-)
Richard
_______________________________________________
hal mailing list
hal at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal
More information about the Hal
mailing list