[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Fedora power management



On Sun, 2007-02-18 at 21:30 -0600, Jay Cliburn wrote:
> I'm trying to hack/test a network driver's ability to suspend, resume,
> and wake-on-lan (while suspended).  This is on a rawhide x86_64 desktop
> system.  Is the Fedora pm-stuff documented anywhere?  I can't seem to
> find anything on the wiki, and the only related manpage is for pm-pmu.
> 
> FWIW, suspend didn't seem to work, but hibernate did (aside from a
> bunch of lockdep warnings).  As near as I can tell though, my network
> module is unloaded instead of suspended because I think it gets swept
> up in the modunload() function of /etc/pm/functions.
> 
> It'd help if I could find some documentation on Fedora power
> management, to try and get an understanding of how it's all supposed
> to work. Any ideas where I can find some docs?

Well, there's a link to quite an old presentation I wrote here
http://people.freedesktop.org/~hughsient/public/gnome-power-manager.pdf
which mentions how pm-utils fits into the stack, although the document
needs updating with the latest PolicyKit and ConsoleKit coolness.

I've also attached the pm-utils README file from CVS which might help.

I agree, this stuff needs better documenting - a wiki page might be
best, or maybe just manpages for the other tools.

Richard.

=== pm-utils ===

What is pm-utils?

* Provides simple shell command line tools to suspend and hibernate computer
that can be used to run vendor or distro supplied scripts on suspend and resume.

Why do we need it?

* As all the main distros are re-implimenting the same thing, over and over, to
do something that's really quite trivial.
Having the common locations for stuff means that software and hardware vendors
can just install one file to do the clever stuff.

* Distros can easily add/remove functionality by installing/removing one
file into the hooks directory, for example:

- enabling and disabling standby LED's on laptop hardware 
- enabling suspend GUI's like suspend2 
- re-enabling video
- starting and stopping services that can't cope with suspending 
- re-syncing the time with ntp 
- removing and modprobing modules when needed 
- setting grub to be the default target for a hibernate-resume 
- other wacky things that need doing on specific systems

How do "hooks" work?

* You put a file in /etc/pm/hooks, which is executable.  When suspend or
  hibernate is called, several things happen:
  
  1) a new virtual terminal is alloced and switched to
  2) /etc/pm/config is evaluated .  This config file that should only be
     modified by end-users.
  3) /etc/pm/config.d/* are evaluated in C sort order.  These files can be
     provided by individual packages outside of pm-utils.  If a global config
     variable is set, the value set to will be appended to the previous value.
     If any other variable is set, it will be ignored.
  4) each of /etc/pm/hooks/* are executed in C sort order.  The first command
     line argument is "suspend" or "hibernate".  These files may source
     configuration files from /etc/pm/config.d/ on their own in order to pick
     up variables set there that aren't part of the global list.  Note that
     hooks should take care to preserve any global configuration variable
     which _that_ hook will later need to use, as sourcing this config file
     will clobber any such variables.
  5) the system suspends or hibernates.
  6) some event happens to wake the machine up
  7) each of /etc/pm/hooks/* are executed in reverse C sort order.  The first
     command line argument is "resume" or "thaw".
  8) the system switches back to the original virtual terminal from step 1.

  That's it!


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]