Signed-off-by: Pekka Enberg --- include/linux/suspend.h | 2 ++ init/do_mounts.c | 18 ++++++++++++++++++ kernel/power/disk.c | 22 ++++++++++++++++++---- 3 files changed, 38 insertions(+), 4 deletions(-) Index: 2.6/include/linux/suspend.h =================================================================== --- 2.6.orig/include/linux/suspend.h 2007-04-27 14:43:13.000000000 +0300 +++ 2.6/include/linux/suspend.h 2007-04-27 14:43:56.000000000 +0300 @@ -61,4 +61,6 @@ #define PAGES_FOR_IO 1024 #define POSS_NOSAVE #endif +extern int software_resume(void); + #endif /* _LINUX_SWSUSP_H */ Index: 2.6/init/do_mounts.c =================================================================== --- 2.6.orig/init/do_mounts.c 2007-04-27 14:43:55.000000000 +0300 +++ 2.6/init/do_mounts.c 2007-04-27 14:43:56.000000000 +0300 @@ -440,9 +440,27 @@ if (strncmp(root_device_name, "/dev/", is_floppy = MAJOR(ROOT_DEV) == FLOPPY_MAJOR; + /* Suspend2: + * By this point, suspend_early_init has been called to initialise our + * sysfs interface. If modules are built in, they have registered (all + * of the above via initcalls). + * + * We have not yet looked to see if an image exists, however. If we + * have an initrd, it is expected that the user will have set it up + * to echo > /sys/power/suspend2/do_resume and thus initiate any + * resume. If they don't do that, we do it immediately after the initrd + * is finished (major issues if they mount filesystems rw from the + * initrd! - they are warned. If there's no usable initrd, we do our + * check next. + */ if (initrd_load()) goto out; +#ifdef CONFIG_SUSPEND2 + if (test_suspend_state(SUSPEND_RESUME_NOT_DONE)) + software_resume(); +#endif + if (is_floppy && rd_doload && rd_load_disk(0)) ROOT_DEV = Root_RAM0; Index: 2.6/kernel/power/disk.c =================================================================== --- 2.6.orig/kernel/power/disk.c 2007-04-27 14:42:13.000000000 +0300 +++ 2.6/kernel/power/disk.c 2007-04-27 14:43:56.000000000 +0300 @@ -24,6 +24,7 @@ * Copyright (c) 2004 Pavel Machek