hal: Branch 'origin' - 4 commits
David Zeuthen
david at kemper.freedesktop.org
Thu Dec 14 18:38:54 PST 2006
doc/spec/hal-spec-properties.xml | 10 ++++++++++
fdi/policy/10osvendor/10-power-mgmt-policy.fdi | 3 +++
hald/hald_dbus.c | 5 +++++
tools/freebsd/hal-system-power-set-power-save-freebsd | 3 ++-
tools/hal-system-power-set-power-save | 8 +++++++-
tools/linux/hal-system-power-set-power-save-linux | 3 ++-
tools/linux/hal-system-power-suspend-linux | 3 +++
7 files changed, 32 insertions(+), 3 deletions(-)
New commits:
diff-tree 7602464b92f9617b34ea5606426061fe3077820e (from d17ef57074fa9585456dc62da9aef983df84af60)
Author: David Zeuthen <davidz at redhat.com>
Date: Mon Dec 4 20:50:13 2006 -0500
fix setting power_management.is_powersave_set
Without this fix, the property is not properly initialized.
diff --git a/fdi/policy/10osvendor/10-power-mgmt-policy.fdi b/fdi/policy/10osvendor/10-power-mgmt-policy.fdi
index cd16cee..e0607fd 100644
--- a/fdi/policy/10osvendor/10-power-mgmt-policy.fdi
+++ b/fdi/policy/10osvendor/10-power-mgmt-policy.fdi
@@ -52,7 +52,7 @@
<append key="org.freedesktop.Hal.Device.SystemPowerManagement.method_execpaths" type="strlist">hal-system-power-set-power-save</append>
<!-- Consider that we're not saving power at startup -->
- <append key="power_management.is_powersave_set" type="boolean">false</append>
+ <merge key="power_management.is_powersave_set" type="bool">false</merge>
</match>
</device>
diff-tree d17ef57074fa9585456dc62da9aef983df84af60 (from 1ec650992778070c7724d14fa83a7f95450e9e0d)
Author: Kevin Ottens <ervin at kde.org>
Date: Mon Dec 4 20:46:32 2006 -0500
add property for power save state
Find attached a patch introducing a property to know if we're currently saving
power or not. We used to have only SetPowerSave method, now we can query HAL
to know if it was already set.
diff --git a/doc/spec/hal-spec-properties.xml b/doc/spec/hal-spec-properties.xml
index 4ebe9fd..29c2aeb 100644
--- a/doc/spec/hal-spec-properties.xml
+++ b/doc/spec/hal-spec-properties.xml
@@ -5761,6 +5761,16 @@
should be used in its place. This key will be removed, but not before May 1st 2007.
</entry>
</row>
+ <row>
+ <entry>
+ <literal>power_management.is_powersave_set</literal> (bool)
+ </entry>
+ <entry/>
+ <entry>Yes</entry>
+ <entry>
+ Is the last value passed to the SetPowerSave method.
+ </entry>
+ </row>
</tbody>
</tgroup>
</informaltable>
diff --git a/fdi/policy/10osvendor/10-power-mgmt-policy.fdi b/fdi/policy/10osvendor/10-power-mgmt-policy.fdi
index 2c2705a..cd16cee 100644
--- a/fdi/policy/10osvendor/10-power-mgmt-policy.fdi
+++ b/fdi/policy/10osvendor/10-power-mgmt-policy.fdi
@@ -50,6 +50,9 @@
<append key="org.freedesktop.Hal.Device.SystemPowerManagement.method_signatures" type="strlist">b</append>
<append key="org.freedesktop.Hal.Device.SystemPowerManagement.method_argnames" type="strlist">enable_power_save</append>
<append key="org.freedesktop.Hal.Device.SystemPowerManagement.method_execpaths" type="strlist">hal-system-power-set-power-save</append>
+
+ <!-- Consider that we're not saving power at startup -->
+ <append key="power_management.is_powersave_set" type="boolean">false</append>
</match>
</device>
diff --git a/tools/freebsd/hal-system-power-set-power-save-freebsd b/tools/freebsd/hal-system-power-set-power-save-freebsd
index afcc312..6258f02 100755
--- a/tools/freebsd/hal-system-power-set-power-save-freebsd
+++ b/tools/freebsd/hal-system-power-set-power-save-freebsd
@@ -1,5 +1,6 @@
#!/bin/sh
-read value
+
+value=$1
unsupported() {
echo org.freedesktop.Hal.Device.SystemPowerManagement.NotSupported >&2
diff --git a/tools/hal-system-power-set-power-save b/tools/hal-system-power-set-power-save
index 298f7aa..c933d77 100755
--- a/tools/hal-system-power-set-power-save
+++ b/tools/hal-system-power-set-power-save
@@ -1,7 +1,13 @@
#!/bin/sh
+read value
+
if [ -n "$HALD_UNAME_S" -a -x ./$HALD_UNAME_S/hal-system-power-set-power-save-$HALD_UNAME_S ]; then
- exec ./$HALD_UNAME_S/hal-system-power-set-power-save-$HALD_UNAME_S $@
+ ./$HALD_UNAME_S/hal-system-power-set-power-save-$HALD_UNAME_S $value
+ if [ "x$?" == "x0" ]; then
+ hal-set-property --udi $HAL_PROP_INFO_UDI \
+ --key "power_management.is_powersave_set" --bool "$value"
+ fi
else
echo "org.freedesktop.Hal.Device.UnknownError" >&2
echo "No back-end for your operating system" >&2
diff --git a/tools/linux/hal-system-power-set-power-save-linux b/tools/linux/hal-system-power-set-power-save-linux
index 303eaf2..6a29344 100755
--- a/tools/linux/hal-system-power-set-power-save-linux
+++ b/tools/linux/hal-system-power-set-power-save-linux
@@ -1,5 +1,6 @@
#!/bin/sh
-read value
+
+value=$1
unsupported() {
echo org.freedesktop.Hal.Device.SystemPowerManagement.NotSupported >&2
diff-tree 1ec650992778070c7724d14fa83a7f95450e9e0d (from 48e9e8ad6001521ff171451ddac3c47fa2499d1e)
Author: Sergey Lapin <slapinid at gmail.com>
Date: Mon Dec 4 13:46:51 2006 -0500
fix for crash in hald_dbus.c
hald crashed on ARM within glib.
diff --git a/hald/hald_dbus.c b/hald/hald_dbus.c
index 7434230..0608660 100644
--- a/hald/hald_dbus.c
+++ b/hald/hald_dbus.c
@@ -2898,6 +2898,10 @@ device_is_executing_method (HalDevice *d
ret = FALSE;
+ if (udi_to_method_queue == NULL) {
+ goto out;
+ }
+
if (g_hash_table_lookup_extended (udi_to_method_queue, hal_device_get_udi (d), &origkey, (gpointer) &queue)) {
if (queue != NULL) {
@@ -2911,6 +2915,7 @@ device_is_executing_method (HalDevice *d
ret = TRUE;
}
+out:
return ret;
}
diff-tree 48e9e8ad6001521ff171451ddac3c47fa2499d1e (from 8fb1128494b678a51ae683e2c4fbd34d12a81082)
Author: S.ÃaÄlar Onur <caglar at pardus.org.tr>
Date: Mon Dec 4 13:43:10 2006 -0500
add pm-suspend to linux/hal-system-power-suspend-linux
Attached patch add missing pm-suspend into linux/hal-system-power-suspend
before raw kernel interface like linux/hal-system-power-hibernate-linux.
diff --git a/tools/linux/hal-system-power-suspend-linux b/tools/linux/hal-system-power-suspend-linux
index 59cde73..590e1c7 100755
--- a/tools/linux/hal-system-power-suspend-linux
+++ b/tools/linux/hal-system-power-suspend-linux
@@ -86,6 +86,9 @@ else
elif [ -x "/usr/sbin/pmi" ] ; then
/usr/sbin/pmi action suspend force
RET=$?
+ elif [ -x "/usr/sbin/pm-suspend" ] ; then
+ /usr/sbin/pm-suspend
+ RET=$?
elif [ -w "/sys/power/state" ] ; then
# Use the raw kernel sysfs interface
echo "mem" > /sys/power/state
More information about the hal-commit
mailing list