From 5d518f1f186af758af59c08cf377dd2d2cdecabc Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Fri, 31 Jul 2009 11:49:53 +0000 Subject: [PATCH] Prepare for udev synchronisation code. (options don't work yet) --- Makefile.in | 4 ++++ WHATS_NEW | 2 ++ configure.in | 39 ++++++++++++++++++++++++++++++++++++--- lib/misc/configure.h.in | 9 +++++++++ make.tmpl.in | 2 ++ 5 files changed, 53 insertions(+), 3 deletions(-) diff --git a/Makefile.in b/Makefile.in index fa1ba8041..c0ae57c5e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -18,6 +18,10 @@ VPATH = @srcdir@ SUBDIRS = doc include man scripts +ifeq ("@UDEV_RULES@", "yes") + SUBDIRS += udev +endif + ifeq ("@INTL@", "yes") SUBDIRS += po endif diff --git a/WHATS_NEW b/WHATS_NEW index e002622b8..4e551d1b8 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,7 @@ Version 2.02.51 - ================================ + Added configure --enable-udev_rules --enable-udev_sync --with-udev-prefix. + Added udev dir to hold udev rules. Add --dataalignmentoffset to pvcreate to shift start of aligned data area. Fix _mda_setup() to not check first mda's size before pe_align rounding. Document -I option of clvmd in the man page. diff --git a/configure.in b/configure.in index f1f8ea480..2541e661c 100644 --- a/configure.in +++ b/configure.in @@ -402,6 +402,23 @@ if test x$DEVMAPPER = xyes; then AC_DEFINE([DEVMAPPER_SUPPORT], 1, [Define to 1 to enable LVM2 device-mapper interaction.]) fi +################################################################################ +dnl -- Enable udev synchronisation +AC_MSG_CHECKING(whether to enable synchronisation with udev processing) +AC_ARG_ENABLE(udev_sync, [ --enable-udev_sync Enable synchronisation with udev processing], +UDEV_SYNC=$enableval, UDEV_SYNC=no) +AC_MSG_RESULT($UDEV_SYNC) + +if test x$UDEV_SYNC = xyes; then + AC_DEFINE([UDEV_SYNC_SUPPORT], 1, [Define to 1 to enable synchronisation with udev processing.]) +fi + +dnl -- Enable udev rules +AC_MSG_CHECKING(whether to enable installation of udev rules required for synchronisation) +AC_ARG_ENABLE(udev_rules, [ --enable-udev_rules Install rule files needed for udev synchronisation], +UDEV_RULES=$enableval, UDEV_RULES=$UDEV_SYNC) +AC_MSG_RESULT($UDEV_RULES) + ################################################################################ dnl -- Compatibility mode AC_ARG_ENABLE(compat, [ --enable-compat Enable support for old device-mapper versions], @@ -646,12 +663,12 @@ fi ################################################################################ AC_ARG_WITH(confdir, - [ --with-confdir=DIR Configuration files in DIR [/etc]], + [ --with-confdir=DIR Configuration files in DIR [[/etc]]], [ CONFDIR="$withval" ], [ CONFDIR='/etc' ]) AC_ARG_WITH(staticdir, - [ --with-staticdir=DIR Static binary in DIR [EXEC_PREFIX/sbin]], + [ --with-staticdir=DIR Static binary in DIR [[EPREFIX/sbin]]], [ STATICDIR="$withval" ], [ STATICDIR='${exec_prefix}/sbin' ]) @@ -665,6 +682,14 @@ AC_ARG_WITH(usrsbindir, [ usrsbindir="$withval"], [ usrsbindir='${prefix}/sbin' ]) +################################################################################ +AC_ARG_WITH(udev_prefix, + [ --with-udev-prefix=UPREFIX Install udev rule files in UPREFIX [[EPREFIX]]], + [ udev_prefix="$withval"], + [ udev_prefix='${exec_prefix}' ]) + +udevdir='${udev_prefix}/lib/udev/rules.d' + ################################################################################ dnl -- Ensure additional headers required if test x$READLINE = xyes; then @@ -696,6 +721,10 @@ if test x$HAVE_SELINUX = xyes; then AC_CHECK_HEADERS(selinux/selinux.h,,AC_MSG_ERROR(bailing out)) fi +if test x$UDEV_SYNC = xyes; then + AC_CHECK_HEADERS(sys/ipc.h sys/sem.h,,AC_MSG_ERROR(bailing out)) +fi + ################################################################################ AC_PATH_PROG(MODPROBE_CMD, modprobe) @@ -723,7 +752,7 @@ if test "$BUILD_DMEVENTD" = yes; then dmeventd_prefix="" fi AC_ARG_WITH(dmeventd-path, - [ --with-dmeventd-path=PATH dmeventd path [[${exec_prefix}/sbin/dmeventd]] ], + [ --with-dmeventd-path=PATH dmeventd path [[EPREFIX/sbin/dmeventd]] ], [ AC_DEFINE_UNQUOTED(DMEVENTD_PATH,"$withval") ], [ AC_DEFINE_UNQUOTED(DMEVENTD_PATH,"$dmeventd_prefix/sbin/dmeventd") ]) fi @@ -818,12 +847,15 @@ AC_SUBST(QUORUM_LIBS) AC_SUBST(SNAPSHOTS) AC_SUBST(STATICDIR) AC_SUBST(STATIC_LINK) +AC_SUBST(UDEV_RULES) AC_SUBST([LIB_PTHREAD]) AC_SUBST(interface) AC_SUBST(kerneldir) AC_SUBST(missingkernel) AC_SUBST(kernelvsn) AC_SUBST(tmpdir) +AC_SUBST(udev_prefix) +AC_SUBST(udevdir) AC_SUBST(usrlibdir) AC_SUBST(usrsbindir) @@ -860,6 +892,7 @@ scripts/Makefile test/Makefile test/api/Makefile tools/Makefile +udev/Makefile ]) AC_OUTPUT diff --git a/lib/misc/configure.h.in b/lib/misc/configure.h.in index ccab9f507..34474e163 100644 --- a/lib/misc/configure.h.in +++ b/lib/misc/configure.h.in @@ -268,6 +268,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_IOCTL_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_IPC_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_MMAN_H @@ -287,6 +290,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SELECT_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SEM_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H @@ -417,6 +423,9 @@ /* Define to 1 if your declares `struct tm'. */ #undef TM_IN_SYS_TIME +/* Define to 1 to enable synchronisation with udev processing. */ +#undef UDEV_SYNC_SUPPORT + /* Define to empty if `const' does not conform to ANSI C. */ #undef const diff --git a/make.tmpl.in b/make.tmpl.in index f552ed2dd..5db9ab522 100644 --- a/make.tmpl.in +++ b/make.tmpl.in @@ -39,6 +39,7 @@ LIB_SUFFIX = @LIB_SUFFIX@ # Setup directory variables prefix = @prefix@ exec_prefix = @exec_prefix@ +udev_prefix = @udev_prefix@ bindir = $(DESTDIR)@bindir@ confdir = $(DESTDIR)@CONFDIR@/lvm includedir = $(DESTDIR)@includedir@ @@ -50,6 +51,7 @@ infodir = $(DESTDIR)@infodir@ mandir = $(DESTDIR)@mandir@ localedir = $(DESTDIR)@LOCALEDIR@ staticdir = $(DESTDIR)@STATICDIR@ +udevdir = $(DESTDIR)@udevdir@ interface = @interface@ interfacedir = $(top_srcdir)/libdm/$(interface)