Loading Documentation/power/swsusp.txt +9 −1 Original line number Diff line number Diff line Loading @@ -24,8 +24,16 @@ Some warnings, first. * see the FAQ below for details. (This is not true for more traditional * power states like "standby", which normally don't turn USB off.) Swap partition: You need to append resume=/dev/your_swap_partition to kernel command line. Then you suspend by line or specify it using /sys/power/resume. Swap file: If using a swapfile you can also specify a resume offset using resume_offset=<number> on the kernel command line or specify it in /sys/power/resume_offset. After preparing then you suspend by echo shutdown > /sys/power/disk; echo disk > /sys/power/state Loading kernel/power/hibernate.c +24 −0 Original line number Diff line number Diff line Loading @@ -1076,6 +1076,29 @@ static ssize_t resume_store(struct kobject *kobj, struct kobj_attribute *attr, power_attr(resume); static ssize_t resume_offset_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) { return sprintf(buf, "%llu\n", (unsigned long long)swsusp_resume_block); } static ssize_t resume_offset_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t n) { unsigned long long offset; int rc; rc = kstrtoull(buf, 0, &offset); if (rc) return rc; swsusp_resume_block = offset; return n; } power_attr(resume_offset); static ssize_t image_size_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) { Loading Loading @@ -1121,6 +1144,7 @@ power_attr(reserved_size); static struct attribute * g[] = { &disk_attr.attr, &resume_offset_attr.attr, &resume_attr.attr, &image_size_attr.attr, &reserved_size_attr.attr, Loading Loading
Documentation/power/swsusp.txt +9 −1 Original line number Diff line number Diff line Loading @@ -24,8 +24,16 @@ Some warnings, first. * see the FAQ below for details. (This is not true for more traditional * power states like "standby", which normally don't turn USB off.) Swap partition: You need to append resume=/dev/your_swap_partition to kernel command line. Then you suspend by line or specify it using /sys/power/resume. Swap file: If using a swapfile you can also specify a resume offset using resume_offset=<number> on the kernel command line or specify it in /sys/power/resume_offset. After preparing then you suspend by echo shutdown > /sys/power/disk; echo disk > /sys/power/state Loading
kernel/power/hibernate.c +24 −0 Original line number Diff line number Diff line Loading @@ -1076,6 +1076,29 @@ static ssize_t resume_store(struct kobject *kobj, struct kobj_attribute *attr, power_attr(resume); static ssize_t resume_offset_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) { return sprintf(buf, "%llu\n", (unsigned long long)swsusp_resume_block); } static ssize_t resume_offset_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t n) { unsigned long long offset; int rc; rc = kstrtoull(buf, 0, &offset); if (rc) return rc; swsusp_resume_block = offset; return n; } power_attr(resume_offset); static ssize_t image_size_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) { Loading Loading @@ -1121,6 +1144,7 @@ power_attr(reserved_size); static struct attribute * g[] = { &disk_attr.attr, &resume_offset_attr.attr, &resume_attr.attr, &image_size_attr.attr, &reserved_size_attr.attr, Loading