[Pm-utils] [Patch] add userspace suspend signature to pm-reset-swap

Stefan Seyfried seife at suse.de
Wed Mar 14 11:42:41 PDT 2007


On Wed, Mar 14, 2007 at 07:06:29PM +0100, Olivier Blin wrote:
> Stefan Seyfried <seife at suse.de> writes:
> 
> > On Wed, Mar 14, 2007 at 10:53:17AM -0400, Peter Jones wrote:
> >> On Tue, 2007-02-20 at 19:36 +0100, Stefan Seyfried wrote:
> >> 
> >> > The printf for "no signature found" is not really necessary, but i found
> >> > it useful :-)
> >> 
> >> Eh, I actually like the "no output if no failure" better... Feel free to
> >> convince me otherwise, though ;)
> >
> > No, that's fine. After checking the debian patches to swapon, i actually
> > thing that writing something like
> >
> > Warning: removed stale suspend signature
> >
> > in the case that we needed to reset the signature could be useful, at least
> > if pm-reset-swap is called unconditionally in the boot scripts, but this is
> > not really important.
> 
> Does it keep swap labels?

I'd say yes.

The end of the first swap page looks like this:

................SWAPSPACE2.

When suspended it looks like:

......SWAPSPACE2S1SUSPEND..
      <<<<<<<<<<gets moved -10 bytes

pm-reset-swap simply moves the swap signature back +10 bytes.
Even UUIDs should be unaffected by this.

> FYI, in Mandriva, we use this script (derived from a suspend2 script):
> http://svn.mandriva.com/cgi-bin/viewvc.cgi/soft/initscripts/trunk/mandrake/hibernate-cleanup.sh?view=markup
> It takes care of most suspend signatures, and adds swap labels back
> (based on fstab).

Yes, but it does not work with UUIDs. Nor does the debian swapon thing.

To be honest: i don't even know how to generate a swap with UUID, but
somebody mentioned to me that advising people to mkswap after a failed
resume could be bad if they are activating the swap via UUID.

There's lots of stuff i don't know anything about ;-)
-- 
Stefan Seyfried

"Any ideas, John?"
"Well, surrounding them's out." 


More information about the Pm-utils mailing list