Add an option to allow the user to wait for keypress during the resume process so that image i/o stats may be read.
Jason --- HOWTO | 4 ++++ resume.c | 13 +++++++++++++ suspend.c | 5 +++++ swsusp.h | 2 +- 4 files changed, 23 insertions(+), 1 deletion(-) Index: suspend/resume.c =================================================================== --- suspend.orig/resume.c +++ suspend/resume.c @@ -51,6 +51,7 @@ #define decrypt 0 #endif static char splash_param; +static char resume_pause; static struct splash splash; @@ -116,6 +117,11 @@ .fmt = "%c", .ptr = &splash_param, }, + { + .name = "resume pause", + .fmt = "%c", + .ptr = &resume_pause, + }, }; static unsigned int page_size; @@ -656,6 +662,10 @@ close(fd); reboot(); } + } else if (resume_pause) { + printf("press any key to continue..."); + getchar(); + printf("\n"); } if (!error || !ret) { if (!error && verify_checksum) { @@ -750,6 +760,9 @@ if (splash_param != 'y' && splash_param != 'Y') splash_param = 0; + if (resume_pause != 'y' && resume_pause != 'Y') + resume_pause = 0; + while (stat(resume_dev_name, &stat_buf)) { fprintf(stderr, "resume: Could not stat the resume device file.\n" Index: suspend/swsusp.h =================================================================== --- suspend.orig/swsusp.h +++ suspend/swsusp.h @@ -170,7 +170,7 @@ #define SUSPEND_SWAPPINESS 100 -#define GEN_PARAM 8 +#define GEN_PARAM 9 #ifdef CONFIG_COMPRESS #define COMPRESS_PARAM 1 Index: suspend/suspend.c =================================================================== --- suspend.orig/suspend.c +++ suspend/suspend.c @@ -135,6 +135,11 @@ .fmt = "%c", .ptr = &splash_param, }, + { + .name = "resume pause", + .fmt = "%c", + .ptr = NULL, + }, }; static unsigned int page_size; Index: suspend/HOWTO =================================================================== --- suspend.orig/HOWTO +++ suspend/HOWTO @@ -275,6 +275,10 @@ the image to it. [This has been reported to speed up the suspend on some boxes and eliminates the "fast progress meter and long fsync wait" effect.] +If the "resume pause" parameter is set to 'y', the resume utility will pause +and wait for a keypress. This allows the image i/o benchmarks that are printed +during resume to be read. + The "splash" parameter is used to make s2disk and/or resume use a splash system (when set to 'y'). Currently the bootsplash.org and splashy splash systems are supported. Note that for both systems your initrd or initramfs will ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Suspend-devel mailing list Suspend-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/suspend-devel