x86 Suspend/resume support in Hoary

Sami Haahtinen ressu at ressukka.net
Sat Feb 5 04:28:17 CST 2005


Matt Zimmerman wrote:
> On Sat, Feb 05, 2005 at 10:52:29AM +0200, Sami Haahtinen wrote:
>>The scripts should check for a kernel version mismatch, which wont be as 
>>easy as it sounds.
> 
> Coincidentally, I was just working on a related problem a couple of weeks
> ago.  Attached is the result.

That could work, the problem still is how to show the information to the 
user, if it appears as the computer is going to hibernation but halts 
just before shutting down to ask a question or returns to a working 
state because of this kind of error will cause just as much trouble as 
the current situation.

We need somekind of audio alert about the error to let the user know 
that things aren't progressing as they expect. Normally people (me 
included) assume that if they tell the computer to sleep, it will sleep. 
If it doesn't they will most likely notice it too late.

> It sounds like we would need to do a few things:
> 
> - Refuse to hibernate if the running kernel does not match the
>   kernel to be used as default on the next boot (tricky)

This would be the sane thing to do from a hackers point of view. The 
user might not understand the reasoning behind this. But assuming that 
we can alert the user properly, this is the best possible alternative.

> - If the resume fails due to a mismatch, halt, giving the user a chance to
>   recover

This could be a big disaster too. if the user doesn't have anything but 
a single kernel, how would one recover? Somekind of menu might be a good 
idea:

----8<----
Your kernel version doesn't match the kernel version that the 
hibernation data was saved with, what would you like to do:

1. Restart and try another kernel
2. Continue and loose the hibernation state

Choose [1]:
----8<----

> Would it help to sync() just before going to sleep, to reduce the risk of
> corruption if anything goes wrong with the resume?

Unless you can tell all of the user apps to do a save and then sync, 
this would help. Other than that, it's pretty much the same as turning 
off your computer unwarned.

The other alternative would be to create a libsavetempcopy, which would 
be a generic way to trigger an application to save a temporary copy of 
it's data on a D-Bus trigger or something alike. This ofcourse needs a 
huge amount of work to apply to all applications so we can rule this out 
(for now at least).

- S




More information about the ubuntu-devel mailing list