summaryrefslogtreecommitdiff
path: root/pm/pm-functions.in
AgeCommit message (Collapse)AuthorFilesLines
2010-06-15Change hook run printing to make it not look ugly.Victor Lowther1-1/+3
Hooks can print things too.
2010-06-05There are no actual users of chassis_type anymore, get rid of it.Victor Lowther1-6/+0
2010-06-05Make sure that we are root before trying to run dmidecode.Victor Lowther1-1/+1
2010-06-05More comments to the power hooks.Victor Lowther1-0/+6
Also added an environment variable that will (hopefully) tell us what type of system we have.
2010-06-05Autodetect sleep modules by default instead of forcing the kernel one.Victor Lowther1-1/+1
2010-05-31Try falling back to standby suspend of mem is not available.Dylan Smith1-0/+3
It saves less power, but is the only option available on some systems. Thanks, Dylan Smith.
2009-12-07Track suspend/hibernate failures and exit accordingly.Victor Lowther1-6/+11
It turns out that echo whatever >/sys/power/state will fail if transitioning to that state fails. If transitioning to the reuested power state fails, pm-action will return an error code greater or equal than 128.
2009-12-05Merge branch 'profiling-support' into native-quirk-dbVictor Lowther1-6/+42
2009-12-05Merge branch 'master' into native-quirk-dbVictor Lowther1-0/+28
2009-12-01Add support for hibernate after suspend.Victor Lowther1-0/+28
Do this by adding a default suspend_hybrid sleep method. With the default settings, we schedule an alarm for 15 minutes from now, suspend, and hibernate if we wake up in 15 minutes.
2009-11-30Merge branch 'master' into native-quirk-dbVictor Lowther1-6/+0
Conflicts: pm/sleep.d/98smart-kernel-video 98smart-kernel-video no longer exists, but we want the other fixups in the master branch.
2009-11-30Some final fixups to make the built-in video quirk database handling work.Victor Lowther1-1/+0
2009-11-30pm-functions.in: Drop $CHASSIS_TYPEMartin Pitt1-6/+0
$CHASSIS_TYPE is not used anywhere in pm-utils itself, nor any third-party pm-utils hook that I can see. It relies on a dmidecode map in hal which has never really been robust, and it just seems generally obsolete nowadays. Let's not proliferate that any further and just remove it entirely. https://bugs.freedesktop.org/show_bug.cgi?id=25274
2009-11-16Extract out the bits that handle translating .fdi files into their ownVictor Lowther1-0/+3
script. Integrating video quirk db handling into pm-utils requires splitting out database querying from database importing anyways.
2009-05-06Update places where we check for booleans to use is_setVictor Lowther1-1/+1
Suprisingly, there are not that many.
2009-02-06Make CHASSIS_TYPE always have Unknown if we cannot determine the chassis type.Victor Lowther1-1/+1
2008-12-15Profile run_hooks as well as each individual hookVictor Lowther1-1/+7
2008-12-15Factor out run_hook to make profiling easierVictor Lowther1-6/+18
2008-12-15Add a profile function wrapper.Victor Lowther1-0/+18
This makes it easier to profile suspend/resume. The profile function should work on any callable item.
2008-12-14hal-get-porperty runs just fine as a normal userVictor Lowther1-1/+1
2008-09-27Merge branch 'auto-backend'Victor Lowther1-6/+69
2008-09-27Use hal-get-property instead of dmidecode to get the chassis type.Victor Lowther1-2/+2
2008-09-17Impliment module autoloading.Victor Lowther1-6/+9
We can now autodetect the proper sleep methods, and the sleep modules are stackable.
2008-09-17Always fall back to kernel methods for suspend and hibernate.Victor Lowther1-0/+24
That way we have a method of resilience in the case of misconfiguration, and future sleep methods do not have to reimplement the kernel methods.
2008-09-17Move the check_ functions to pm-functions.Victor Lowther1-0/+7
Also conditionalize the do_ functions in the sleep modules. Now, we only declare the actual do_ functions if the system can in fact sleep using the requested method.
2008-09-17Make per-module help and before_hooks methods stackable.Victor Lowther1-1/+30
This will help with making the sleep methods stackable and autodetectable.
2008-09-10Fix logging bug that was aborting help after the first hook.Victor Lowther1-1/+1
2008-07-05Make some changes to core functionality to support pm-powersaveVictor Lowther1-21/+14
This consists of core features extracted from the powersave-hooks branch, and does the following: * Refactor some settings in pm-functions to make it easier to support seperate settings for pm-action and pm-powersave. Other than sharing a mechanism for running hooks and being able to use certian utility functions, they do not have much in common w.r.t settings and lifecycle rules for those settings. * Move take_suspend_lock from pm-functions to pm-action. pm-powersave uses a simpler scheme, and there is not enough code sharing to justify having it in pm-functions. * Add a bit of code to pm-functions to figure out what chassis type we are running on. * Add a 00powersave hook that turns powersaving off across a suspend/resume. Things like laptop-mode in particular have been known to cause issues in some situations. * Make pm-powersave log to a real logfile and try to guess at the appropriate powersave mode if called with no arguments.
2008-06-20If suspend has already been inhibited, don't run more hooks.Victor Lowther1-1/+1
2008-06-08Simplify hook exit status testing logic a bit.Victor Lowther1-4/+3
2008-06-06Incorrect comparison to skip non-run hooks when running hooks in reverse.Victor Lowther1-1/+1
2008-06-06Remember to escape > in pm-functions when running hooks too.Victor Lowther1-1/+1
2008-06-01Add initial support for handling hook failureVictor Lowther1-5/+17
If a hook exits with a status code other then 0 or one of the already-defined exit codes: * Inhibit suspend/resume, and do not run any more hooks. * Track the last sucessful hook that ran, and if we have to run hooks in reverse start with that hook. * If we inhibited for any reason, exit with a non-zero return code from pm-action.
2008-05-28Don't quote $PM_CMDLINE when saving initial parameters.Victor Lowther1-1/+1
2008-05-28Make parameter manipulation more robust in the face of programmerVictor Lowther1-3/+3
error. Use cp and rm when manipulating parameter files instead of mv.
2008-05-28Fix broken add_parameters functionality.Victor Lowther1-2/+3
Also change storage directory cleanup to make things like this easier to debug in the future.
2008-05-27Save PM_CMDLINE correctly so that it shows up nicely in the logs.Victor Lowther1-1/+2
2008-05-27Moved parameter saving os that it always happens after we take the lock.Victor Lowther1-6/+4
2008-05-27Fix reversed logic when creating a parameters file.Victor Lowther1-1/+1
2008-05-27Save all parameters into a file instead of one file per param.Victor Lowther1-11/+10
This closes a security hole noticed by mbiebl.
2008-05-27Fixed error resulting in no parameters being saved.Victor Lowther1-1/+3
Moved the "mkdir -p ${STORAGEDIR}" command.
2008-05-17Remenber to set IFS back to normal before exiting run_quirks.Victor Lowther1-0/+1
2008-05-17arrgh, need to actually export PM_CMDLINE.Victor Lowther1-1/+1
2008-05-17Cleanups to parameter manipulation to make it a bit less evilVictor Lowther1-6/+15
This involved restructuring the run_hooks loop a bit, but it does clean things up some.
2008-05-16Handle binary video drivers using --quirk-none instead of disable_hookVictor Lowther1-25/+5
Otherwise, we would have to duplicate everything to handle the uswsusp use case, and that would be extra annoying.
2008-05-10pm-functions.in cleanups and minor fixes.Victor Lowther1-6/+15
Mostly adding comments to functions whose purpose is not immediatly obvious. Also restructured init_logfile to test for a null $1 before the file tests.
2008-04-27Fix bug that would cause init_logfile to die if the logfile did not exist.Victor Lowther1-1/+1
Add an explicit check for file existence instead of relying on -O to do it for us. Thanks, Till Mass for pointing this out.
2008-03-29Comment fixups in preperation for release.Victor Lowther1-2/+2
In particular, add comments to the top of the sleep hooks describing what each of them is for.
2008-03-20Prettify logging a bit more.Victor Lowther1-1/+1
Now with added timestamps, so you can see how long running all the hooks takes.
2008-03-20Cleaned up logging of which hooks ran a bit more.Victor Lowther1-2/+8
Do this by making log understand the -n option. To retain strict POSIX compatibility, we now use printf instead of echo in the log function.