summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Lowther <victor.lowther@gmail.com>2008-11-28 16:15:15 -0600
committerVictor Lowther <victor.lowther@gmail.com>2008-11-30 18:21:02 -0600
commit493224b1beeac0154807bcb1ac8a3007a46c435b (patch)
treef62b71e81c96e60278a92e46fb4a682ac324ab80
parent6eb53f4de576e9a569d9019f3398c23438c2cfa5 (diff)
90clock takes over a second to run on suspend.
Most systems do not need it. Add NEED_CLOCK_SYNC, and only run hwclock if it is set. This will probably go away entirely in a later release.
-rw-r--r--README.debugging6
-rw-r--r--man/pm-action.xml13
-rw-r--r--pm/defaults3
-rwxr-xr-xpm/sleep.d/90clock2
4 files changed, 24 insertions, 0 deletions
diff --git a/README.debugging b/README.debugging
index 76be415..47c756a 100644
--- a/README.debugging
+++ b/README.debugging
@@ -21,6 +21,12 @@ End-user customization and debugging:
environment variable to have that module removed when the system
suspends and reloaded when the system wakes up.
+* If your clock drifts across a sleep/wake cycle, you can use
+ NEED_CLOCK_SYNC="true" to force pm-utils to synchronize clocks.
+ This is a change in the default behaviour of pm-utils -- 1.2.2.1 and earlier
+ always synchronized clocks, but doing so is slow and most hardware stays in
+ sync without assistance.
+
* To find out what parameters can be passed to pm-suspend and friends, run them
with '--help' as the first parameter as root. This will print out the
options that it supports and which hooks or modules handle those options.
diff --git a/man/pm-action.xml b/man/pm-action.xml
index 964676f..a6e064c 100644
--- a/man/pm-action.xml
+++ b/man/pm-action.xml
@@ -486,7 +486,20 @@
will be surrounded by [square brackets].
</para>
</listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><envar>NEED_CLOCK_SYNC</envar></term>
+ <listitem>
+ <para>
+ If your system clock drifts across a suspend/resume or
+ hiberante/thaw cycle, you should set this to true.
+ This will cause pm-utils to synchronize the system clock
+ whenever we go through a sleep/wake cycle at the expense of
+ making suspend/resume take longer.
+ </para>
+ </listitem>
</varlistentry>
+
</variablelist>
</refsect1>
diff --git a/pm/defaults b/pm/defaults
index c0063c5..db4d59a 100644
--- a/pm/defaults
+++ b/pm/defaults
@@ -47,3 +47,6 @@
# If you want to ignore commandline parameters, add them here.
# DROP_PARAMETERS=""
+# If you need to synchronize the system clock across a suspend/resume or
+# hibernate/thaw cycle, set this variable.
+# NEED_CLOCK_SYNC="true"
diff --git a/pm/sleep.d/90clock b/pm/sleep.d/90clock
index d824778..5df6e8e 100755
--- a/pm/sleep.d/90clock
+++ b/pm/sleep.d/90clock
@@ -15,6 +15,8 @@ resume_clock()
/sbin/hwclock --hctosys >/dev/null 2>&1 0<&1
}
+[ "$NEED_CLOCK_SYNC" ] || exit $NA
+
case "$1" in
hibernate|suspend) suspend_clock ;;
thaw|resume) resume_clock ;;