1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-10-30 23:21:08 +03:00

volume_id: remove all partition table support

This commit is contained in:
Kay Sievers 2006-03-21 16:16:55 +01:00
parent 10a9bff1c3
commit 7808297b0f
6 changed files with 9 additions and 34 deletions

View File

@ -1,15 +1,15 @@
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

View File

@ -68,8 +68,6 @@ static char *usage_to_string(enum volume_id_usage usage_id)
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:
@ -86,12 +84,6 @@ static char *usage_to_string(enum volume_id_usage usage_id)
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;

View File

@ -64,7 +64,6 @@ enum endian {
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);

View File

@ -1,5 +1,5 @@
/*
* volume_id - reads filesystem label and uuid
* volume_id - reads volume label and uuid
*
* Copyright (C) 2005 Kay Sievers <kay.sievers@vrfy.org>
*
@ -221,8 +221,5 @@ void volume_id_close(struct volume_id *id)
volume_id_free_buffer(id);
if (id->partitions != NULL)
free(id->partitions);
free(id);
}

View File

@ -1,5 +1,5 @@
/*
* volume_id - reads partition label and uuid
* volume_id - reads volume label and uuid
*
* Copyright (C) 2005 Kay Sievers <kay.sievers@vrfy.org>
*
@ -31,21 +31,11 @@ enum volume_id_usage {
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;
@ -58,9 +48,6 @@ struct volume_id {
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;

View File

@ -21,13 +21,13 @@ should print:
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