-vol_id - partition, filesystem, disklabel reader
+vol_id - volume, filesystem, disklabel reader
This program is normally called from a udev rule, to provide udev with the
-name, uuid or the filesystem type of a partition to name a device node.
+name, uuid or the filesystem type of a volume to name a device node.
vol_id opens the blockdevice node specified at the commandline.
The following commandline switches are supported to specify what vol_id
should print:
--export prints all values
-h prints help text
- -l prints the label of the partition
- -u prints the uuid of the partition
+ -l prints the label of the volume
+ -u prints the uuid of the volume
vol_id will only return successful if the string asked for, is not
empty. All trailing whitespace will be removed, spaces replaced by underscore
switch (usage_id) {
case VOLUME_ID_FILESYSTEM:
return "filesystem";
- case VOLUME_ID_PARTITIONTABLE:
- return "partitiontable";
case VOLUME_ID_OTHER:
return "other";
case VOLUME_ID_RAID:
return NULL;
}
-void volume_id_set_usage_part(struct volume_id_partition *part, enum volume_id_usage usage_id)
-{
- part->usage_id = usage_id;
- part->usage = usage_to_string(usage_id);
-}
-
void volume_id_set_usage(struct volume_id *id, enum volume_id_usage usage_id)
{
id->usage_id = usage_id;
extern void volume_id_set_unicode16(char *str, size_t len, const uint8_t *buf, enum endian endianess, size_t count);
extern void volume_id_set_usage(struct volume_id *id, enum volume_id_usage usage_id);
-extern void volume_id_set_usage_part(struct volume_id_partition *part, enum volume_id_usage usage_id);
extern void volume_id_set_label_raw(struct volume_id *id, const uint8_t *buf, size_t count);
extern void volume_id_set_label_string(struct volume_id *id, const uint8_t *buf, size_t count);
extern void volume_id_set_label_unicode16(struct volume_id *id, const uint8_t *buf, enum endian endianess, size_t count);
/*
- * volume_id - reads filesystem label and uuid
+ * volume_id - reads volume label and uuid
*
* Copyright (C) 2005 Kay Sievers <kay.sievers@vrfy.org>
*
volume_id_free_buffer(id);
- if (id->partitions != NULL)
- free(id->partitions);
-
free(id);
}
/*
- * volume_id - reads partition label and uuid
+ * volume_id - reads volume label and uuid
*
* Copyright (C) 2005 Kay Sievers <kay.sievers@vrfy.org>
*
VOLUME_ID_UNPROBED,
VOLUME_ID_OTHER,
VOLUME_ID_FILESYSTEM,
- VOLUME_ID_PARTITIONTABLE,
VOLUME_ID_RAID,
VOLUME_ID_DISKLABEL,
VOLUME_ID_CRYPTO,
};
-struct volume_id_partition {
- enum volume_id_usage usage_id;
- char *usage;
- char *type;
- uint64_t off;
- uint64_t len;
- uint8_t partition_type_raw;
-};
-
struct volume_id {
uint8_t label_raw[VOLUME_ID_LABEL_SIZE];
size_t label_raw_len;
char *type;
char type_version[VOLUME_ID_FORMAT_SIZE];
- struct volume_id_partition *partitions;
- size_t partition_count;
-
int fd;
uint8_t *sbbuf;
size_t sbbuf_len;
print all values in key/value format to import them into the environment.
.TP
.BI -l
-print the label of the partition
+print the label of the volume
.TP
.BI -t
-print the type of the partition
+print the type of the volume
.TP
.BI -u
-print the uuid of the partition
+print the uuid of the volume
.RE
.SH EXIT STATUS
.B vol_id