summaryrefslogtreecommitdiff
path: root/extras/multipath-tools/devmap_name
diff options
context:
space:
mode:
authorgreg@kroah.com <greg@kroah.com>2004-10-06 18:32:41 -0700
committerGreg KH <gregkh@suse.de>2005-04-26 21:37:03 -0700
commit71144b744acb191d357dbfeb85a256389d4fac3b (patch)
tree15aa6e4ccb9b51c25e14a2b2cfe1c9f278e73f68 /extras/multipath-tools/devmap_name
parent33eae955e24feb2e473b905d64de17ad641e57e0 (diff)
[PATCH] delete extras/multipath-tools as per the author's request
This is now a standalone package.
Diffstat (limited to 'extras/multipath-tools/devmap_name')
-rw-r--r--extras/multipath-tools/devmap_name/Makefile49
-rw-r--r--extras/multipath-tools/devmap_name/devmap_name.830
-rw-r--r--extras/multipath-tools/devmap_name/devmap_name.c60
3 files changed, 0 insertions, 139 deletions
diff --git a/extras/multipath-tools/devmap_name/Makefile b/extras/multipath-tools/devmap_name/Makefile
deleted file mode 100644
index e3b70a5e0d..0000000000
--- a/extras/multipath-tools/devmap_name/Makefile
+++ /dev/null
@@ -1,49 +0,0 @@
-# Makefile
-#
-# Copyright (C) 2003 Christophe Varoqui, <christophe.varoqui@free.fr>
-
-EXEC = devmap_name
-
-prefix =
-exec_prefix = ${prefix}
-bindir = ${exec_prefix}/sbin
-udevdir = ../../..
-klibcdir = $(udevdir)/klibc
-mandir = /usr/share/man/man8
-libdmdir = ../libdevmapper
-
-CC = gcc
-GZIP = /bin/gzip -9 -c
-
-GCCINCDIR := ${shell $(CC) -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp"}
-KERNEL_DIR = /lib/modules/${shell uname -r}/build
-CFLAGS = -pipe -g -O2 -Wall -Wunused -Wstrict-prototypes -nostdinc \
- -I$(klibcdir)/klibc/include -I$(klibcdir)/klibc/include/bits32 \
- -I$(GCCINCDIR) -I$(KERNEL_DIR)/include -I$(sysfsdir) -I.
-
-OBJS = devmap_name.o
-CRT0 = $(klibcdir)/klibc/crt0.o
-LIB = $(klibcdir)/klibc/libc.a
-LIBGCC := $(shell $(CC) -print-libgcc-file-name )
-
-DMOBJS = $(libdmdir)/libdm-common.o $(libdmdir)/ioctl/libdevmapper.o
-
-$(EXEC): $(OBJS)
- $(LD) -o $(EXEC) $(CRT0) $(OBJS) $(DMOBJS) $(LIB) $(LIBGCC)
- strip $(EXEC)
- $(GZIP) $(EXEC).8 > $(EXEC).8.gz
-
-clean:
- rm -f core *.o $(EXEC) *.gz
-
-spotless: clean
-
-install:
- install -d $(DESTDIR)$(bindir)
- install -m 755 $(EXEC) $(DESTDIR)$(bindir)/
- install -d $(DESTDIR)$(mandir)
- install -m 644 $(EXEC).8.gz $(DESTDIR)$(mandir)
-
-uninstall:
- rm $(DESTDIR)$(bindir)/$(EXEC)
- rm $(DESTDIR)$(mandir)/$(EXEC).8.gz
diff --git a/extras/multipath-tools/devmap_name/devmap_name.8 b/extras/multipath-tools/devmap_name/devmap_name.8
deleted file mode 100644
index f4f03c3ec6..0000000000
--- a/extras/multipath-tools/devmap_name/devmap_name.8
+++ /dev/null
@@ -1,30 +0,0 @@
-.TH DEVMAP_NAME 8 "February 2004" "" "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/extras/multipath-tools/devmap_name/devmap_name.c b/extras/multipath-tools/devmap_name/devmap_name.c
deleted file mode 100644
index 0932e4f8bb..0000000000
--- a/extras/multipath-tools/devmap_name/devmap_name.c
+++ /dev/null
@@ -1,60 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <linux/kdev_t.h>
-
-#include "../libdevmapper/libdevmapper.h"
-
-static void usage(char * progname) {
- fprintf(stderr, "usage : %s major minor\n", progname);
- exit(1);
-}
-
-int main(int argc, char **argv)
-{
- int r = 0;
- struct dm_names *names;
- unsigned next = 0;
- int major, minor;
-
- /* sanity check */
- if (argc != 3)
- usage(argv[0]);
-
- major = atoi(argv[1]);
- minor = atoi(argv[2]);
-
- struct dm_task *dmt;
-
- if (!(dmt = dm_task_create(DM_DEVICE_LIST)))
- return 0;
-
- if (!dm_task_run(dmt))
- goto out;
-
- if (!(names = dm_task_get_names(dmt)))
- goto out;
-
- if (!names->dev) {
- printf("No devices found\n");
- goto out;
- }
-
- do {
- names = (void *) names + next;
- if ((int) MAJOR(names->dev) == major &&
- (int) MINOR(names->dev) == minor) {
- printf("%s\n", names->name);
- goto out;
- }
- next = names->next;
- } while (next);
-
- /* No correspondance found */
- r = 1;
-
- out:
- dm_task_destroy(dmt);
- return r;
-}
-