Whamcloud - gitweb
LU-15940 build: add a required dependency for libmount 19/47619/5
authorJian Yu <yujian@whamcloud.com>
Sun, 19 Jun 2022 07:47:01 +0000 (00:47 -0700)
committerOleg Drokin <green@whamcloud.com>
Wed, 6 Jul 2022 03:34:46 +0000 (03:34 +0000)
The Lustre client utilities (mount/umount) have
an optional dependency on libmount to update utab.
However, libmount has been introduced in util-linux
since 2.18 in 2010. There is no need to make the
dependency as optional.

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/47619
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@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 7a764fc..5d71543 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 58e75a8..837e0c5 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, libnl-genl-3-dev, libselinux-dev, libsnmp-dev, mpi-default-dev, bzip2, quilt, linux-headers-generic | linux-headers | linux-headers-amd64, rsync, libssl-dev, libpython3-dev, swig
+Build-Depends: module-assistant, libreadline-dev, debhelper (>= 11), dpatch, automake (>=1.7) | automake1.7 | automake1.8 | automake1.9, pkg-config, libtool, libyaml-dev, libnl-genl-3-dev, libselinux-dev, libsnmp-dev, mpi-default-dev, bzip2, quilt, linux-headers-generic | linux-headers | linux-headers-amd64, rsync, libssl-dev, libpython3-dev, swig, 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, libnl-genl-3-200, perl
+Depends: ${shlibs:Depends}, ${misc:Depends}, libyaml-0-2, libselinux1, libsnmp-dev, zlib1g, libnl-genl-3-200, 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, libnl-genl-3-200, perl
+Depends: ${shlibs:Depends}, ${misc:Depends}, libyaml-0-2, libselinux1, libsnmp-dev, zlib1g, libnl-genl-3-200, perl, libmount1
 Provides: lustre-server-utils, lustre-client-utils (= ${binary:Version})
 Conflicts: lustre-client-utils
 Replaces: lustre-client-utils
index 63a12f3..837e0c5 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, libnl-genl-3-dev, libselinux-dev, libsnmp-dev, mpi-default-dev, bzip2, quilt, linux-headers-generic | linux-headers | linux-headers-amd64, rsync, libssl-dev, libpython3-dev, swig
+Build-Depends: module-assistant, libreadline-dev, debhelper (>= 11), dpatch, automake (>=1.7) | automake1.7 | automake1.8 | automake1.9, pkg-config, libtool, libyaml-dev, libnl-genl-3-dev, libselinux-dev, libsnmp-dev, mpi-default-dev, bzip2, quilt, linux-headers-generic | linux-headers | linux-headers-amd64, rsync, libssl-dev, libpython3-dev, swig, 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, libnl-genl-3-200, perl
+Depends: ${shlibs:Depends}, ${misc:Depends}, libyaml-0-2, libselinux1, libsnmp-dev, zlib1g, libnl-genl-3-200, 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, libnl-genl-3-200, perl
+Depends: ${shlibs:Depends}, ${misc:Depends}, libyaml-0-2, libselinux1, libsnmp-dev, zlib1g, libnl-genl-3-200, perl, libmount1
 Provides: lustre-server-utils, lustre-client-utils (= ${binary:Version})
 Conflicts: lustre-client-utils
 Replaces: lustre-client-utils
@@ -84,7 +84,7 @@ Package: lustre-tests
 Section: utils
 Architecture: i386 armhf powerpc ppc64el amd64 ia64 arm64
 Priority: optional
-Depends: lustre-iokit (= ${binary:Version}), lustre-dev (= ${binary:Version}), attr, rsync, perl, quota, lsof, mpi-default-bin, selinux-utils, python3
+Depends: lustre-iokit (= ${binary:Version}), lustre-dev (= ${binary:Version}), attr, rsync, quota, perl, lsof, mpi-default-bin, selinux-utils, python3
 Description: Test suite for the Lustre filesystem
  Lustre is a scalable, secure, robust, highly-available cluster file system.
  This release is maintained by Whamcloud and available from
index 24df136..2310a45 100644 (file)
@@ -276,8 +276,8 @@ echo $TMPFILE
 %if %{with lustre_utils}
 %package osd-ldiskfs-mount
 Summary: osd-ldiskfs-mount contains mount's ldiskfs specific dso.
-BuildRequires: e2fsprogs-devel >= 1.44.3
-Requires: ldiskfsprogs > 1.45.6
+BuildRequires: e2fsprogs-devel >= 1.44.3 libmount-devel
+Requires: ldiskfsprogs > 1.45.6 libmount
 Provides: lustre-osd-mount = %{version}
 Provides: %{name}-osd-mount = %{version}
 Obsoletes: %{name}-osd-mount < %{version}
@@ -297,6 +297,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: %{name}-osd-mount = %{version}
 Obsoletes: lustre-osd-mount < %{version}
 # Tests also require zpool from zfs package:
index 31575ee..3ce3ed0 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;
@@ -746,8 +740,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 b341df8..663ff6b 100644 (file)
@@ -53,6 +53,7 @@
 #include <dirent.h>
 #include <sys/types.h>
 #include <sys/xattr.h>
+#include <libmount/libmount.h>
 
 #ifdef HAVE_GSS
 #ifdef HAVE_LIBKEYUTILS
@@ -251,10 +252,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
@@ -290,12 +287,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)