From: Kay Sievers Date: Tue, 21 Mar 2006 15:16:55 +0000 (+0100) Subject: volume_id: remove all partition table support X-Git-Tag: 174~2328 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=7808297b0fcb5a8033fd2d55854d065d8b1719e8;p=elogind.git volume_id: remove all partition table support --- diff --git a/extras/volume_id/README b/extras/volume_id/README index 640a9e47a..969f301a4 100644 --- a/extras/volume_id/README +++ b/extras/volume_id/README @@ -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 diff --git a/extras/volume_id/libvolume_id/util.c b/extras/volume_id/libvolume_id/util.c index 361d7058d..0ad8ce66b 100644 --- a/extras/volume_id/libvolume_id/util.c +++ b/extras/volume_id/libvolume_id/util.c @@ -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; diff --git a/extras/volume_id/libvolume_id/util.h b/extras/volume_id/libvolume_id/util.h index f6c57fb66..8cb1abd36 100644 --- a/extras/volume_id/libvolume_id/util.h +++ b/extras/volume_id/libvolume_id/util.h @@ -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); diff --git a/extras/volume_id/libvolume_id/volume_id.c b/extras/volume_id/libvolume_id/volume_id.c index fdecf396c..718d74e5b 100644 --- a/extras/volume_id/libvolume_id/volume_id.c +++ b/extras/volume_id/libvolume_id/volume_id.c @@ -1,5 +1,5 @@ /* - * volume_id - reads filesystem label and uuid + * volume_id - reads volume label and uuid * * Copyright (C) 2005 Kay Sievers * @@ -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); } diff --git a/extras/volume_id/libvolume_id/volume_id.h b/extras/volume_id/libvolume_id/volume_id.h index d370bae6c..8ddffc96d 100644 --- a/extras/volume_id/libvolume_id/volume_id.h +++ b/extras/volume_id/libvolume_id/volume_id.h @@ -1,5 +1,5 @@ /* - * volume_id - reads partition label and uuid + * volume_id - reads volume label and uuid * * Copyright (C) 2005 Kay Sievers * @@ -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; diff --git a/extras/volume_id/vol_id.8 b/extras/volume_id/vol_id.8 index 6ffe7ce22..092911ad4 100644 --- a/extras/volume_id/vol_id.8 +++ b/extras/volume_id/vol_id.8 @@ -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