summaryrefslogtreecommitdiff
path: root/extras/volume_id/vol_id.c
diff options
context:
space:
mode:
authorAndrey Borzenkov <arvidjaar@mail.ru>2007-01-21 22:49:45 +0100
committerKay Sievers <kay.sievers@vrfy.org>2007-01-21 22:49:45 +0100
commitede9b541712f0f7366f5481d55f5d56d0e47fcc8 (patch)
tree5cbf3ea85756b8d8878aaed5b66c299724f7f44a /extras/volume_id/vol_id.c
parentbb0f7466a07bfa5968ee2cb25201fba7576dcb2d (diff)
vol_id: add -L to print raw partition label
Diffstat (limited to 'extras/volume_id/vol_id.c')
-rw-r--r--extras/volume_id/vol_id.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/extras/volume_id/vol_id.c b/extras/volume_id/vol_id.c
index 0a1b756fa3..73843ef699 100644
--- a/extras/volume_id/vol_id.c
+++ b/extras/volume_id/vol_id.c
@@ -116,6 +116,7 @@ int main(int argc, char *argv[])
" -t filesystem type\n"
" -l filesystem label\n"
" -u filesystem uuid\n"
+ " -L raw label\n"
" --skip-raid don't probe for raid\n"
" --probe-all find possibly conflicting signatures\n"
" --help\n"
@@ -125,6 +126,7 @@ int main(int argc, char *argv[])
PRINT_TYPE,
PRINT_LABEL,
PRINT_UUID,
+ PRINT_RAW_LABEL,
} print = PRINT_EXPORT;
struct volume_id *vid = NULL;
static char name[VOLUME_ID_LABEL_SIZE];
@@ -153,6 +155,8 @@ int main(int argc, char *argv[])
print = PRINT_LABEL;
} else if (strcmp(arg, "-u") == 0) {
print = PRINT_UUID;
+ } else if (strcmp(arg, "-L") == 0) {
+ print = PRINT_RAW_LABEL;
} else if (strcmp(arg, "--skip-raid") == 0) {
skip_raid = 1;
} else if (strcmp(arg, "--probe-all") == 0) {
@@ -306,6 +310,13 @@ int main(int argc, char *argv[])
}
printf("%s\n", vid->uuid);
break;
+ case PRINT_RAW_LABEL:
+ if (vid->label[0] == '\0' || vid->usage_id == VOLUME_ID_RAID) {
+ rc = 3;
+ goto exit;
+ }
+ printf("%s\n", vid->label);
+ break;
}
exit: