INSTALL_LIB = ${INSTALL} -m 755
SHLIB_CUR = 0
-SHLIB_REV = 81
+SHLIB_REV = 82
SHLIB_AGE = 0
SHLIB = libvolume_id.so.$(SHLIB_CUR).$(SHLIB_REV).$(SHLIB_AGE)
uuid.ints[2] = 0;
uuid.ints[3] = 0;
}
- volume_id_set_uuid(id, uuid.bytes, 0, UUID_FOURINT);
+ volume_id_set_uuid(id, uuid.bytes, 0, UUID_MD);
snprintf(id->type_version, sizeof(id->type_version)-1, "%u.%u.%u",
le32_to_cpu(mdp0->major_version),
le32_to_cpu(mdp0->minor_version),
uuid.ints[2] = 0;
uuid.ints[3] = 0;
}
- volume_id_set_uuid(id, uuid.bytes, 0, UUID_FOURINT);
+ volume_id_set_uuid(id, uuid.bytes, 0, UUID_MD);
snprintf(id->type_version, sizeof(id->type_version)-1, "%u.%u.%u",
be32_to_cpu(mdp0->major_version),
be32_to_cpu(mdp0->minor_version),
if (le32_to_cpu(mdp1->major_version) != 1)
return -1;
- volume_id_set_uuid(id, mdp1->set_uuid, 0, UUID_FOURINT);
+ volume_id_set_uuid(id, mdp1->set_uuid, 0, UUID_MD);
volume_id_set_label_raw(id, mdp1->set_name, 32);
volume_id_set_label_string(id, mdp1->set_name, 32);
volume_id_set_usage(id, VOLUME_ID_RAID);
uint8_t type[8];
} PACKED;
+struct lvm2_pv_header {
+ uint8_t id[32];
+ uint64_t devsize_xl;
+} PACKED;
+
#define LVM1_SB_OFF 0x400
#define LVM1_MAGIC "HM"
const uint8_t *buf;
unsigned int soff;
struct lvm2_super_block *lvm;
+ struct lvm2_pv_header *pvhdr;
dbg("probing at offset 0x%llx", (unsigned long long) off);
return -1;
found:
+ dbg("found at offset 0x%x (pv hdr offset 0x%x)",
+ soff, cpu_to_le32(lvm->offset_xl));
+ soff += cpu_to_le32(lvm->offset_xl);
+ pvhdr = (struct lvm2_pv_header *) &buf[soff];
memcpy(id->type_version, lvm->type, 8);
volume_id_set_usage(id, VOLUME_ID_RAID);
+ volume_id_set_uuid(id, pvhdr->id, 0, UUID_LVM);
id->type = "LVM2_member";
return 0;
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;
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],
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;
}
}
UUID_DOS,
UUID_64BIT_LE,
UUID_64BIT_BE,
- UUID_FOURINT,
+ UUID_MD,
+ UUID_LVM,
};
enum endian {