s2both

Holger Macht hmacht at suse.de
Sun Mar 11 03:22:21 PDT 2007


On Sun 11. Mar - 01:13:09, Tim Dijkstra wrote:
> Hi,
> 
> Both suspend.sf.net and suspend2 have a notion of s2both. That is,
> before suspending to ram, the state of the system is saved to disk just
> like would happen for hibernate.
> This has the obvious benefit of being able to resume in case you
> deplete your batteries while you laptop is suspended.
> 
> I think it would really be useful to have the possibility to do that
> instead of plain s2ram when one suspends. We can of course just make
> use of the possibility in pm-utils when it is available, but I guess a
> checkbox in g-p-m would be nice. For that to work we also need another
> attribute in hal.
> 
> Comments?

Yes, something like this would be nice, indeed. Thanks for bringing this
up. But rather then a checkbox or the like, I think something more
intelligent is suitable for gpm. For instance, when the system is already
low on battery, like < 10%, and the user is about to do a suspend to ram,
he should be warned that the system could run out of battery during
sleep. In this case, one could automatically offer an option to do a
suspend to both. These are implementation details for the higher level
applications of course.

Ok, what we already have is this:

  power_management.can_hibernate = true  (bool)
  power_management.can_suspend = true  (bool)

These values are just a reflexion of what the kernel thinks, namely
/sys/power/state. Another key like

  power_management.can_suspend_to_both = true  (bool)

would be needed. This key would come from userland though, so it can't be
treated like the others. So what about pm-utils installing a fdi file
containing the xml rule to add this key and to execute a script like the
ones from hibernate and suspend (hal-system-power-hibernate, etc.). Would
this be feasible?

Regards,
	Holger


More information about the hal mailing list