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

Victor Lowther victor.lowther at gmail.com
Fri Mar 7 18:19:04 PST 2008


On Fri, Mar 07, 2008 at 09:19:33AM +0100, Michael Biebl wrote:
> 2008/3/7, Victor Lowther <victor.lowther at gmail.com>:
> > 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
> 
> nitpick: could we make it disable_hook() please

Mabye. :)
 
> >  run_hooks to skip running the hook with the same name as the first
> >  parameter.
> 
> would be nice if the number could be omitted. So you could only say
> disable_hook(video), which would skip all hooks matching ??video.

My test implementation does not do that, but implementing that feature
should be trivial.

> >  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.
> >
> 
> Sounds like a more flexible (and general) solution. Even if it is a
> bit more complex.

Actually, the implementation is quite simple -- at least when layered on
top of the functions.in/pm-functions.in split.  If you are interested, the
latest version of the code is in the vlowther-dynamic-hook-disable branch @
git://fnordovax.org/pm-utils/

> Cheers,
> Michael
> 
> 
> -- 
> 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