Wednesday, October 08, 2008

"smart" suspend in pm-utils

I finally implementd the "smart" suspend in our pm-utils package. This means that hopefully more machines will just suspend to RAM "out of the box" without any tweaking of configuration etc. It also leverages the quirks list in HAL which is a bit bigger than the one in s2ram (but IMVHO also of lower quality...) in case the machine is unknown to s2ram.

Give it a try in the next beta, or, if you can't wait any longer, fetch it from home:seife:Factory (the Build Service is pretty busy lately, so the packages are not built for Factory yet, just use the 11.0 version, it should work in 11.1 too).

3 comments:

  1. Hi,

    My machine stopped suspending (s2ram) and I couldn't figure it out. I was getting no messages written to the log file. I finally narrowed it down to a empty `/.suspended' file.

    Below is a patch to the `functions' script (11.1) which checks that the `/.suspended' file exists and is sized greater than zero.

    I've tested it on my laptop. Thanks for the great work.

    ROOT-root@zoom-489-[pm-utils]: diff -u functions*
    --- functions 2009-01-07 00:41:08.341129371 -0500
    +++ functions.orig 2009-01-07 00:41:04.892007783 -0500
    @@ -61,7 +61,7 @@
    # on, and it looks better with splashy support
    #chvt 63

    - if [ -s /.suspended ]; then
    + if [ -f /.suspended ]; then
    read pid < /.suspended
    if [ -d /proc/$pid ]; then
    return 1

    ReplyDelete
  2. Oops, I see I should get some sleep before I post ... here's the correct `diff -u' - sorry about that:

    ROOT-root@zoom-431-[pm-utils]: diff -u functions.orig functions
    --- functions.orig 2009-01-07 00:41:04.892007783 -0500
    +++ functions 2009-01-07 00:41:08.341129371 -0500
    @@ -61,7 +61,7 @@
    # on, and it looks better with splashy support
    #chvt 63

    - if [ -f /.suspended ]; then
    + if [ -s /.suspended ]; then
    read pid < /.suspended
    if [ -d /proc/$pid ]; then
    return 1
    ROOT-root@zoom-432-[pm-utils]:

    ReplyDelete
  3. I found this site when looking for "smart suspend" on Linux, but I think what I was looking for is not what you were talking about. What I wanted was a combined suspend/hibernate with a tuneable switchover time which did not pre-emptively write ram to disk. While writing ram out to disk ASAP is nice since you can unplug the battery, on a mobile system this is a waste of power usually.

    Here is a link to my blog where I have developed a solution for this. I figured others will probably also find this when searching for smart suspend.

    http://www.angrylibertarian.com/node/49

    ReplyDelete