diff options
authorVictor Lowther <>2008-11-28 16:15:15 -0600
committerVictor Lowther <>2008-11-30 18:21:02 -0600
commit493224b1beeac0154807bcb1ac8a3007a46c435b (patch)
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.
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 -- 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].
+ </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>
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.
+# If you need to synchronize the system clock across a suspend/resume or
+# hibernate/thaw cycle, set this variable.
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 ;;