summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlasdair Kergon <agk@redhat.com>2008-11-01 02:19:19 +0000
committerAlasdair Kergon <agk@redhat.com>2008-11-01 02:19:19 +0000
commit0782ad5002b303ae2b8e353509102b4822927ea8 (patch)
tree07b0ce62834553fce753429b078ebbadc1292b3a
parentf58b35b5a43db3fb2a20507fe3003f42eaeec5b4 (diff)
downloadlvm2-0782ad5002b303ae2b8e353509102b4822927ea8.tar.gz
lvm2-0782ad5002b303ae2b8e353509102b4822927ea8.tar.xz
lvm2-0782ad5002b303ae2b8e353509102b4822927ea8.zip
further progress
-rw-r--r--Makefile.in7
-rw-r--r--configure.in18
-rw-r--r--include/Makefile.in2
-rw-r--r--lib/misc/configure.h.in3
-rw-r--r--lib/misc/lib.h8
-rw-r--r--libdm/Makefile.in4
-rw-r--r--libdm/ioctl/libdm-compat.h2
-rw-r--r--libdm/ioctl/libdm-iface.c2
-rw-r--r--libdm/libdm-common.c3
-rw-r--r--libdm/libdm-deptree.c3
-rw-r--r--make.tmpl.in14
-rw-r--r--man/Makefile.in4
-rw-r--r--po/Makefile.in48
-rw-r--r--scripts/Makefile.in3
-rw-r--r--tools/Makefile.in13
15 files changed, 107 insertions, 27 deletions
diff --git a/Makefile.in b/Makefile.in
index 923d13f5..988af270 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -22,7 +22,7 @@ ifeq ("@INTL@", "yes")
SUBDIRS += po
endif
-SUBDIRS += lib tools daemons
+SUBDIRS += lib tools daemons libdm
ifeq ($(MAKECMDGOALS),distclean)
SUBDIRS += daemons/clvmd \
@@ -40,11 +40,14 @@ endif
include make.tmpl
+libdm: include
+lib: libdm
daemons: lib
-lib: include
tools: lib
po: tools daemons
+tools.device-mapper: libdm.device-mapper
+
ifeq ("@INTL@", "yes")
lib.pofile: include.pofile
tools.pofile: lib.pofile
diff --git a/configure.in b/configure.in
index 232ebf41..8b34f3e1 100644
--- a/configure.in
+++ b/configure.in
@@ -160,6 +160,24 @@ if test x$GROUP != x; then
fi
################################################################################
+dnl -- Setup device node ownership
+AC_MSG_CHECKING(device node uid)
+
+AC_ARG_WITH(device-uid,
+ [ --with-device-uid=UID Set the owner used for new device nodes [[UID=0]] ],
+ [ DM_DEVICE_UID="$withval" ], [ DM_DEVICE_UID="0" ] )
+AC_MSG_RESULT($DM_DEVICE_UID)
+
+################################################################################
+dnl -- Setup device group ownership
+AC_MSG_CHECKING(device node gid)
+
+AC_ARG_WITH(device-gid,
+ [ --with-device-gid=UID Set the group used for new device nodes [[GID=0]] ],
+ [ DM_DEVICE_GID="$withval" ], [ DM_DEVICE_GID="0" ] )
+AC_MSG_RESULT($DM_DEVICE_GID)
+
+################################################################################
dnl -- Setup device mode
AC_MSG_CHECKING(device node mode)
diff --git a/include/Makefile.in b/include/Makefile.in
index f3a3a7aa..6e52e70b 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -35,6 +35,8 @@ distclean:
pofile: all
+device-mapper: all
+
clean:
install:
diff --git a/lib/misc/configure.h.in b/lib/misc/configure.h.in
index c5980313..f469d95b 100644
--- a/lib/misc/configure.h.in
+++ b/lib/misc/configure.h.in
@@ -26,6 +26,9 @@
/* Path to dmeventd pidfile. */
#undef DMEVENTD_PIDFILE
+/* Library version */
+#undef DM_LIB_VERSION
+
/* Define to 1 if you have `alloca', as a function or macro. */
#undef HAVE_ALLOCA
diff --git a/lib/misc/lib.h b/lib/misc/lib.h
index 0b2985ee..969ddc8a 100644
--- a/lib/misc/lib.h
+++ b/lib/misc/lib.h
@@ -26,11 +26,17 @@
#define _FILE_OFFSET_BITS 64
#include "intl.h"
+#include "libdevmapper.h"
#include "lvm-logging.h"
#include "lvm-types.h"
#include "lvm-wrappers.h"
#include "util.h"
-#include <libdevmapper.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/stat.h>
#endif
diff --git a/libdm/Makefile.in b/libdm/Makefile.in
index 12d37a63..d68c183c 100644
--- a/libdm/Makefile.in
+++ b/libdm/Makefile.in
@@ -32,7 +32,7 @@ SOURCES =\
regex/ttree.c \
$(interface)/libdm-iface.c
-INCLUDES = -I$(interface)
+INCLUDES = -I$(interface) -I.
LIB_STATIC = $(interface)/libdevmapper.a
@@ -48,6 +48,8 @@ DEFS += -DDM_DEVICE_UID=@DM_DEVICE_UID@ -DDM_DEVICE_GID=@DM_DEVICE_GID@ \
include ../make.tmpl
+device-mapper: all
+
.PHONY: install_dynamic install_static install_include \
install_ioctl install_ioctl_static \
install_pkgconfig
diff --git a/libdm/ioctl/libdm-compat.h b/libdm/ioctl/libdm-compat.h
index d5d302f4..5ba63ce7 100644
--- a/libdm/ioctl/libdm-compat.h
+++ b/libdm/ioctl/libdm-compat.h
@@ -17,8 +17,8 @@
#define _LINUX_LIBDM_COMPAT_H
#include "kdev_t.h"
+#include "dm-ioctl.h"
#include <inttypes.h>
-#include <linux/dm-ioctl.h>
#include <sys/ioctl.h>
struct dm_task;
diff --git a/libdm/ioctl/libdm-iface.c b/libdm/ioctl/libdm-iface.c
index 7366f08b..270abb94 100644
--- a/libdm/ioctl/libdm-iface.c
+++ b/libdm/ioctl/libdm-iface.c
@@ -35,7 +35,7 @@
# define MKDEV(x,y) makedev((x),(y))
#endif
-#include <linux/dm-ioctl.h>
+#include "dm-ioctl.h"
/*
* Ensure build compatibility.
diff --git a/libdm/libdm-common.c b/libdm/libdm-common.c
index 610bd453..3efd2282 100644
--- a/libdm/libdm-common.c
+++ b/libdm/libdm-common.c
@@ -18,14 +18,13 @@
#include "libdm-common.h"
#include "list.h"
#include "kdev_t.h"
+#include "dm-ioctl.h"
#include <stdarg.h>
#include <sys/param.h>
#include <sys/ioctl.h>
#include <fcntl.h>
-#include <linux/dm-ioctl.h>
-
#ifdef linux
# include <linux/fs.h>
#endif
diff --git a/libdm/libdm-deptree.c b/libdm/libdm-deptree.c
index 4b587657..1b757f52 100644
--- a/libdm/libdm-deptree.c
+++ b/libdm/libdm-deptree.c
@@ -17,12 +17,11 @@
#include "libdm-common.h"
#include "list.h"
#include "kdev_t.h"
+#include "dm-ioctl.h"
#include <stdarg.h>
#include <sys/param.h>
-#include <linux/dm-ioctl.h>
-
#define MAX_TARGET_PARAMSIZE 500000
/* FIXME Fix interface so this is used only by LVM */
diff --git a/make.tmpl.in b/make.tmpl.in
index c5bd2c95..fe75bba3 100644
--- a/make.tmpl.in
+++ b/make.tmpl.in
@@ -109,12 +109,15 @@ DEPS = $(top_srcdir)/make.tmpl $(top_srcdir)/VERSION Makefile $(INC_LNS)
OBJECTS = $(SOURCES:%.c=%.o)
POTFILES = $(SOURCES:%.c=%.pot)
-.PHONY: all install install_cluster pofile distclean clean cflow
+.PHONY: all install install_cluster pofile distclean clean cflow device-mapper
.PHONY: $(SUBDIRS) $(SUBDIRS.install) $(SUBDIRS.clean) $(SUBDIRS.distclean)
.PHONY: $(SUBDIRS.pofile) $(SUBDIRS.install_cluster) $(SUBDIRS.cflow)
+.PHONY: $(SUBDIRS.device-mapper) $(SUBDIRS.install-device-mapper)
+SUBDIRS.device-mapper := $(SUBDIRS:=.device-mapper)
SUBDIRS.install := $(SUBDIRS:=.install)
SUBDIRS.install_cluster := $(SUBDIRS:=.install_cluster)
+SUBDIRS.install_device-mapper := $(SUBDIRS:=.install_device-mapper)
SUBDIRS.pofile := $(SUBDIRS:=.pofile)
SUBDIRS.cflow := $(SUBDIRS:=.cflow)
SUBDIRS.clean := $(SUBDIRS:=.clean)
@@ -124,18 +127,27 @@ TARGETS += $(LIB_SHARED) $(LIB_STATIC)
all: $(SUBDIRS) $(TARGETS)
+device-mapper: $(SUBDIRS.device-mapper)
+
install: all $(SUBDIRS.install)
install_cluster: all $(SUBDIRS.install_cluster)
+install_device-mapper: $(SUBDIRS.install_device-mapper)
$(SUBDIRS):
$(MAKE) -C $@
+$(SUBDIRS.device-mapper):
+ $(MAKE) -C $(@:.device-mapper=) device-mapper
+
$(SUBDIRS.install): $(SUBDIRS)
$(MAKE) -C $(@:.install=) install
$(SUBDIRS.install_cluster): $(SUBDIRS)
$(MAKE) -C $(@:.install_cluster=) install_cluster
+$(SUBDIRS.install_device-mapper): $(SUBDIRS)
+ $(MAKE) -C $(@:.install_device-mapper=) install_device-mapper
+
$(SUBDIRS.clean):
-$(MAKE) -C $(@:.clean=) clean
diff --git a/man/Makefile.in b/man/Makefile.in
index aca79247..3cfd11f6 100644
--- a/man/Makefile.in
+++ b/man/Makefile.in
@@ -35,7 +35,7 @@ MAN8CLUSTER=clvmd.8
MAN5DIR=${mandir}/man5
MAN8DIR=${mandir}/man8
-CLEAN_TARGETS=$(MAN5) $(MAN8) $(MAN8CLUSTER) $(FSADMMAN)
+CLEAN_TARGETS=$(MAN5) $(MAN8) $(MAN8CLUSTER) $(FSADMMAN) dmsetup.8
include $(top_srcdir)/make.tmpl
@@ -47,6 +47,8 @@ all: man
.PHONY: man
+device-mapper: dmsetup.8
+
man: $(MAN5) $(MAN8) $(MAN8CLUSTER)
$(MAN5) $(MAN8) $(MAN8CLUSTER): Makefile
diff --git a/po/Makefile.in b/po/Makefile.in
index d4dba36f..64e882fd 100644
--- a/po/Makefile.in
+++ b/po/Makefile.in
@@ -17,22 +17,16 @@ VPATH = @srcdir@
LANGS=de
-TARGETS=$(LANGS:%=%.mo)
+TARGETS=$(LANGS:%=lvm2_%.mo) $(LANGS:%=dm_%.mo)
-include $(top_srcdir)/make.tmpl
+DM_POSOURCES = $(top_srcdir)/dmsetup/*.pot $(top_srcdir)/libdm/*.pot \
+ $(top_srcdir)/libdm/*/*.pot
-install: $(TARGETS)
- @echo Installing translation files in $(localedir)
- @( \
- for lang in $(LANGS); do \
- $(INSTALL) -D $(OWNER) $(GROUP) -m 444 $$lang.mo \
- $(localedir)/$$lang/LC_MESSAGES/@INTL_PACKAGE@.mo;\
- done; \
- )
+LVM_POSOURCES = $(top_srcdir)/tools/*.pot $(top_srcdir)/lib/*/*.pot
-pofile: lvm2.po
+include $(top_srcdir)/make.tmpl
-lvm2.po: Makefile $(top_srcdir)/tools/*.pot $(top_srcdir)/lib/*/*.pot
+lvm2.po: Makefile $(LVM_POSOURCES)
@echo Compiling string table
@xgettext -C -F --keyword=print_log --keyword=log_debug \
--keyword=log_info --keyword=_ --keyword=N_ \
@@ -40,6 +34,32 @@ lvm2.po: Makefile $(top_srcdir)/tools/*.pot $(top_srcdir)/lib/*/*.pot
--keyword=log_fatal --keyword=log_debug --keyword=log_error \
--keyword=log_print --keyword=log_verbose \
--keyword=log_very_verbose -d - \
- $(top_srcdir)/tools/*.pot $(top_srcdir)/lib/*/*.pot \
- > $@
+ $(LVM_POSOURCES) > $@
+device-mapper.po: Makefile $(DM_POSOURCES)
+ @echo Compiling string table
+ @xgettext -C -F --keyword=dm_log --keyword=log_debug \
+ --keyword=log_info --keyword=_ --keyword=N_ \
+ --keyword=log_notice --keyword=log_warn --keyword=log_err \
+ --keyword=log_fatal --keyword=log_debug --keyword=log_error \
+ --keyword=log_print --keyword=log_verbose \
+ --keyword=log_very_verbose -d - \
+ $(DM_POSOURCES) > $@
+
+pofile: lvm2.po device-mapper.po
+
+# FIXME
+install: $(TARGETS)
+ @echo Installing translation files in $(localedir)
+ @( \
+ for lang in $(LANGS); do \
+ $(INSTALL) -D $(OWNER) $(GROUP) -m 444 $$lang.mo \
+ $(localedir)/$$lang/LC_MESSAGES/lvm2.mo;\
+ done; \
+ )
+ @( \
+ for lang in $(LANGS); do \
+ $(INSTALL) -D $(OWNER) $(GROUP) -m 444 $$lang.mo \
+ $(localedir)/$$lang/LC_MESSAGES/device-mapper.mo;\
+ done; \
+ )
diff --git a/scripts/Makefile.in b/scripts/Makefile.in
index 6905a904..dabaf792 100644
--- a/scripts/Makefile.in
+++ b/scripts/Makefile.in
@@ -20,6 +20,7 @@ include $(top_srcdir)/make.tmpl
install:
$(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) lvm_dump.sh \
$(sbindir)/lvmdump
+ifeq ("@FSADM@", "yes")
$(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) fsadm.sh \
$(sbindir)/fsadm
-
+endif
diff --git a/tools/Makefile.in b/tools/Makefile.in
index 63904218..2bb046d3 100644
--- a/tools/Makefile.in
+++ b/tools/Makefile.in
@@ -97,6 +97,19 @@ DEFS += -DLVM_SHARED_PATH=\"$(exec_prefix)/sbin/lvm\"
include $(top_srcdir)/make.tmpl
+device-mapper: dmsetup
+
+dmsetup: dmsetup.o $(interfacedir)/libdevmapper.$(LIB_SUFFIX)
+ $(CC) -o $@ dmsetup.o $(CFLAGS) $(LDFLAGS) \
+ -L$(interfacedir) -L$(DESTDIR)/lib -ldevmapper $(LIBS)
+
+dmsetup.static: dmsetup.o $(interfacedir)/libdevmapper.a
+ $(CC) -o $@ dmsetup.o $(CFLAGS) $(LDFLAGS) -static \
+ -L$(interfacedir) -L$(DESTDIR)/lib -ldevmapper $(LIBS) \
+ $(LIB_PTHREAD)
+
+all: device-mapper
+
lvm: $(OBJECTS) lvm.o $(top_srcdir)/lib/liblvm.a
$(CC) -o $@ $(CFLAGS) $(OBJECTS) lvm.o \
$(LDFLAGS) $(LVMLIBS) $(LIBS) -rdynamic