]> err.no Git - util-linux/commitdiff
mount: (and fsck) remove libvolume_id support
authorKarel Zak <kzak@redhat.com>
Tue, 19 May 2009 11:52:43 +0000 (13:52 +0200)
committerKarel Zak <kzak@redhat.com>
Fri, 22 May 2009 08:06:15 +0000 (10:06 +0200)
The libvolume_id is deprecated in favor of libblkid. The libblkid from
u-l-ng provides the same functionality as libvolume_id.

Signed-off-by: Karel Zak <kzak@redhat.com>
fsck/Makefile.am
lib/fsprobe.c
mount/Makefile.am

index abe6d5c3fdd451f0558987633efe844b41b6c176..567fee8b4d3e27d7eddc84e2943a928a38b95e73 100644 (file)
@@ -8,7 +8,6 @@ fsck_SOURCES = base_device.c fsck.c fsck.h ../lib/ismounted.c \
 fsck_LDADD =
 fsck_CFLAGS =
 
-if HAVE_BLKID
 if BUILD_LIBBLKID
 fsck_LDADD += $(ul_libblkid_la)
 fsck_CFLAGS += -I$(ul_libblkid_srcdir)
@@ -16,9 +15,3 @@ else
 fsck_LDADD += $(BLKID_LIBS)
 fsck_CFLAGS += $(BLKID_CFLAGS)
 endif
-endif
-
-if HAVE_VOLUME_ID
-fsck_LDADD += $(VOLUME_ID_LIBS)
-fsck_CFLAGS += $(VOLUME_ID_CFLAGS)
-endif
index c5fa8c63b99317f595685ead802367db05b8656f..0f5a4ac09614d69ea9a3ea3d116ce9c4a03fa807 100644 (file)
@@ -18,7 +18,9 @@
 #include "pathnames.h"
 #include "fsprobe.h"
 
-#if defined(HAVE_BLKID_EVALUATE_TAG) || defined(HAVE_LIBVOLUME_ID)
+static blkid_cache blcache;
+
+#ifdef HAVE_BLKID_EVALUATE_TAG
 /* ask kernel developers why we need such ugly open() method... */
 static int
 open_device(const char *devname)
@@ -101,9 +103,6 @@ fsprobe_get_devname_by_spec(const char *spec)
        return canonicalize_path(spec);
 }
 
-#ifdef HAVE_LIBBLKID
-static blkid_cache blcache;
-
 void
 fsprobe_init(void)
 {
@@ -266,129 +265,3 @@ fsprobe_get_uuid_by_devname(const char *devname)
 }
 
 #endif /* !HAVE_BLKID_EVALUATE_TAG */
-#else  /* !HAVE_LIBBLKID */
-
-/*
- * libvolume_id from udev
- * -- deprecated
- */
-#include <libvolume_id.h>
-
-enum probe_type {
-       VOLUME_ID_NONE,
-       VOLUME_ID_LABEL,
-       VOLUME_ID_UUID,
-       VOLUME_ID_TYPE,
-};
-
-static char
-*probe(const char *device, enum probe_type type)
-{
-       int fd;
-       uint64_t size;
-       struct volume_id *id;
-       const char *val;
-       char *value = NULL;
-       int retries = 0;
-
-       fd = open_device(devname);
-       if (fd < 0)
-               return NULL;
-       id = volume_id_open_fd(fd);
-       if (!id) {
-               close(fd);
-               return NULL;
-       }
-       if (blkdev_get_size(fd, &size) != 0)
-               size = 0;
-       if (volume_id_probe_all(id, 0, size) == 0) {
-               switch(type) {
-               case VOLUME_ID_LABEL:
-                       if (volume_id_get_label(id, &val))
-                               value  = strdup(val);
-                       break;
-               case VOLUME_ID_UUID:
-                       if (volume_id_get_uuid(id, &val))
-                               value  = strdup(val);
-                       break;
-               case VOLUME_ID_TYPE:
-                       if (volume_id_get_type(id, &val))
-                               value  = strdup(val);
-                       break;
-               default:
-                       break;
-               }
-       }
-       volume_id_close(id);
-       close(fd);
-       return value;
-}
-
-void
-fsprobe_init(void)
-{
-}
-
-void
-fsprobe_exit(void)
-{
-}
-
-int
-fsprobe_known_fstype(const char *fstype)
-{
-       if (volume_id_get_prober_by_type(fstype) != NULL)
-               return 1;
-       return 0;
-}
-
-char *
-fsprobe_get_uuid_by_devname(const char *devname)
-{
-       return probe(devname, VOLUME_ID_UUID);
-}
-
-char *
-fsprobe_get_label_by_devname(const char *devname)
-{
-       return probe(devname, VOLUME_ID_LABEL);
-}
-
-char *
-fsprobe_get_fstype_by_devname(const char *devname)
-{
-       return probe(devname, VOLUME_ID_TYPE);
-}
-
-char *
-fsprobe_get_devname_by_uuid(const char *uuid)
-{
-       char dev[PATH_MAX];
-       size_t len;
-
-       if (!uuid)
-               return NULL;
-
-       strcpy(dev, _PATH_DEV_BYUUID "/");
-       len = strlen(_PATH_DEV_BYUUID "/");
-       if (!volume_id_encode_string(uuid, &dev[len], sizeof(dev) - len))
-               return NULL;
-       return canonicalize_path(dev);
-}
-
-char *
-fsprobe_get_devname_by_label(const char *label)
-{
-       char dev[PATH_MAX];
-       size_t len;
-
-       if (!label)
-               return NULL;
-       strcpy(dev, _PATH_DEV_BYLABEL "/");
-       len = strlen(_PATH_DEV_BYLABEL "/");
-       if (!volume_id_encode_string(label, &dev[len], sizeof(dev) - len))
-               return NULL;
-       return canonicalize_path(dev);
-}
-
-#endif /* HAVE_LIBVOLUME_ID  */
index 7714efbcf97c938bdfd754aa6ffdc1f7e51d8a14..b0e63740b09ee0517a5d694aeefeb0354eeface3 100644 (file)
@@ -71,7 +71,6 @@ losetup_static_LDFLAGS = $(ldflags_static)
 losetup_static_CPPFLAGS = -DMAIN $(AM_CPPFLAGS)
 endif
 
-if HAVE_BLKID
 if BUILD_LIBBLKID
 ldadd_common += $(ul_libblkid_la)
 ldadd_static += $(ul_libblkid_la)
@@ -81,13 +80,6 @@ ldadd_common += $(BLKID_LIBS)
 ldadd_static += $(BLKID_LIBS_STATIC)
 cflags_common += $(BLKID_CFLAGS)
 endif
-endif
-
-if HAVE_VOLUME_ID
-ldadd_common += $(VOLUME_ID_LIBS)
-ldadd_static += $(VOLUME_ID_LIBS_STATIC)
-cflags_common += $(VOLUME_ID_CFLAGS)
-endif
 
 if HAVE_SELINUX
 mount_LDADD += $(SELINUX_LIBS)