aboutsummaryrefslogtreecommitdiff
path: root/util-linux/volume_id
diff options
context:
space:
mode:
Diffstat (limited to 'util-linux/volume_id')
-rw-r--r--util-linux/volume_id/Kbuild1
-rw-r--r--util-linux/volume_id/get_devname.c17
2 files changed, 10 insertions, 8 deletions
diff --git a/util-linux/volume_id/Kbuild b/util-linux/volume_id/Kbuild
index 54b95f0c7..d78e4ada5 100644
--- a/util-linux/volume_id/Kbuild
+++ b/util-linux/volume_id/Kbuild
@@ -6,6 +6,7 @@
lib-y:=
+lib-$(CONFIG_BLKID) += get_devname.o
lib-$(CONFIG_FINDFS) += get_devname.o
lib-$(CONFIG_FEATURE_MOUNT_LABEL) += get_devname.o
diff --git a/util-linux/volume_id/get_devname.c b/util-linux/volume_id/get_devname.c
index f9a2c905f..83c085650 100644
--- a/util-linux/volume_id/get_devname.c
+++ b/util-linux/volume_id/get_devname.c
@@ -374,24 +374,25 @@ get_spec_by_volume_label(const char *s, int *major, int *minor)
{
return get_spec_by_x(VOL, s, major, minor);
}
+#endif // UNUSED
-static int display_uuid_cache(void)
+/* Used by blkid */
+void display_uuid_cache(void)
{
struct uuidCache_s *u;
- size_t i;
uuidcache_init();
-
u = uuidCache;
while (u) {
- printf("%s %s %s\n", u->device, u->label, u->uc_uuid);
+ printf("%s:", u->device);
+ if (u->label[0])
+ printf(" LABEL=\"%s\"", u->label);
+ if (u->uc_uuid[0])
+ printf(" UUID=\"%s\"", u->uc_uuid);
+ bb_putchar('\n');
u = u->next;
}
-
- return 0;
}
-#endif // UNUSED
-
/* Used by mount and findfs */