]> err.no Git - util-linux/commitdiff
build-sys: remove use of devmapper library
authorKarel Zak <kzak@redhat.com>
Mon, 8 Dec 2008 14:00:03 +0000 (15:00 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 11 Feb 2009 22:21:50 +0000 (23:21 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
configure.ac
libs/blkid/TODO
libs/blkid/blkid.pc.in
libs/blkid/src/Makefile.am
libs/blkid/src/devname.c

index 25ba67485cbcac7d995955a207ce7362b95ba474..ca1189e88e916dd8c28cefdf572737371fcbc05e 100644 (file)
@@ -642,47 +642,6 @@ else
   esac
 fi
 
-# TODO remove devmapper from blkid
-#
-AC_ARG_ENABLE([blkid-devmapper],
-   AS_HELP_STRING([--enable-blkid-devmapper], [build with device-mapper support]),
-   [], with_blkid-devmapper=no
-)
-if test x$with_devmapper = xno; then
-  AC_MSG_RESULT([Disabling device-mapper support])
-  AM_CONDITIONAL(HAVE_DEVMAPPER, false)
-  DEVMAPPER_LIBS_STATIC=''
-  DEVMAPPER_REQ=''
-  DEVMAPPER_PC_LIBS=''
-  DEVMAPPER_LIBS=''
-else
-  AC_MSG_RESULT([Enabling device-mapper support])
-  UTIL_CHECK_LIB(devmapper, dm_tree_create)
-  case $with_blkid-devmapper:$have_blkid-devmapper in
-  yes:no) AC_MSG_ERROR([devmapper selected but libdevmapper not found]);;
-  esac
-  UTIL_PKG_STATIC([DEVMAPPER_LIBS_STATIC], [devmapper])
-  DEVMAPPER_LIBS="-ldevmapper"
-  DEVMAPPER_REQ="devmapper"
-  DEVMAPPER_PC_LIBS="-ldevmapper"
-
-  # work around stupid devmapper.pc bug in Debian
-  case "$DEVMAPPER_LIBS_STATIC" in
-  *pthread*)
-     ;;
-  *)
-    AC_MSG_WARN([Working around Debian bug 390243...])
-    DEVMAPPER_LIBS_STATIC="-pthread $DEVMAPPER_LIBS_STATIC"
-    ;;
-  esac
-fi
-
-AC_SUBST([DEVMAPPER_LIBS])
-AC_SUBST([DEVMAPPER_REQ])
-AC_SUBST([DEVMAPPER_PC_LIBS])
-AC_SUBST([DEVMAPPER_LIBS_STATIC])
-
-
 AC_ARG_ENABLE([schedutils],
   AS_HELP_STRING([--disable-schedutils], [do not build chrt, ionice, teskset]),
   [], enable_schedutils=yes
index 2c80499653f602b27d1f0ec8408ed3c26e5336dd..ad7c8f94da3539d9d35c11f0f319d1ef9329b123 100644 (file)
@@ -3,6 +3,10 @@
 
  - add hex-encoding from libudev
 
+ - do we really need to depend on libuuid? Maybe the default should be
+   use in-tree code rather and link against libuuid -- especially when we
+   need it for uuid_unparse() only.
+
  - add blkid -o | --format=full|value|udev
 
  - consolidate "getsize" stuff (see getsize.c and lib/blkdev.c)
index db03cc13a519cab9ab82986299b7fef724569c9d..dd58fbb193bfea83a0022691e322449487c8daa6 100644 (file)
@@ -6,7 +6,6 @@ includedir=@includedir@
 Name: blkid
 Description: Block device id library
 Version: @BLKID_VERSION@
-Requires: uuid @DEVMAPPER_REQ@
 Cflags: -I${includedir}
 Libs: -L${libdir} -lblkid
-Libs.private: @DEVMAPPER_PC_LIBS@
+Libs.private: uuid
index a9702b2d578c9d195a9daa1198b7f178d1ac3627..cf43a734f9a56fd0ab95625e5e172d9a4b2ff20e 100644 (file)
@@ -23,9 +23,6 @@ blkid_SONAME = $(blkid_IMAGE).$(BLKID_VERSION_MAJOR)
 blkid_LINKS = $(blkid_IMAGE) $(blkid_SONAME)
 blkid_OTHERLDADD =
 
-if HAVE_DEVMAPPER
-blkid_OTHERLDADD += $(DEVMAPPER_LIBS)
-endif
 if HAVE_UUID
 blkid_OTHERLDADD += -luuid     #TODO $(UUID_LIBS)
 endif
index 79c34135ad71cf807dd352558cafbe00be9beed7..5b1b64becbf8da4e29a12e64e37099f9b6139407 100644 (file)
 
 #include "blkidP.h"
 
-#undef HAVE_DEVMAPPER
-
-#ifdef HAVE_DEVMAPPER
-#include <libdevmapper.h>
-#endif
-
 /*
  * Find a dev struct in the cache by device name, if available.
  *
@@ -120,10 +114,6 @@ blkid_dev blkid_get_dev(blkid_cache cache, const char *devname, int flags)
        return dev;
 }
 
-#ifdef HAVE_DEVMAPPER
-static int dm_device_is_leaf(const dev_t dev);
-#endif
-
 /* Directories where we will try to search for device names */
 static const char *dirlist[] = { "/dev", "/devfs", "/devices", NULL };
 
@@ -142,10 +132,6 @@ static void probe_one(blkid_cache cache, const char *ptname,
        list_for_each_safe(p, pnext, &cache->bic_devs) {
                blkid_dev tmp = list_entry(p, struct blkid_struct_dev,
                                           bid_devs);
-#ifdef HAVE_DEVMAPPER
-               if (!dm_device_is_leaf(devno))
-                       continue;
-#endif
                if (tmp->bid_devno == devno) {
                        if (only_if_new && !access(tmp->bid_name, F_OK))
                                return;
@@ -202,183 +188,6 @@ set_pri:
        return;
 }
 
-#ifdef HAVE_DEVMAPPER
-static void dm_quiet_log(int level __BLKID_ATTR((unused)),
-                        const char *file __BLKID_ATTR((unused)),
-                        int line __BLKID_ATTR((unused)),
-                        const char *f __BLKID_ATTR((unused)), ...)
-{
-       return;
-}
-
-/*
- * device-mapper support
- */
-static int dm_device_has_dep(const dev_t dev, const char *name)
-{
-       struct dm_task *task;
-       struct dm_deps *deps;
-       struct dm_info info;
-       unsigned int i;
-       int ret = 0;
-
-       task = dm_task_create(DM_DEVICE_DEPS);
-       if (!task)
-               goto out;
-
-       if (!dm_task_set_name(task, name))
-               goto out;
-
-       if (!dm_task_run(task))
-               goto out;
-
-       if (!dm_task_get_info(task, &info))
-               goto out;
-
-       if  (!info.exists)
-               goto out;
-
-       deps = dm_task_get_deps(task);
-       if (!deps || deps->count == 0)
-               goto out;
-
-       for (i = 0; i < deps->count; i++) {
-               dev_t dep_dev = deps->device[i];
-
-               if (dev == dep_dev) {
-                       ret = 1;
-                       goto out;
-               }
-       }
-
-out:
-       if (task)
-               dm_task_destroy(task);
-
-       return ret;
-}
-
-static int dm_device_is_leaf(const dev_t dev)
-{
-       struct dm_task *task;
-       struct dm_names *names;
-       unsigned int next = 0;
-       int n, ret = 1;
-
-       dm_log_init(dm_quiet_log);
-       task = dm_task_create(DM_DEVICE_LIST);
-       if (!task)
-               goto out;
-
-       dm_log_init(0);
-
-       if (!dm_task_run(task))
-               goto out;
-
-       names = dm_task_get_names(task);
-       if (!names || !names->dev)
-               goto out;
-
-       n = 0;
-       do {
-               names = (struct dm_names *) ((char *)names + next);
-
-               if (dm_device_has_dep(dev, names->name))
-                       ret = 0;
-
-               next = names->next;
-       } while (next);
-
-out:
-       if (task)
-               dm_task_destroy(task);
-
-       return ret;
-}
-
-static dev_t dm_get_devno(const char *name)
-{
-       struct dm_task *task;
-       struct dm_info info;
-       dev_t ret = 0;
-
-       task = dm_task_create(DM_DEVICE_INFO);
-       if (!task)
-               goto out;
-
-       if (!dm_task_set_name(task, name))
-               goto out;
-
-       if (!dm_task_run(task))
-               goto out;
-
-       if (!dm_task_get_info(task, &info))
-               goto out;
-
-       if (!info.exists)
-               goto out;
-
-       ret = makedev(info.major, info.minor);
-
-out:
-       if (task)
-               dm_task_destroy(task);
-
-       return ret;
-}
-
-static void dm_probe_all(blkid_cache cache, int only_if_new)
-{
-       struct dm_task *task;
-       struct dm_names *names;
-       unsigned int next = 0;
-       int n;
-
-       dm_log_init(dm_quiet_log);
-       task = dm_task_create(DM_DEVICE_LIST);
-       if (!task)
-               goto out;
-       dm_log_init(0);
-
-       if (!dm_task_run(task))
-               goto out;
-
-       names = dm_task_get_names(task);
-       if (!names || !names->dev)
-               goto out;
-
-       n = 0;
-       do {
-               int rc;
-               char *device = NULL;
-               dev_t dev = 0;
-
-               names = (struct dm_names *) ((char *)names + next);
-
-               rc = asprintf(&device, "mapper/%s", names->name);
-               if (rc < 0)
-                       goto try_next;
-
-               dev = dm_get_devno(names->name);
-               if (dev == 0)
-                       goto try_next;
-
-               if (!dm_device_is_leaf(dev))
-                       goto try_next;
-
-               probe_one(cache, device, dev, BLKID_PRI_DM, only_if_new);
-
-try_next:
-               free(device);
-               next = names->next;
-       } while (next);
-
-out:
-       if (task)
-               dm_task_destroy(task);
-}
-#endif /* HAVE_DEVMAPPER */
-
 #define PROC_PARTITIONS "/proc/partitions"
 #define VG_DIR         "/proc/lvm/VGs"
 
@@ -532,9 +341,6 @@ static int probe_all(blkid_cache cache, int only_if_new)
                return 0;
 
        blkid_read_cache(cache);
-#ifdef HAVE_DEVMAPPER
-       dm_probe_all(cache, only_if_new);
-#endif
        evms_probe_all(cache, only_if_new);
 #ifdef VG_DIR
        lvm_probe_all(cache, only_if_new);