3/3 swsusp: enable resume from initrd
Subsystems (3)
Hi!
From: [email protected]
When using a fully modularized kernel it is necessary to activate resume manually as the device node might not be available during kernel init.
This patch implements a new sysfs attribute '/sys/power/resume' which allows for manual activation of software resume. When read from it prints the configured resume device in 'major:minor' format. When written to it expects a device in 'major:minor' format. This device is then checked for a suspended image and resume is started if a valid image is found. The original functionality is left in place.
It should be used from initramfs, or with care.
Please apply,
Pavel
Signed-off-by Hannes Reinecke <[email protected]>
Signed-off-by Pavel Machek <[email protected]>
include/linux/suspend.h +2 -0
@@ -35,6 +35,8 @@#define SUSPEND_PD_PAGES (x) (((x)*sizeof(struct pbe))/PAGE_SIZE+1) + +extern dev_t swsusp_resume_device;/* mm/vmscan.c */ extern int shrink_mem (void );
init/do_mounts.c +2 -2
@@ -53,7 +53,7 @@__setup ("ro" , readonly);__setup ("rw" , readwrite); -static dev_t __init try_name (char *name,int part) +static dev_t try_name (char *name,int part) {char path[64 ];char buf[32 ];
@@ -135,7 +135,7 @@* is mounted on rootfs /sys. */ -dev_t __init name_to_dev_t (char *name) +dev_t name_to_dev_t (char *name) {char s[32 ];char *p;
kernel/power/disk.c +82 -17
183 lines not on this page · raw message
kernel/power/swsusp.c +75 -26
211 lines not on this page · raw message
Signature · 2 lines
People were complaining that M$ turns users into beta-testers... ...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!