[PATCH] recognize compressed hibernate swap images]

James Hunt james.hunt at ubuntu.com
Wed Jan 5 08:32:46 UTC 2011


You may wish to revert this patch since the new compressed hibernate
swap image header has been reverted in the mainline kernel to avoid
breaking Fedora:

--------------------
  commit be8cd644c49dca4212e975455c8e7119b848ebe8
  Author: Rafael J. Wysocki <rjw at sisk.pl>
  Date:   Sat Dec 11 21:46:44 2010 +0100

      PM / Hibernate: Restore old swap signature to avoid user space breakage
--------------------

----- Forwarded message from James Hunt <james.hunt at ubuntu.com> -----

Date: Thu, 16 Dec 2010 12:34:51 +0000
From: James Hunt <james.hunt at ubuntu.com>
To: busybox at busybox.net
Subject: [PATCH] recognize compressed hibernate swap images


Attached patch adds support to recognize new compressed hibernate swap
images.

Note: It appears that the swapon applet doesn't behave like swapon(8),
which rewrites the swap signature when it detects an old suspend
signature. If true, this could lead to FS corruption.

James
--
James Hunt
______________________________________________________________________
Ubuntu Foundations Team, Canonical.

From b260d38e8f3e0e3453ee44a2f3c90755d7053c56 Mon Sep 17 00:00:00 2001
From: James Hunt <james.hunt at ubuntu.com>
Date: Thu, 16 Dec 2010 12:22:38 +0000
Subject: [PATCH] Recognize compressed hibernate swap signature.

util-linux/volume_id/linux_swap.c: Added the new magic LINHIB0001
signature.

See:

https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/683605

Signed-off-by: James Hunt <james.hunt at ubuntu.com>
---
 util-linux/volume_id/linux_swap.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/util-linux/volume_id/linux_swap.c b/util-linux/volume_id/linux_swap.c
index 5743546..0aa43f3 100644
--- a/util-linux/volume_id/linux_swap.c
+++ b/util-linux/volume_id/linux_swap.c
@@ -55,6 +55,7 @@ int FAST_FUNC volume_id_probe_linux_swap(struct volume_id *id /*,uint64_t off*/)
 			if (memcmp(buf, "SWAPSPACE2", 10) == 0
 			 || memcmp(buf, "S1SUSPEND", 9) == 0
 			 || memcmp(buf, "S2SUSPEND", 9) == 0
+			 || memcmp(buf, "LINHIB0001", 10) == 0
 			 || memcmp(buf, "ULSUSPEND", 9) == 0
 			) {
 				sw = volume_id_get_buffer(id, off, sizeof(struct swap_header_v1_2));
-- 
1.7.1





----- End forwarded message -----

Kind regards,

James
-- 

James Hunt
______________________________________________________________________
Ubuntu Foundations Team, Canonical.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20110105/53dc0c94/attachment.pgp>


More information about the busybox mailing list