diff options
author | Victor Lowther <victor.lowther@gmail.com> | 2008-07-05 12:00:32 -0500 |
---|---|---|
committer | Victor Lowther <victor.lowther@gmail.com> | 2008-07-05 12:00:32 -0500 |
commit | f76baff97225aa45221d553b7541d3e4db953a04 (patch) | |
tree | 51e1d7bc03a0d101aa26edc691755ec0f0d7d26d /pm/sleep.d | |
parent | d3223855cbb91c01776aca2d4196b79f73afd7ae (diff) |
Make some changes to core functionality to support pm-powersave
This consists of core features extracted from the powersave-hooks branch, and
does the following:
* Refactor some settings in pm-functions to make it easier to support seperate
settings for pm-action and pm-powersave. Other than sharing a mechanism for
running hooks and being able to use certian utility functions, they do not
have much in common w.r.t settings and lifecycle rules for those settings.
* Move take_suspend_lock from pm-functions to pm-action. pm-powersave uses a
simpler scheme, and there is not enough code sharing to justify having it in
pm-functions.
* Add a bit of code to pm-functions to figure out what chassis type we are
running on.
* Add a 00powersave hook that turns powersaving off across a suspend/resume.
Things like laptop-mode in particular have been known to cause issues in
some situations.
* Make pm-powersave log to a real logfile and try to guess at the appropriate
powersave mode if called with no arguments.
Diffstat (limited to 'pm/sleep.d')
-rw-r--r-- | pm/sleep.d/00powersave | 13 | ||||
-rw-r--r-- | pm/sleep.d/Makefile.am | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/pm/sleep.d/00powersave b/pm/sleep.d/00powersave new file mode 100644 index 0000000..bf0f98b --- /dev/null +++ b/pm/sleep.d/00powersave @@ -0,0 +1,13 @@ +#!/bin/sh + +. "${PM_FUNCTIONS}" + +command_exists pm-powersave || exit $NA + +case $1 in + suspend|hibernate) pm-powersave false ;; + resume|thaw) pm-powersave ;; + *) exit $NA ;; +esac +exit 0 +
\ No newline at end of file diff --git a/pm/sleep.d/Makefile.am b/pm/sleep.d/Makefile.am index d47b799..a2f31cc 100644 --- a/pm/sleep.d/Makefile.am +++ b/pm/sleep.d/Makefile.am @@ -2,6 +2,7 @@ sleepdir = $(libdir)/pm-utils/sleep.d sleep_SCRIPTS = \ 00logging \ + 00powersave \ 01grub \ 49bluetooth \ 50ntpd \ |