~vcs-imports/suspend/trunk

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
To get encrypted swsusp to work, try this:

cryptosuspend:
#!/bin/bash
PASSPHRASE=`cat /dev/urandom | uuenpipe | head -3 | tail -1`
echo $PASSPHRASE | gpg -e -r Suspendkey > /tmp/swsusp.Suspendkey
# gpg-keygen, call the key 'Suspendkey'. Provide passphrase you want to use as resume password.
echo $PASSPHRASE | ./suspend -p /dev/hda1

cryptoresume:
#!/bin/bash
echo 'passphrase' | gpg -d -r Suspendkey --passphrase-fd 0 /tmp/swsusp.Suspendkey | ./resume -p /dev/hda1

Known problems with freezer:

1) stress -d 5 --hdd-bytes 100M -i 5 -c 5 

breaks it most of the time.

2) mysqld breaks it.

https://bugzilla.novell.com/show_bug.cgi?id=71076

This simple program should demonstrate the bug

#include <signal.h>
#include <errno.h>
#include <stdlib.h>

int main(int argc,char ** argv) {
	sigset_t set;
	int sig;
	sigemptyset(&set);
	sigprocmask(SIG_BLOCK,&set,NULL);
	while(sigwait(&set,&sig)==EINTR);
	return 0;
}