Set the resume2= value when the user has echoed to filewriter_target and
we've verified that an image exists in that file. The user can then read
the value and modify their bootloader or initrd to set the value to the
same thing when resuming.
Signed-off-by: Nigel Cunningham <[email protected]>
kernel/power/suspend_file.c | 29 +++++++++++++++++++++++++++++
1 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/kernel/power/suspend_file.c b/kernel/power/suspend_file.c
index 20d0807..2e19aae 100644
--- a/kernel/power/suspend_file.c
+++ b/kernel/power/suspend_file.c
@@ -799,3 +799,32 @@ static void filewriter_mark_resume_attem
filewriter_signature_op(MARK_RESUME_ATTEMPTED);
}
+static void filewriter_set_resume2(void)
+{
+ char *buffer = (char *) get_zeroed_page(GFP_ATOMIC);
+ char *buffer2 = (char *) get_zeroed_page(GFP_ATOMIC);
+ unsigned long sector = bmap(target_inode, 0);
+ int offset = 0;
+
+ if (filewriter_target_bdev) {
+ set_devinfo(filewriter_target_bdev, target_inode->i_blkbits);
+
+ bdevname(filewriter_target_bdev, buffer2);
+ offset += snprintf(buffer + offset, PAGE_SIZE - offset,
+ "/dev/%s", buffer2);
+
+ if (sector)
+ offset += snprintf(buffer + offset, PAGE_SIZE - offset,
+ ":0x%lx", sector << devinfo.bmap_shift);
+ } else
+ offset += snprintf(buffer + offset, PAGE_SIZE - offset,
+ "%s is not a valid target.", filewriter_target);
+
+ sprintf(resume2_file, "file:%s", buffer);
+
+ free_page((unsigned long) buffer);
+ free_page((unsigned long) buffer2);
+
+ suspend_attempt_to_parse_resume_device();
+}
+
--
Nigel Cunningham nigel at suspend2 dot net
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]