e2fsprogs-1.39-luks.patch Problem: libblkid doesn't detect/report UUIDs of cryptsetup-luks partitio ns Solution: Add probe for luks UUID Signed-off-by: Karsten Hopp --- e2fsprogs-1.39/lib/blkid/ChangeLog.luksuuid 2007-06-11 13:40:14.000000000 +0200 +++ e2fsprogs-1.39/lib/blkid/ChangeLog 2007-06-11 13:40:14.000000000 +0200 @@ -0,0 +1,4 @@ +2007-05-22 Karsten Hopp + + * probe.c (probe_luks): Add support for cryptsetup-luks partitions + --- e2fsprogs-1.39/lib/blkid/probe.c.luksuuid 2007-06-11 13:40:14.000000000 +0200 +++ e2fsprogs-1.39/lib/blkid/probe.c 2007-06-13 12:50:27.000000000 +0200 @@ -468,6 +468,18 @@ static int probe_jfs(struct blkid_probe return 0; } +static int probe_luks(struct blkid_probe *probe, + struct blkid_magic *id __BLKID_ATTR((unused)), + unsigned char *buf) +{ + unsigned char uuid[40]; + /* 168 is the offset to the 40 character uuid: + * http://luks.endorphin.org/LUKS-on-disk-format.pdf */ + strncpy(uuid, buf+168, 40); + blkid_set_tag(probe->dev, "UUID", uuid, sizeof(uuid)); + return 0; +} + static int probe_romfs(struct blkid_probe *probe, struct blkid_magic *id __BLKID_ATTR((unused)), unsigned char *buf) @@ -775,6 +787,7 @@ static struct blkid_magic type_array[] = { "ocfs2", 2, 0, 6, "OCFSV2", probe_ocfs2 }, { "ocfs2", 4, 0, 6, "OCFSV2", probe_ocfs2 }, { "ocfs2", 8, 0, 6, "OCFSV2", probe_ocfs2 }, + { "crypt_LUKS",0, 0, 6, "LUKS\xba\xbe", probe_luks }, { NULL, 0, 0, 0, NULL, NULL } };