[Pm-utils] [PATCH 01/12] Add disablehook() function to functions.in.

Victor Lowther victor.lowther at gmail.com
Tue Mar 11 18:07:01 PDT 2008


This code exists to handle using s2ram in uswsusp.  Some people seem to think
it is a cleaner and more elegant to use its video quirk-handling rather than
the stuff we have in 99video.  Oh, well, no accounting for taste. :)

I went ahead and made the mechanism generic since it costs us virtually 
nothing to do so.

This is the first step in allowing hooks to be dynamically disabled while
pm-utils is running.
---
 pm/functions.in |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/pm/functions.in b/pm/functions.in
index a7905ce..421fa65 100644
--- a/pm/functions.in
+++ b/pm/functions.in
@@ -155,6 +155,11 @@ restartservice()
 	[ -O "${STORAGEDIR}/service:$1" ] && service "$1" start
 }
 
+disablehook()
+{
+	echo "${2:-${0$$*/}}" > "${STORAGEDIR}/disable_hook:$1"
+}
+
 savestate()
 {
 	echo "$2" > "${STORAGEDIR}/state:$1"
-- 
1.5.4.3



More information about the Pm-utils mailing list