]> err.no Git - util-linux/commitdiff
libblkid: add LINHIB0001 signature to swap prober
authorKarel Zak <kzak@redhat.com>
Mon, 29 Nov 2010 09:26:18 +0000 (10:26 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 30 Nov 2010 09:12:00 +0000 (10:12 +0100)
The new swsuspend signature has been added by commit
3624eb04c24861ab296842414f9752a393e68372 to kernel 2.6.37-rc1.

Reported-by: "Dr. David Alan Gilbert" <linux@treblig.org>
Addresses: https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/682176
Signed-off-by: Karel Zak <kzak@redhat.com>
mount/swapon.c
shlibs/blkid/src/superblocks/swap.c

index d8fad0bfaa9e919a13723d7c3ba36cb36d8dbcec..a2dd9dc26346d6219774f4124c178273c36fc63a 100644 (file)
@@ -298,7 +298,8 @@ swap_detect_signature(const char *buf, int *sig)
        else if (memcmp(buf, "S1SUSPEND", 9) == 0 ||
                 memcmp(buf, "S2SUSPEND", 9) == 0 ||
                 memcmp(buf, "ULSUSPEND", 9) == 0 ||
-                memcmp(buf, "\xed\xc3\x02\xe9\x98\x56\xe5\x0c", 8) == 0)
+                memcmp(buf, "\xed\xc3\x02\xe9\x98\x56\xe5\x0c", 8) == 0 ||
+                memcmp(buf, "LINHIB0001", 10) == 0)
                *sig = SIG_SWSUSPEND;
        else
                return 0;
index e2b0db9f1fe653035013ff360bc00d05f8d5ff7a..325a8fafafc05a8e8525bea75c819d89cc39304a 100644 (file)
@@ -102,6 +102,8 @@ static int probe_swsuspend(blkid_probe pr, const struct blkid_idmag *mag)
                return swap_set_info(pr, "ulsuspend");
        if (!memcmp(mag->magic, TOI_MAGIC_STRING, mag->len))
                return swap_set_info(pr, "tuxonice");
+       if (!memcmp(mag->magic, "LINHIB0001", mag->len))
+               return swap_set_info(pr, "linhib0001");
 
        return -1;      /* no signature detected */
 }
@@ -141,18 +143,28 @@ const struct blkid_idinfo swsuspend_idinfo =
                { "S1SUSPEND", 9, 0, 0xff6 },
                { "S2SUSPEND", 9, 0, 0xff6 },
                { "ULSUSPEND", 9, 0, 0xff6 },
+               { "LINHIB0001",10,0, 0xff6 },
+
                { "S1SUSPEND", 9, 0, 0x1ff6 },
                { "S2SUSPEND", 9, 0, 0x1ff6 },
                { "ULSUSPEND", 9, 0, 0x1ff6 },
+               { "LINHIB0001",10,0, 0x1ff6 },
+
                { "S1SUSPEND", 9, 0, 0x3ff6 },
                { "S2SUSPEND", 9, 0, 0x3ff6 },
                { "ULSUSPEND", 9, 0, 0x3ff6 },
+               { "LINHIB0001",10,0, 0x3ff6 },
+
                { "S1SUSPEND", 9, 0, 0x7ff6 },
                { "S2SUSPEND", 9, 0, 0x7ff6 },
                { "ULSUSPEND", 9, 0, 0x7ff6 },
+               { "LINHIB0001",10,0, 0x7ff6 },
+
                { "S1SUSPEND", 9, 0, 0xfff6 },
                { "S2SUSPEND", 9, 0, 0xfff6 },
                { "ULSUSPEND", 9, 0, 0xfff6 },
+               { "LINHIB0001",10,0, 0xfff6 },
+
                { NULL }
        }
 };