chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
libvolume_id: recognize swap partitions with a tuxonice hibernate image
[elogind.git]
/
extras
/
volume_id
/
lib
/
linux_swap.c
diff --git
a/extras/volume_id/lib/linux_swap.c
b/extras/volume_id/lib/linux_swap.c
index 50d43ccce684dc65c0ca0f7e2f3feea9d4ba224f..592a38570d46d4852fcf4b4c93f4430676054723 100644
(file)
--- a/
extras/volume_id/lib/linux_swap.c
+++ b/
extras/volume_id/lib/linux_swap.c
@@
-43,7
+43,7
@@
int volume_id_probe_linux_swap(struct volume_id *id, uint64_t off, uint64_t size
unsigned int page;
struct swap_header_v1_2 *sw;
unsigned int page;
struct swap_header_v1_2 *sw;
- info("probing at offset 0x%llx", (unsigned long long) off);
+ info("probing at offset 0x%llx
\n
", (unsigned long long) off);
/* eek, the swap signature is at the end of the PAGE_SIZE */
for (page = 0x1000; page <= LARGEST_PAGESIZE; page <<= 1) {
/* eek, the swap signature is at the end of the PAGE_SIZE */
for (page = 0x1000; page <= LARGEST_PAGESIZE; page <<= 1) {
@@
-73,6
+73,12
@@
int volume_id_probe_linux_swap(struct volume_id *id, uint64_t off, uint64_t size
strcpy(id->type_version, "ulsuspend");
goto found_label;
}
strcpy(id->type_version, "ulsuspend");
goto found_label;
}
+
+ if (memcmp(buf, "\xed\xc3\x02\xe9\x98\x56\xe5\x0c", 8) == 0) {
+ id->type = "suspend";
+ strcpy(id->type_version, "tuxonice");
+ goto found_label;
+ }
}
return -1;
}
return -1;