[Pm-utils] [PATCH 3/5] Moved video-specific option processing to 99video.

Victor Lowther victor.lowther at gmail.com
Thu Mar 6 16:45:58 PST 2008


On Thu, Mar 06, 2008 at 05:10:46PM +0100, Michael Biebl wrote:
> One downside of this might be, that other hooks/sleep_modules are
> interested in the quirk information. So they'd have to reparse the
> command line arguments.
> 
> Actually, I was intending to just do that:
> Do the video quirk processing in uswsup. Imo it makes no sense to use
> vbetools when s2ram is already installed. So my plan was to add a
> [ $SLEEP_METHOD = "uswsusp" ] && return
> to 99video and simply pass the correct command line arguments to s2ram.

Hmmm... don't like that idea.  IMAO, the hooks should not be aware of
what sleep method (kernel, tuxonice, uswsusp, whatever) is in use.  How
about this instead:

A new function disablehook().  This function, when called, will instruct
run_hooks to skip running the hook with the same name as the first
parameter.

A before_hooks() function in the suspend module files.  This function
(if it exists) will be called just before run_hooks starts processing
files.

We can then modify uswsusp to call 'disablehook 99video' in its
before_hooks function.  Whenever the system is using uswsusp, it will
not invoke 99video.

If you make uswsusp depend on pm-utils and migrate the uswsusp sleep
method file over to the uswsusp package, you can make the Right Thing
happen by default without having to patch pm-utils at all.
 
> But probably it's not a big deal, if I have to parse the --quirk-*
> command line arguments in module.d/uswsusp. So I'd say this change is
> ok.
> 
> -- 
> Why is it that all of the instruments seeking intelligent life in the
> universe are pointed away from Earth?

-- 
Victor Lowther
Ubuntu Certified Professional


More information about the Pm-utils mailing list