summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Lowther <victor.lowther@gmail.com>2008-07-01 21:09:09 -0500
committerVictor Lowther <victor.lowther@gmail.com>2008-07-01 21:09:09 -0500
commitc7e053a05844af2789bb7fab3bf81b0c6d1abcb6 (patch)
tree7d335a21976646b74fe9f1d6045669e15f7be2cc
parentd3223855cbb91c01776aca2d4196b79f73afd7ae (diff)
Add support for massing $METHOD as the second parameter to hooks
This makes it easier for hooks that care about suspend_hybrid to handle it correctly without having to force all the other hooks to care about it. Also updated 01grub to conform to the new plan.
-rw-r--r--pm/sleep.d/01grub5
-rwxr-xr-xsrc/pm-action.in4
2 files changed, 5 insertions, 4 deletions
diff --git a/pm/sleep.d/01grub b/pm/sleep.d/01grub
index 096ffa7..db1d53b 100644
--- a/pm/sleep.d/01grub
+++ b/pm/sleep.d/01grub
@@ -4,6 +4,7 @@
default_resume_kernel()
{
+ [ "$1" = "suspend" ] && return $NA
case $(uname -m) in
i?86|x86_64|athlon)
;;
@@ -25,8 +26,8 @@ default_resume_kernel()
}
case "$1" in
- hibernate|suspend_hybrid)
- default_resume_kernel
+ hibernate|suspend)
+ default_resume_kernel $2
;;
*) exit $NA
;;
diff --git a/src/pm-action.in b/src/pm-action.in
index 58a20b6..c5b560c 100755
--- a/src/pm-action.in
+++ b/src/pm-action.in
@@ -82,7 +82,7 @@ rm -f "${INHIBIT}"
# run the sleep hooks
log "$(date): Running hooks for $ACTION."
-if run_hooks sleep "$ACTION"; then
+if run_hooks sleep "$ACTION $METHOD"; then
# Sleep only if we know how and if a hook did not inhibit us.
log "$(date): performing $METHOD"
sync
@@ -93,7 +93,7 @@ else
fi
log "$(date): Running hooks for $REVERSE"
# run the sleep hooks in reverse with the wakeup action
-if run_hooks sleep "$REVERSE" reverse; then
+if run_hooks sleep "$REVERSE $METHOD" reverse; then
log "$(date): Finished."
else
exit 1