[Pm-utils] [RFC] [patch review] Hook independence and security fixups, part 1

Victor Lowther victor.lowther at gmail.com
Sat Feb 2 15:22:27 PST 2008

On Feb 2, 2008 4:32 PM, Victor Lowther <victor.lowther at gmail.com> wrote:
> Hmmm... how about something along these lines:
> @PM-UTILS-LIBDIR@/methods.d/, which is populated by files named
>   suspend_method-suspend_type (kernel-suspend, kernel-hibernate,
> tuxonice-suspend-hybrid, etc.)
>   These files accept a single argument, which (right now) can be
> either "inhibited" or "", and output either of "resume" or "thaw" on
> stdout, depending on whether the system is resuming from suspend or
> hibernate.
> All the do_suspend_type functions then collapse into a single
> do_sleep() function, which is passed either "hibernate", "suspend", or
> "suspend-hybrid".  The do_sleep method then calls
> @PM-UTILS-LIBDIR@/method.d/${SUSPEND_METHOD}-$1 with the appropriate
> value of inhibit
> That way, there is no patching of case statements needed to add a new
> suspend method -- just drop an appropriatly-named script in the
> method.d directory, and let it handle doing The Right Thing.

Test patch attached.  It may not actually run, and there are a few
niceties to add, but it is a first stab at things.  Should apply
cleanly to current git head, and is also available as
vlowther-pluggable-sleep-methods in my git repo.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pluggable-suspend-methods.patch
Type: text/x-diff
Size: 4604 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/pm-utils/attachments/20080202/abd0d5b3/attachment.patch 

More information about the Pm-utils mailing list