Remove devmap_name tool, redundant with dmsetup
authorChristophe Varoqui <christophe.varoqui@free.fr>
Thu, 17 Apr 2008 21:05:29 +0000 (23:05 +0200)
committerChristophe Varoqui <christophe.varoqui@free.fr>
Thu, 17 Apr 2008 21:05:29 +0000 (23:05 +0200)
Makefile
devmap_name/Makefile [deleted file]
devmap_name/devmap_name.8 [deleted file]
devmap_name/devmap_name.c [deleted file]
multipath-tools.spec.in
multipath/02_multipath

index a099daf..54be0a5 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -25,7 +25,6 @@ BUILDDIRS = \
        libmultipath/checkers \
        multipath \
        multipathd \
-       devmap_name \
        kpartx
 
 ifeq   ($(MULTIPATH_VERSION),)
diff --git a/devmap_name/Makefile b/devmap_name/Makefile
deleted file mode 100644 (file)
index a167537..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-# Makefile
-#
-# Copyright (C) 2003 Christophe Varoqui, <christophe.varoqui@free.fr>
-#
-include ../Makefile.inc
-
-EXEC = devmap_name
-OBJS = devmap_name.o
-
-LDFLAGS = -ldevmapper
-
-all: $(EXEC)
-
-$(EXEC): $(OBJS)
-       $(CC) $(OBJS) -o $(EXEC) $(LDFLAGS)
-       $(GZIP) $(EXEC).8 > $(EXEC).8.gz
-
-install: $(EXEC) $(EXEC).8
-       $(INSTALL_PROGRAM) -d $(DESTDIR)$(bindir)
-       $(INSTALL_PROGRAM) -m 755 $(EXEC) $(DESTDIR)$(bindir)/
-       $(INSTALL_PROGRAM) -d $(DESTDIR)$(mandir)
-       $(INSTALL_PROGRAM) -m 644 $(EXEC).8.gz $(DESTDIR)$(mandir)
-
-uninstall:
-       rm $(DESTDIR)$(bindir)/$(EXEC)
-       rm $(DESTDIR)$(mandir)/$(EXEC).8.gz
-
-clean:
-       rm -f core *.o $(EXEC) *.gz
diff --git a/devmap_name/devmap_name.8 b/devmap_name/devmap_name.8
deleted file mode 100644 (file)
index 86d0931..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-.TH DEVMAP_NAME 8 "July 2006" "" "Linux Administrator's Manual"
-.SH NAME
-devmap_name \- Query device-mapper name
-.SH SYNOPSIS
-.BI devmap_name " major minor"
-.SH DESCRIPTION
-.B devmap_name
-queries the device-mapper for the name for the device
-specified by
-.I major
-and
-.I minor
-number.
-.br
-.B devmap_name
-can be called from
-.B udev
-by the following rule in
-.IR /etc/udev/udev.rules :
-.sp
-.nf
-KERNEL="dm-[0-9]*", PROGRAM="/sbin/devmap_name %M %m", \\
-       NAME="%k", SYMLINK="%c"
-.fi
-.SH "SEE ALSO"
-.BR udev (8),
-.BR dmsetup (8)
-.SH AUTHORS
-.B devmap_name
-was developed by Christophe Varoqui, <christophe.varoqui@free.fr> and others.
diff --git a/devmap_name/devmap_name.c b/devmap_name/devmap_name.c
deleted file mode 100644 (file)
index 525c348..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright (c) 2004, 2005 Christophe Varoqui
- */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <unistd.h>
-#include <linux/kdev_t.h>
-#include <libdevmapper.h>
-
-static void usage(char * progname) {
-       fprintf(stderr, "usage : %s [-t target type] dev_t\n", progname);
-       fprintf(stderr, "where dev_t is either 'major minor' or 'major:minor'\n");
-       exit(1);
-}
-
-int dm_target_type(int major, int minor, char *type)
-{
-       struct dm_task *dmt;
-       void *next = NULL;
-       uint64_t start, length;
-       char *target_type = NULL;
-       char *params;
-       int r = 1;
-
-       if (!(dmt = dm_task_create(DM_DEVICE_STATUS)))
-               return 1;
-
-       if (!dm_task_set_major(dmt, major) ||
-           !dm_task_set_minor(dmt, minor))
-               goto bad;
-
-       dm_task_no_open_count(dmt);
-
-       if (!dm_task_run(dmt))
-               goto bad;
-
-       if (!type)
-               goto good;
-
-       do {
-               next = dm_get_next_target(dmt, next, &start, &length,
-                                         &target_type, &params);
-               if (target_type && strcmp(target_type, type))
-                       goto bad;
-       } while (next);
-
-good:
-       printf("%s\n", dm_task_get_name(dmt));
-       r = 0;
-bad:
-       dm_task_destroy(dmt);
-       return r;
-}
-
-int main(int argc, char **argv)
-{
-       int c;
-       int major, minor;
-       char *target_type = NULL;
-
-       while ((c = getopt(argc, argv, "t:")) != -1) {
-               switch (c) {
-               case 't':
-                       target_type = optarg;
-                       break;
-               default:
-                       usage(argv[0]);
-                       return 1;
-                       break;
-               }
-       }
-
-       /* sanity check */
-       if (optind == argc - 2) {
-               major = atoi(argv[argc - 2]);
-               minor = atoi(argv[argc - 1]);
-       } else if (optind != argc - 1 ||
-                  2 != sscanf(argv[argc - 1], "%i:%i", &major, &minor))
-               usage(argv[0]);
-
-       if (dm_target_type(major, minor, target_type))
-               return 1;
-                                                                                
-       return 0;
-}
-
index 3caede6..e2664c8 100644 (file)
@@ -22,7 +22,6 @@ are :
 * multipath :   scan the system for multipathed devices, assembles them
                 and update the device-mapper's maps
 * multipathd :  wait for maps events, then execs multipath
-* devmap-name : provides a meaningful device name to udev for devmaps
 * kpartx :      maps linear devmaps upon device partitions, which makes
                 multipath maps partionable
 
@@ -41,7 +40,6 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(-,root,root,-)
-%{prefix}/sbin/devmap_name
 %{prefix}/sbin/multipath
 %{prefix}/sbin/kpartx
 %{prefix}/sbin/mpath_prio_alua
@@ -51,7 +49,6 @@ rm -rf $RPM_BUILD_ROOT
 %{prefix}/sbin/mpath_prio_netapp
 %{prefix}/sbin/mpath_prio_rdac
 %{prefix}/sbin/mpath_prio_hds_modular
-%{prefix}/usr/share/man/man8/devmap_name.8.gz
 %{prefix}/usr/share/man/man8/multipath.8.gz
 %{prefix}/usr/share/man/man8/kpartx.8.gz
 %{prefix}/usr/share/man/man8/mpath_prio_alua.8.gz
index 067c582..467a7cb 100755 (executable)
@@ -5,7 +5,6 @@
 # this tool is statically linked against klibc : no additional libs
 #
 cp /sbin/multipath $INITRDDIR/sbin
-cp /sbin/devmap_name $INITRDDIR/sbin
 cp /sbin/kpartx $INITRDDIR/sbin
 
 #