diff --git a/Makefile.in b/Makefile.in index 923d13f5a..988af2705 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 232ebf41d..8b34f3e1b 100644 --- a/configure.in +++ b/configure.in @@ -159,6 +159,24 @@ if test x$GROUP != x; then GROUP="-g $GROUP" 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 f3a3a7aaf..6e52e70b3 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 c59803137..f469d95be 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 0b2985eea..969ddc8a4 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 +#include +#include +#include +#include +#include +#include #endif diff --git a/libdm/Makefile.in b/libdm/Makefile.in index 12d37a637..d68c183c5 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 d5d302f4a..5ba63ce77 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 -#include #include struct dm_task; diff --git a/libdm/ioctl/libdm-iface.c b/libdm/ioctl/libdm-iface.c index 7366f08b1..270abb94e 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 +#include "dm-ioctl.h" /* * Ensure build compatibility. diff --git a/libdm/libdm-common.c b/libdm/libdm-common.c index 610bd4534..3efd22828 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 #include #include #include -#include - #ifdef linux # include #endif diff --git a/libdm/libdm-deptree.c b/libdm/libdm-deptree.c index 4b5876576..1b757f525 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 #include -#include - #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 c5bd2c959..fe75bba3a 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 aca792472..3cfd11f63 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 d4dba36fe..64e882fdf 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) + +DM_POSOURCES = $(top_srcdir)/dmsetup/*.pot $(top_srcdir)/libdm/*.pot \ + $(top_srcdir)/libdm/*/*.pot + +LVM_POSOURCES = $(top_srcdir)/tools/*.pot $(top_srcdir)/lib/*/*.pot include $(top_srcdir)/make.tmpl -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; \ - ) - -pofile: lvm2.po - -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 6905a9043..dabaf792f 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 63904218f..2bb046d32 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