FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu Kernel Team

 
 
LinkBack Thread Tools
 
Old 01-19-2009, 01:46 PM
Andy Whitcroft
 
Default UBUNTU: suspend-resume -- update test-susped to version 3

It turns out that pms has been deprecated in Jaunty, and only appears on
systems which have been upgraded, so switch to directly sending the
suspend dbus trigger in the same manner as sent by fast-user-switcher.

Also take more care when updating the real time clock. Using
--isadirect prevents it from working on some hardware and also may lead
to corrupt or stalled clocks.

Fix a minor typo in unused code.

Changelog:

- fix typo in fallback acpi interface
- when recording the RTC clock do not go direct
- pmi is now deprecated suspend using dbus

Signed-off-by: Andy Whitcroft <apw@canonical.com>
---
scripts/test-suspend | 22 ++++++++++++++++++----
1 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/scripts/test-suspend b/scripts/test-suspend
index 7e138c0..e897002 100755
--- a/scripts/test-suspend
+++ b/scripts/test-suspend
@@ -28,6 +28,11 @@
#
# Changelog:
#
+# V3:
+# - fix typo in fallback acpi interface
+# - when recording the RTC clock do not go direct
+# - pmi is now deprecated suspend using dbus
+#
# V2:
# - support newer rtc sysfs wakealarm interface
# - move to using pmi action suspend
@@ -72,7 +77,7 @@ setup_wakeup_timer ()
echo "$time" >"$ctl"
return 0
fi
- ctl='/proc/acpu/alarm'
+ ctl='/proc/acpi/alarm'
if [ -f "$ctl" ]; then
echo `date '+%F %H:%M:%S' -d '+ '$timeout' seconds'` >"$ctl"
return 0
@@ -85,12 +90,21 @@ setup_wakeup_timer ()
suspend_system ()
{

- hwclock --directisa --localtime --systohc
-
+ # Ensure the clock is safely recorded.
+ hwclock --systohc

setup_wakeup_timer "$timer_sleep"

- pmi action suspend >/dev/null
+ # Send a dbus message to initiate Suspend.
+ dbus-send --session --type=method_call
+ --dest=org.freedesktop.PowerManagement
+ /org/freedesktop/PowerManagement
+ org.freedesktop.PowerManagement.Suspend ||
+ {
+ ECHO "unable to suspend the system"
+ exit 1
+ }
+

#
# wait for $timer_delay seconds after system resume from S3
--
1.6.1.258.g7ff14


--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 

Thread Tools




All times are GMT. The time now is 07:42 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org