summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 ;;