summaryrefslogtreecommitdiff
path: root/pm
diff options
context:
space:
mode:
authorVictor Lowther <victor.lowther@gmail.com>2008-03-19 20:35:54 -0500
committerVictor Lowther <victor.lowther@gmail.com>2008-03-19 20:35:54 -0500
commit174f1430e76dfcf9d45e6d44422a47c2e2bba369 (patch)
tree3c53297e49409e0f072f8371cd731c191e4bd2e6 /pm
parentea374c82c37f881398cfa0eea2c7518286e1ae42 (diff)
parent55e3dbbfe6dc6ffae294cb1976a1a5c6cf9362da (diff)
Merge branch 'vlowther-stabilization-bugfixes' into vlowther-default-parameters
Conflicts: pm/pm-functions.in
Diffstat (limited to 'pm')
-rw-r--r--pm/defaults33
-rw-r--r--pm/pm-functions.in19
-rwxr-xr-xpm/sleep.d/00clear2
-rwxr-xr-xpm/sleep.d/00logging2
-rwxr-xr-xpm/sleep.d/05led2
-rwxr-xr-xpm/sleep.d/10NetworkManager2
-rwxr-xr-xpm/sleep.d/49bluetooth2
-rwxr-xr-xpm/sleep.d/50modules2
-rwxr-xr-xpm/sleep.d/65alsa2
-rwxr-xr-xpm/sleep.d/90clock2
-rwxr-xr-xpm/sleep.d/94cpufreq2
-rwxr-xr-xpm/sleep.d/99video2
12 files changed, 50 insertions, 22 deletions
diff --git a/pm/defaults b/pm/defaults
index d5b6447..5e4def1 100644
--- a/pm/defaults
+++ b/pm/defaults
@@ -1,9 +1,34 @@
-
##########################################################
-# DO NOT EDIT THIS FILE, edit /etc/pm/config.d/ instead! #
+# DO NOT EDIT THIS FILE! #
+# #
+# Add files in /etc/pm/config.d/ instead! #
##########################################################
-HIBERNATE_RESUME_POST_VIDEO="no"
+# Default method to power down the system when hibernating.
+# If commented out, the system will use "shutdown" as a
+# default value.
+#
+# Check /sys/power/disk for valid values.
+# HIBERNATE_MODE="platform"
+
+# Whetner we need to post the video card when resuming from
+# hibernate. You should not normally need to set this.
+# In the future pm-utils will get this setting from HAL.
+#
+# Valid values are "no" and "yes"
+# HIBERNATE_RESUME_POST_VIDEO="no"
+
+# The default sleep/wake system to use. Valid values are:
+# kernel The built-in kernel suspend/resume support.
+# Use this if nothing else is supported on your system.
+# uswsusp If your system has support for the userspace
+# suspend programs (s2ram/s2disk/s2both), then use this.
+# tuxonice If your system has support for tuxonice, use this.
+#
+# The system defaults to "kernel" if this is commented out.
+# SLEEP_MODULE="kernel"
-SUSPEND_MODULES=""
+# If you need to unload any modules to suspend/resume, add them
+# here.
+# SUSPEND_MODULES=""
diff --git a/pm/pm-functions.in b/pm/pm-functions.in
index 7159ec9..f4bf755 100644
--- a/pm/pm-functions.in
+++ b/pm/pm-functions.in
@@ -20,15 +20,11 @@ PM_UTILS_RUNDIR="/var/run/pm-utils"
PM_CMDLINE="$*"
PATH=/sbin:/usr/sbin:/bin:/usr/bin:"${PM_UTILS_LIBDIR}"/bin
-HIBERNATE_MODE="platform"
-HIBERNATE_RESUME_POST_VIDEO=no
INHIBIT="${PM_UTILS_RUNDIR}/inhibit"
PM_LOGFILE="${PM_LOGFILE:=/var/log/pm-suspend.log}"
-SUSPEND_MODULES=""
TEMPORARY_CPUFREQ_GOVERNOR="performance"
LOCKDIR="${PM_UTILS_RUNDIR}/locks"
STORAGEDIR="${PM_UTILS_RUNDIR}/storage"
-SLEEP_MODULE="kernel"
NA=254
NX=253
DX=252
@@ -36,6 +32,14 @@ PM_FUNCTIONS="$PM_UTILS_LIBDIR/functions"
# Use c sort order
LC_COLLATE=C
+# These should be overridden by defaults and/or config.d settings.
+# Specifically, distros should override these by modifying defaults,
+# and end users should modify these using files in /etc/pm/config.
+HIBERNATE_MODE="shutdown"
+HIBERNATE_RESUME_POST_VIDEO="no"
+SLEEP_MODULE="kernel"
+SUSPEND_MODULES=""
+
[ -f "${PM_UTILS_LIBDIR}"/defaults ] && . "${PM_UTILS_LIBDIR}"/defaults
set +a
@@ -49,6 +53,8 @@ done
. "${PM_FUNCTIONS}"
+log() { [ $LOGGING ] && echo $*; }
+
load_hook_blacklist()
{
[ -f "$PM_UTILS_ETCDIR/blacklist" ] || return
@@ -61,6 +67,7 @@ load_hook_blacklist()
# skip blank lines
[ -z "$entry" ] && continue
disablehook "${entry##*/}" "${comment:-blacklist}"
+ log "Blacklisting ${entry##*/}."
done
}
@@ -101,14 +108,10 @@ load_hook_parameters()
done < "$PM_UTILS_ETCDIR/parameters"
}
-log() { [ $LOGGING ] && echo $*; }
-
take_suspend_lock()
{
try_lock "pm-utils.lock" || return 1
mkdir -p "${STORAGEDIR}"
- load_hook_blacklist
- load_hook_parameters
return 0
}
diff --git a/pm/sleep.d/00clear b/pm/sleep.d/00clear
index 217d8db..a5cd02b 100755
--- a/pm/sleep.d/00clear
+++ b/pm/sleep.d/00clear
@@ -3,7 +3,7 @@
. "${PM_FUNCTIONS}"
case "$1" in
- hibernate|suspend*)
+ hibernate|suspend)
fgconsole |savestate console
chvt 63
TERM=linux clear
diff --git a/pm/sleep.d/00logging b/pm/sleep.d/00logging
index fd2a9a8..7990a50 100755
--- a/pm/sleep.d/00logging
+++ b/pm/sleep.d/00logging
@@ -3,7 +3,7 @@
. "${PM_FUNCTIONS}"
case "$1" in
- hibernate|suspend*)
+ hibernate|suspend)
[ -n "$PM_LOGFILE" ] || exit 0
/bin/uname -a
lsmod
diff --git a/pm/sleep.d/05led b/pm/sleep.d/05led
index c7263fd..84bef1b 100755
--- a/pm/sleep.d/05led
+++ b/pm/sleep.d/05led
@@ -3,7 +3,7 @@
[ -f /proc/acpi/ibm/led ] || exit $NA
case "$1" in
- hibernate|suspend*)
+ hibernate|suspend)
echo "7 blink" >/proc/acpi/ibm/led
;;
thaw|resume)
diff --git a/pm/sleep.d/10NetworkManager b/pm/sleep.d/10NetworkManager
index bcb5e5d..8538d6b 100755
--- a/pm/sleep.d/10NetworkManager
+++ b/pm/sleep.d/10NetworkManager
@@ -23,7 +23,7 @@ resume_nm()
}
case "$1" in
- hibernate|suspend*)
+ hibernate|suspend)
suspend_nm
;;
thaw|resume)
diff --git a/pm/sleep.d/49bluetooth b/pm/sleep.d/49bluetooth
index e4977c4..5fcb04c 100755
--- a/pm/sleep.d/49bluetooth
+++ b/pm/sleep.d/49bluetooth
@@ -23,7 +23,7 @@ resume_bluetooth()
}
case "$1" in
- hibernate|suspend*)
+ hibernate|suspend)
suspend_bluetooth
;;
thaw|resume)
diff --git a/pm/sleep.d/50modules b/pm/sleep.d/50modules
index 5d8c5da..338529b 100755
--- a/pm/sleep.d/50modules
+++ b/pm/sleep.d/50modules
@@ -17,7 +17,7 @@ resume_modules()
}
case "$1" in
- hibernate|suspend*)
+ hibernate|suspend)
suspend_modules
;;
thaw|resume)
diff --git a/pm/sleep.d/65alsa b/pm/sleep.d/65alsa
index bfe76be..5fc729e 100755
--- a/pm/sleep.d/65alsa
+++ b/pm/sleep.d/65alsa
@@ -5,7 +5,7 @@
command_exists alsactl || exit $NA
case "$1" in
- hibernate|suspend*)
+ hibernate|suspend)
alsactl store 0 >/dev/null 2>&1
;;
thaw|resume)
diff --git a/pm/sleep.d/90clock b/pm/sleep.d/90clock
index b000457..f69c8c9 100755
--- a/pm/sleep.d/90clock
+++ b/pm/sleep.d/90clock
@@ -25,7 +25,7 @@ resume_clock()
}
case "$1" in
- hibernate|suspend*)
+ hibernate|suspend)
suspend_clock
;;
thaw|resume)
diff --git a/pm/sleep.d/94cpufreq b/pm/sleep.d/94cpufreq
index cfb0c60..d956aa1 100755
--- a/pm/sleep.d/94cpufreq
+++ b/pm/sleep.d/94cpufreq
@@ -33,7 +33,7 @@ thaw_cpufreq()
}
case "$1" in
- suspend*|hibernate)
+ suspend|hibernate)
hibernate_cpufreq
;;
resume|thaw)
diff --git a/pm/sleep.d/99video b/pm/sleep.d/99video
index 6e9bbda..1663dff 100755
--- a/pm/sleep.d/99video
+++ b/pm/sleep.d/99video
@@ -130,7 +130,7 @@ help() {
}
case "$1" in
- suspend*) suspend_video ;;
+ suspend) suspend_video ;;
hibernate)
if [ "$HIBERNATE_RESUME_POST_VIDEO" = "yes" ]; then
suspend_video