diff options
author | Hannes Reinecke <hare@suse.de> | 2007-12-16 19:22:32 +0100 |
---|---|---|
committer | Kay Sievers <kay.sievers@vrfy.org> | 2007-12-16 19:22:32 +0100 |
commit | 5caa40bea22b9ac07dbe667985d1b8556d8b6b80 (patch) | |
tree | 1a05b3c754ab03d5b0e2bd4a29c89ae8bb1a3ea8 /extras/volume_id/lib/util.c | |
parent | 9e5920842b0b414e78b04ddd40fb4cf29b0d855c (diff) |
volume_id: LVM - add uuid
Diffstat (limited to 'extras/volume_id/lib/util.c')
-rw-r--r-- | extras/volume_id/lib/util.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/extras/volume_id/lib/util.c b/extras/volume_id/lib/util.c index 395e81bbf3..c094661ccc 100644 --- a/extras/volume_id/lib/util.c +++ b/extras/volume_id/lib/util.c @@ -274,9 +274,12 @@ void volume_id_set_uuid(struct volume_id *id, const uint8_t *buf, size_t len, en case UUID_DCE: count = 16; break; - case UUID_FOURINT: + case UUID_MD: count = 35; break; + case UUID_LVM: + count = 32; + break; } memcpy(id->uuid_raw, buf, count); id->uuid_raw_len = count; @@ -324,7 +327,7 @@ set: memcpy(id->uuid, buf, count); id->uuid[count] = '\0'; break; - case UUID_FOURINT: + case UUID_MD: sprintf(id->uuid, "%02x%02x%02x%02x:%02x%02x%02x%02x:%02x%02x%02x%02x:%02x%02x%02x%02x", buf[0], buf[1], buf[2], buf[3], @@ -332,6 +335,17 @@ set: buf[8], buf[9], buf[10], buf[11], buf[12], buf[13], buf[14],buf[15]); break; + case UUID_LVM: + sprintf(id->uuid, + "%c%c%c%c%c%c-%c%c%c%c-%c%c%c%c-%c%c%c%c-%c%c%c%c-%c%c%c%c-%c%c%c%c%c%c", + buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], + buf[6], buf[7], buf[8], buf[9], + buf[10], buf[11], buf[12], buf[13], + buf[14], buf[15], buf[16], buf[17], + buf[18], buf[19], buf[20], buf[21], + buf[22], buf[23], buf[24], buf[25], + buf[26], buf[27], buf[28], buf[29], buf[30], buf[31]); + break; } } |