From a99269230a0e77e7bed4fa31c9547f0d61c7f206 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 6 Apr 2011 12:39:21 -0400 Subject: mount: add --enable-libmount-mount This patch allows to link mount.nfs with libmount from util-linux >= v2.19. The new libmount based code is enabled by CONFIG_LIBMOUNT and is stored in mount_libmount.c. The old code is not affected by this change. The libmount does not have officially stable API yet, so the --enable-libmount-mount is marked as experimental in the configure help output. The ./configure option is the same as we use in util-linux to enable support for libmount in mount(8). The addr= (and some other options necessary for remount/umount) are stored to /etc/mtab or to /dev/.mount/utab. The utab file is *private* libmount file. It's possible that some mount options (for example user=) will be moved to kernel, so the utab will not be necessary. About libmount: * supports systems without and with regular /etc/mtab * does not store VFS and FS mount options in userspace * manages user= option and evaluate permissions * parses VFS mount options and generate MS_* flags * parses /etc/{fstab,mtab}, /proc/mounts or /proc/self/mountinfo * long-term goal is to use the same code in all mount. helpers Note, use LIBMOUNT_DEBUG=0xffff mount.nfs foo:/path /path to debug the library. On systems with util-linux v2.19 the findmnt(8) command uses libmount to list all/selected mount points: $ findmnt /path $ findmnt --mtab /path the --mtab appends userspace mount options (e.g. user=) to the output. CC: Chuck Lever Signed-off-by: Karel Zak Signed-off-by: Steve Dickson --- configure.ac | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 92833e3..d8972e4 100644 --- a/configure.ac +++ b/configure.ac @@ -132,6 +132,15 @@ AC_ARG_ENABLE(mount, enable_mount=$enableval, enable_mount=yes) AM_CONDITIONAL(CONFIG_MOUNT, [test "$enable_mount" = "yes"]) + +if test "$enable_mount" = yes; then + AC_ARG_ENABLE(libmount-mount, + [AC_HELP_STRING([--enable-libmount-mount], + [Link mount.nfs with libmount (EXPERIMENTAL)])], + enable_libmount=yes, + enable_libmount=no) +fi + AC_ARG_ENABLE(tirpc, [AC_HELP_STRING([--enable-tirpc], [enable use of TI-RPC @<:@default=yes@:>@])], @@ -285,6 +294,13 @@ AC_SUBST(LIBCRYPT) AC_SUBST(LIBBSD) AC_SUBST(LIBBLKID) +if test "$enable_libmount" != no; then + AC_CHECK_LIB(mount, mnt_context_do_mount, [LIBMOUNT="-lmount"], AC_MSG_ERROR([libmount needed])) + AC_CHECK_HEADER(libmount/libmount.h, , AC_MSG_ERROR([Cannot find libmount header file libmount/libmount.h])) +fi +AM_CONDITIONAL(CONFIG_LIBMOUNT, [test "$enable_libmount" = "yes"]) +AC_SUBST(LIBMOUNT) + if test "$enable_gss" = yes; then dnl 'gss' requires getnameinfo - at least for gssd_proc.c AC_CHECK_FUNC([getnameinfo], , [AC_MSG_ERROR([GSSAPI support requires 'getnameinfo' function])]) -- cgit