Whamcloud - gitweb
LU-15940 build: add a required dependency for libmount
authorJian Yu <yujian@whamcloud.com>
Fri, 24 Jun 2022 21:37:56 +0000 (14:37 -0700)
committerAndreas Dilger <adilger@whamcloud.com>
Mon, 27 Jun 2022 02:14:13 +0000 (02:14 +0000)
The Lustre client utilities (mount/umount) have
an optional dependency on libmount to update utab.
However, libmout has been introduced in util-linux
since 2.18 in 2010. There is no need to make the
dependency as optional.

Lustre-change: https://review.whamcloud.com/47619
Lustre-commit: TBD (from 3a7e4f9ca86ebdaace07709a49fb01a0311ec82d)

Test-Parameters: trivial clientdistro=ubuntu2004
Test-Parameters: trivial clientdistro=el8.5

Change-Id: I4b965a5ce6cb6fc5d2061a53c44ef9b709ebab49
Signed-off-by: Jian Yu <yujian@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/47721
Reviewed-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
config/lustre-build.m4
debian/control
debian/control.main
lustre.spec.in
lustre/utils/mount_lustre.c
lustre/utils/mount_utils.c

index 642f205..7d95cf6 100644 (file)
@@ -115,7 +115,6 @@ AC_CHECK_HEADER([libmount/libmount.h], [
        AC_CHECK_LIB([mount], [mnt_update_set_fs], [
                LDLIBMOUNT="-lmount"
                AC_SUBST(LDLIBMOUNT)
-               AC_DEFINE(HAVE_LIBMOUNT, 1, [build with libmount])
                with_libmount="yes"
        ],[with_libmount="no"])
 ], [with_libmount="no"])
@@ -124,6 +123,7 @@ AS_IF([test "x$with_libmount" = xyes], [
        AC_MSG_RESULT([yes])
 ], [
        AC_MSG_RESULT([no])
+       AC_MSG_ERROR([libmount development package is required])
 ])
 ]) # LB_LIBMOUNT
 
index e3b2558..b413598 100644 (file)
@@ -4,7 +4,7 @@ Priority: optional
 Maintainer: Brian J. Murrell <brian.murrell@intel.com>
 Uploaders: Brian J. Murrell <brian.murrell@intel.com>
 Standards-Version: 3.8.3
-Build-Depends: module-assistant, libreadline-dev, debhelper (>= 11), dpatch, automake (>=1.7) | automake1.7 | automake1.8 | automake1.9, pkg-config, libtool, libyaml-dev, libselinux-dev, libsnmp-dev, bzip2, quilt, linux-headers-generic | linux-headers | linux-headers-amd64, rsync, libssl-dev
+Build-Depends: module-assistant, libreadline-dev, debhelper (>= 11), dpatch, automake (>=1.7) | automake1.7 | automake1.8 | automake1.9, pkg-config, libtool, libyaml-dev, libselinux-dev, libsnmp-dev, bzip2, quilt, linux-headers-generic | linux-headers | linux-headers-amd64, rsync, libssl-dev, libmount-dev
 Homepage: https://wiki.whamcloud.com/
 Vcs-Git: git://git.whamcloud.com/fs/lustre-release.git
 
@@ -26,7 +26,7 @@ Package: lustre-client-utils
 Section: utils
 Architecture: i386 armhf powerpc ppc64el amd64 ia64 arm64
 Priority: optional
-Depends: ${shlibs:Depends}, ${misc:Depends}, libyaml-0-2, libselinux1, libsnmp-dev, zlib1g, perl
+Depends: ${shlibs:Depends}, ${misc:Depends}, libyaml-0-2, libselinux1, libsnmp-dev, zlib1g, perl, libmount1
 Description: Userspace utilities for the Lustre filesystem (client)
  Lustre is a scalable, secure, robust, highly-available cluster file system.
  This release is maintained by Whamcloud and available from
@@ -40,7 +40,7 @@ Package: lustre-server-utils
 Section: utils
 Architecture: i386 armhf powerpc ppc64el amd64 ia64 arm64
 Priority: optional
-Depends: ${shlibs:Depends}, ${misc:Depends}, libyaml-0-2, libselinux1, libsnmp-dev, zlib1g, perl
+Depends: ${shlibs:Depends}, ${misc:Depends}, libyaml-0-2, libselinux1, libsnmp-dev, zlib1g, perl, libmount1
 Provides: lustre-server-utils, lustre-client-utils (= ${binary:Version})
 Conflicts: lustre-client-utils
 Replaces: lustre-client-utils
index e3b2558..b413598 100644 (file)
@@ -4,7 +4,7 @@ Priority: optional
 Maintainer: Brian J. Murrell <brian.murrell@intel.com>
 Uploaders: Brian J. Murrell <brian.murrell@intel.com>
 Standards-Version: 3.8.3
-Build-Depends: module-assistant, libreadline-dev, debhelper (>= 11), dpatch, automake (>=1.7) | automake1.7 | automake1.8 | automake1.9, pkg-config, libtool, libyaml-dev, libselinux-dev, libsnmp-dev, bzip2, quilt, linux-headers-generic | linux-headers | linux-headers-amd64, rsync, libssl-dev
+Build-Depends: module-assistant, libreadline-dev, debhelper (>= 11), dpatch, automake (>=1.7) | automake1.7 | automake1.8 | automake1.9, pkg-config, libtool, libyaml-dev, libselinux-dev, libsnmp-dev, bzip2, quilt, linux-headers-generic | linux-headers | linux-headers-amd64, rsync, libssl-dev, libmount-dev
 Homepage: https://wiki.whamcloud.com/
 Vcs-Git: git://git.whamcloud.com/fs/lustre-release.git
 
@@ -26,7 +26,7 @@ Package: lustre-client-utils
 Section: utils
 Architecture: i386 armhf powerpc ppc64el amd64 ia64 arm64
 Priority: optional
-Depends: ${shlibs:Depends}, ${misc:Depends}, libyaml-0-2, libselinux1, libsnmp-dev, zlib1g, perl
+Depends: ${shlibs:Depends}, ${misc:Depends}, libyaml-0-2, libselinux1, libsnmp-dev, zlib1g, perl, libmount1
 Description: Userspace utilities for the Lustre filesystem (client)
  Lustre is a scalable, secure, robust, highly-available cluster file system.
  This release is maintained by Whamcloud and available from
@@ -40,7 +40,7 @@ Package: lustre-server-utils
 Section: utils
 Architecture: i386 armhf powerpc ppc64el amd64 ia64 arm64
 Priority: optional
-Depends: ${shlibs:Depends}, ${misc:Depends}, libyaml-0-2, libselinux1, libsnmp-dev, zlib1g, perl
+Depends: ${shlibs:Depends}, ${misc:Depends}, libyaml-0-2, libselinux1, libsnmp-dev, zlib1g, perl, libmount1
 Provides: lustre-server-utils, lustre-client-utils (= ${binary:Version})
 Conflicts: lustre-client-utils
 Replaces: lustre-client-utils
index 82e1642..e6fe590 100644 (file)
@@ -303,8 +303,8 @@ echo $TMPFILE
 %if %{with lustre_utils}
 %package osd-ldiskfs-mount
 Summary: osd-ldiskfs-mount contains mount's ldiskfs specific dso.
-BuildRequires: e2fsprogs-devel
-Requires: ldiskfsprogs
+BuildRequires: e2fsprogs-devel libmount-devel
+Requires: ldiskfsprogs libmount
 Provides: lustre-osd-mount = %{version}
 Obsoletes: lustre-osd-mount < %{version}
 Group: System Environment/Kernel
@@ -322,6 +322,8 @@ LDISKFS hooks for mount/mkfs into a dynamic library.
 %if %{with lustre_utils}
 %package osd-zfs-mount
 Summary: osd-zfs-mount contains mount's zfs specific dso.
+BuildRequires: libmount-devel
+Requires: libmount
 Provides: lustre-osd-mount = %{version}
 Obsoletes: lustre-osd-mount < %{version}
 # Tests also require zpool from zfs package:
index b4395d7..f311d4b 100644 (file)
 #include "obdctl.h"
 #include "mount_utils.h"
 
-#ifdef HAVE_LIBMOUNT
-# define WITH_LIBMOUNT "(libmount)"
-#else
-# define WITH_LIBMOUNT ""
-#endif
-
 #define MAX_RETRIES 99
 
 int    verbose;
@@ -728,8 +722,8 @@ static int parse_opts(int argc, char *const argv[], struct mount_opts *mop)
                        break;
                case 'V':
                        ++version;
-                       fprintf(stdout, "%s %s %s\n", progname,
-                               LUSTRE_VERSION_STRING, WITH_LIBMOUNT);
+                       fprintf(stdout, "%s %s (libmount)\n", progname,
+                               LUSTRE_VERSION_STRING);
                        return 0;
                default:
                        fprintf(stderr, "%s: unknown option '%c'\n",
index 1cf7659..6a9c1f0 100644 (file)
@@ -54,6 +54,7 @@
 #include <dirent.h>
 #include <sys/types.h>
 #include <sys/xattr.h>
+#include <libmount/libmount.h>
 
 #ifdef HAVE_GSS
 #ifdef HAVE_LIBKEYUTILS
@@ -252,10 +253,6 @@ static int mtab_is_proc(const char *mtab)
        return (s.f_type == PROC_SUPER_MAGIC);
 }
 
-#ifdef HAVE_LIBMOUNT
-
-# include <libmount/libmount.h>
-
 /*
  * The libmount is part of util-linux since 2.18.
  * We use it to update utab to avoid umount would
@@ -291,12 +288,6 @@ int update_utab_entry(struct mount_opts *mop)
 
        return rc;
 }
-#else
-int update_utab_entry(struct mount_opts *mop)
-{
-       return 0;
-}
-#endif /* HAVE_LIBMOUNT */
 
 int update_mtab_entry(char *spec, char *mtpt, char *type, char *opts,
                      int flags, int freq, int pass)