diff options
author | Holger Macht <hmacht@suse.de> | 2007-10-29 15:44:06 -0400 |
---|---|---|
committer | David Zeuthen <davidz@redhat.com> | 2007-10-29 15:44:06 -0400 |
commit | eb6d5b9c24e4eb42a8e9993a3936cf95aafacf12 (patch) | |
tree | 13fac823a4fdfcb7b72cfacc232f20895c6445c7 /fdi | |
parent | 1491787fdf29fd77e4cbd13af70434ee3e7032ee (diff) |
add support for Wake On LAN
On Tue 28. Aug - 14:21:42, David Zeuthen wrote:
>
> On Tue, 2007-08-14 at 15:22 +0200, Holger Macht wrote:
> > +wol_supported() {
> > + UDI=$1
> > +
> > + IFACE=`hal-get-property --udi $UDI --key net.interface`
> > + if [ -z "$IFACE" ]; then
> > + echo "org.freedesktop.Hal.Device.WakeOnLAN.NotSupported"
> > + return 1
> > + fi
>
> Actually I think IFACE is the same as HAL_PROP_NET_INTERFACE; saves a
> fork + some IPC. Ditto for getting other properties too.
>
> Btw, there should probably exist tools/hal-system-wol-* that looks sorta
> like this (this is snipped from another script in tools/) to check
> whether the caller is actually privileged to do this
>
> #!/bin/sh
> . hal-functions
>
> hal_check_priv org.freedesktop.hal.wol.<the-action>
> hal_exec_backend
>
> and you should define these PolicyKit actions in policy/hal-wol.policy
Added PolicyKit support and included suggestions from Dan Nicholson.
This time, everything is included in one single patch.
Diffstat (limited to 'fdi')
-rw-r--r-- | fdi/policy/10osvendor/30-wol.fdi | 28 | ||||
-rw-r--r-- | fdi/policy/10osvendor/Makefile.am | 3 |
2 files changed, 30 insertions, 1 deletions
diff --git a/fdi/policy/10osvendor/30-wol.fdi b/fdi/policy/10osvendor/30-wol.fdi new file mode 100644 index 00000000..a6689687 --- /dev/null +++ b/fdi/policy/10osvendor/30-wol.fdi @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<deviceinfo version="0.2"> + + <device> + <match key="info.capabilities" contains="net.80203"> + <append key="info.capabilities" type="strlist">wake_on_lan</append> + <append key="info.interfaces" type="strlist">org.freedesktop.Hal.Device.WakeOnLan</append> + + <append key="org.freedesktop.Hal.Device.WakeOnLan.method_names" type="strlist">GetSupported</append> + <append key="org.freedesktop.Hal.Device.WakeOnLan.method_signatures" type="strlist"></append> + <append key="org.freedesktop.Hal.Device.WakeOnLan.method_argnames" type="strlist"></append> + <append key="org.freedesktop.Hal.Device.WakeOnLan.method_execpaths" type="strlist">hal-system-wol-supported</append> + + <append key="org.freedesktop.Hal.Device.WakeOnLan.method_names" type="strlist">GetEnabled</append> + <append key="org.freedesktop.Hal.Device.WakeOnLan.method_signatures" type="strlist"></append> + <append key="org.freedesktop.Hal.Device.WakeOnLan.method_argnames" type="strlist"></append> + <append key="org.freedesktop.Hal.Device.WakeOnLan.method_execpaths" type="strlist">hal-system-wol-enabled</append> + + <append key="org.freedesktop.Hal.Device.WakeOnLan.method_names" type="strlist">SetEnabled</append> + <append key="org.freedesktop.Hal.Device.WakeOnLan.method_signatures" type="strlist">b</append> + <append key="org.freedesktop.Hal.Device.WakeOnLan.method_argnames" type="strlist">enable</append> + <append key="org.freedesktop.Hal.Device.WakeOnLan.method_execpaths" type="strlist">hal-system-wol-enable</append> + + </match> + + </device> +</deviceinfo> diff --git a/fdi/policy/10osvendor/Makefile.am b/fdi/policy/10osvendor/Makefile.am index 91b935e0..5c053477 100644 --- a/fdi/policy/10osvendor/Makefile.am +++ b/fdi/policy/10osvendor/Makefile.am @@ -8,7 +8,8 @@ dist_fdi_DATA = \ 10-rfkill-switch.fdi \ 10-laptop-panel-mgmt-policy.fdi \ 15-storage-luks.fdi \ - 20-storage-methods.fdi + 20-storage-methods.fdi \ + 30-wol.fdi if BUILD_KEYMAPS dist_fdi_DATA += 10-keymap.fdi |