--- include/linux/suspend.h.orig 2005-01-14 07:33:58.000000000 -0800 +++ include/linux/suspend.h 2005-04-01 21:26:41.000000000 -0800 @@ -35,14 +35,19 @@ /* kernel/power/swsusp.c */ extern int software_suspend(void); +extern int software_resume(void); -#else /* CONFIG_SOFTWARE_SUSPEND */ +#else /* CONFIG_PM */ static inline int software_suspend(void) { printk("Warning: fake suspend called\n"); return -EPERM; } -#endif /* CONFIG_SOFTWARE_SUSPEND */ +static inline int software_resume(void) +{ + return 0; +} +#endif /* CONFIG_PM */ #ifdef CONFIG_PM --- init/do_mounts.c.orig 2004-08-13 22:36:56.000000000 -0700 +++ init/do_mounts.c 2005-04-01 21:21:12.000000000 -0800 @@ -352,6 +352,14 @@ void __init mount_root(void) { +#ifdef CONFIG_SOFTWARE_SUSPEND + /* + * Must resume after initrd has loaded the device for the root filesys, + * presumed same as the one with the swap partition with the resume + * image, but before mounting anything, which resuming would smear. + */ + software_resume(); +#endif #ifdef CONFIG_ROOT_NFS if (MAJOR(ROOT_DEV) == UNNAMED_MAJOR) { if (mount_nfs_root()) --- kernel/power/disk.c.orig 2005-01-14 07:33:58.000000000 -0800 +++ kernel/power/disk.c 2005-04-01 21:30:14.000000000 -0800 @@ -216,7 +216,7 @@ * */ -static int software_resume(void) +int software_resume(void) { int error; @@ -252,8 +252,6 @@ return 0; } -late_initcall(software_resume); - static char * pm_disk_modes[] = { [PM_DISK_FIRMWARE] = "firmware",