Compare commits

...
Sign in to create a new pull request.

2 commits

Author SHA1 Message Date
Ian Kent
0526509546 - ensure NFSv4 is seen as supported on s390x build. 2022-08-15 17:55:47 +08:00
Ian Kent
6fa40997ab - more fixes for bug 2113103 - am-utils: FTBFS in Fedora rawhide/f37 2022-08-15 12:16:17 +08:00
4 changed files with 267 additions and 1 deletions

View file

@ -0,0 +1,35 @@
am-utils-6.2 - dont include linux/mount.h
From: Ian Kent <raven@themaw.net>
Updates to glibc to add support for fsconfig() et. al. have introduced
conflicts between sys/mount.h and the corresponding kernel header
linux/mount.h.
But sys/mount.h and linux/mount.h provide very close to the same
definitions except that sys/mount.h has some additional function
declarations.
So add a macro define to the amd include file to stop its inclusion
of linux/mount.h when including linux/fs.h so that sys/mount.h is
used instead.
Signed-off-by: Ian Kent <raven@themaw.net>
---
include/mount_headers1.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/include/mount_headers1.h b/include/mount_headers1.h
index 7d518a06..af9a90ee 100644
--- a/include/mount_headers1.h
+++ b/include/mount_headers1.h
@@ -160,6 +160,9 @@
# endif /* HAVE_LINUX_LIST_H */
# include <linux/fs.h>
# else
+# ifdef HAVE_SYS_MOUNT_H
+# define _LINUX_MOUNT_H
+# endif /* HAVE_SYS_MOUNT_H */
# include <linux/fs.h>
# endif/* (!__GLIBC__ || __GLIBC__ < 2) */
#endif /* HAVE_LINUX_FS_H */

View file

@ -0,0 +1,82 @@
am-utils-6.2 - fix fedora mock build fail
From: Ian Kent <raven@themaw.net>
NFSv4 really needs to be used here but fedora mock builds don't seem
to be able to see the kernel modules. And when NFSv4 is a module, and
has not been used yet, the test fails.
So use the existing hack to ensure NFSv4 is seen as supported for both
check_fs_mntent.m4 and check_mount_type.m4 in m4/macros.
Signed-off-by: Ian Kent <raven@themaw.net>
---
m4/macros/check_fs_mntent.m4 | 23 +++++++++++++----------
m4/macros/check_mount_type.m4 | 18 ++++++++++++++++++
2 files changed, 31 insertions(+), 10 deletions(-)
diff --git a/m4/macros/check_fs_mntent.m4 b/m4/macros/check_fs_mntent.m4
index 45ac4974..de3d9a91 100644
--- a/m4/macros/check_fs_mntent.m4
+++ b/m4/macros/check_fs_mntent.m4
@@ -141,18 +141,21 @@ do
break
fi
- if test "$ac_fs_tmp" = "nfs3" -a "$ac_cv_header_linux_nfs_mount_h" = "yes"
+ if test $ac_fs_tmp = "nfs3" -o $ac_fs_tmp = "nfs4"
then
- # hack hack hack
- # in 6.1, which has fallback to v2/udp, we might want
- # to always use version 4.
- # in 6.0 we do not have much choice
- #
- let nfs_mount_version="`grep NFS_MOUNT_VERSION /usr/include/linux/nfs_mount.h | awk '{print $''3;}'`"
- if test $nfs_mount_version -ge 4
+ if test "$ac_cv_header_linux_nfs_mount_h" = "yes"
then
- eval "ac_cv_fs_$ac_fs_name=yes"
- break
+ # hack hack hack
+ # in 6.1, which has fallback to v2/udp, we might want
+ # to always use version 4.
+ # in 6.0 we do not have much choice
+ #
+ let nfs_mount_version="`grep NFS_MOUNT_VERSION /usr/include/linux/nfs_mount.h | awk '{print $''3;}'`"
+ if test $nfs_mount_version -ge 4
+ then
+ eval "ac_cv_fs_$ac_fs_name=yes"
+ break
+ fi
fi
fi
diff --git a/m4/macros/check_mount_type.m4 b/m4/macros/check_mount_type.m4
index 88f85323..69354221 100644
--- a/m4/macros/check_mount_type.m4
+++ b/m4/macros/check_mount_type.m4
@@ -155,6 +155,24 @@ do
break
fi
+ if test $ac_fs_tmp = "nfs4"
+ then
+ if test "$ac_cv_header_linux_nfs_mount_h" = "yes"
+ then
+ # hack hack hack
+ # in 6.1, which has fallback to v2/udp, we might want
+ # to always use version 4.
+ # in 6.0 we do not have much choice
+ #
+ let nfs_mount_version="`grep NFS_MOUNT_VERSION /usr/include/linux/nfs_mount.h | awk '{print $''3;}'`"
+ if test $nfs_mount_version -ge 4
+ then
+ eval "ac_cv_mount_type_$ac_fs_name=\\\"$ac_fs_tmp\\\""
+ break
+ fi
+ fi
+ fi
+
# run a test program for bsdi3
AC_RUN_IFELSE(
[AC_LANG_SOURCE(

View file

@ -0,0 +1,134 @@
am-utils-6.2 - fix linux nfs kernel module search
From: Ian Kent <raven@themaw.net>
The configure macros AMU_CHECK_FS_MNTENT() and AMU_CHECK_MOUNT_TYPE()
haven't been updated for a log time. In particular kernel modules that
are xz compressed aren't considered.
Also the containing subdirectory name isn't always the the same as
the module name and needs to be special cased.
The cases I found have been fixed, there are probably more but this
is enough to get us started.
Signed-off-by: Ian Kent <raven@themaw.net>
---
amd/amfs_host.c | 1 +
configure.ac | 6 +++---
m4/macros/check_fs_mntent.m4 | 17 +++++++++++++++--
m4/macros/check_mount_type.m4 | 29 +++++++++++++++++++++++++----
4 files changed, 44 insertions(+), 9 deletions(-)
diff --git a/amd/amfs_host.c b/amd/amfs_host.c
index a363c5cc..deaf69fa 100644
--- a/amd/amfs_host.c
+++ b/amd/amfs_host.c
@@ -50,6 +50,7 @@
#endif /* HAVE_CONFIG_H */
#include <am_defs.h>
#include <amd.h>
+#include <am_utils.h>
static char *amfs_host_match(am_opts *fo);
static int amfs_host_init(mntfs *mf);
diff --git a/configure.ac b/configure.ac
index ef4dab0e..408964d8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -808,8 +808,8 @@ dnl NFS related tests need to happen earlier: many things depend on them
AMU_STRUCT_FIELD_NFS_FH
AMU_STRUCT_NFS_FH
AMU_STRUCT_NFS_FH3
-AMU_CHECK_FS_MNTENT(nfs3)
-AMU_CHECK_FS_MNTENT(nfs4)
+AMU_CHECK_FS_MNTENT(nfsv3 nfs3, nfs3)
+AMU_CHECK_FS_MNTENT(nfsv4 nfs4, nfs4)
dnl ======================================================================
dnl -----------------------------------------------------------------------
@@ -1117,7 +1117,7 @@ dnl check for mount(2) type/name for filesystem (MNTTYPE_*, MOUNT_*)
AC_MSG_NOTICE(*** MOUNTING TYPES ***)
AMU_CHECK_MOUNT_TYPE(nfs)
AMU_CHECK_MOUNT_TYPE(nfs3)
-AMU_CHECK_MOUNT_TYPE(nfs4)
+AMU_CHECK_MOUNT_TYPE(nfsv4 nfs4, nfs4)
AMU_CHECK_MOUNT_TYPE(lustre)
AMU_CHECK_MOUNT_TYPE(ext4 ext3 ext2 ffs ufs 4.2 4.3 4.4 efs xfs jfs ultrix, ufs)
AMU_CHECK_MOUNT_TYPE(xfs)
diff --git a/m4/macros/check_fs_mntent.m4 b/m4/macros/check_fs_mntent.m4
index e612b4ec..45ac4974 100644
--- a/m4/macros/check_fs_mntent.m4
+++ b/m4/macros/check_fs_mntent.m4
@@ -98,12 +98,25 @@ do
fi
# look for a loadable filesystem module (linux 2.4+)
- if test -f /lib/modules/$host_os_version/kernel/fs/$ac_fs_tmp/$ac_fs_tmp.ko
+ ac_fs_subdir=$ac_fs_tmp
+ if test -n "$2"
+ then
+ if test "$ac_fs_tmp" = "nfsv3" -o "$ac_fs_tmp" = "nfsv4"
+ then
+ ac_fs_subdir="nfs"
+ fi
+ fi
+ if test -f /lib/modules/$host_os_version/kernel/fs/$ac_fs_subdir/$ac_fs_tmp.ko.xz
+ then
+ eval "ac_cv_fs_$ac_fs_name=yes"
+ break
+ fi
+ if test -f /lib/modules/$host_os_version/kernel/fs/$ac_fs_subdir/$ac_fs_tmp.ko
then
eval "ac_cv_fs_$ac_fs_name=yes"
break
fi
- if test -f /lib/modules/$host_os_version/kernel/fs/$ac_fs_tmp/$ac_fs_tmp.o
+ if test -f /lib/modules/$host_os_version/kernel/fs/$ac_fs_subdir/$ac_fs_tmp.o
then
eval "ac_cv_fs_$ac_fs_name=yes"
break
diff --git a/m4/macros/check_mount_type.m4 b/m4/macros/check_mount_type.m4
index c779e0bf..88f85323 100644
--- a/m4/macros/check_mount_type.m4
+++ b/m4/macros/check_mount_type.m4
@@ -104,14 +104,35 @@ do
fi
# look for a loadable filesystem module (linux 2.4+)
- if test -f /lib/modules/$host_os_version/kernel/fs/$ac_fs_tmp/$ac_fs_tmp.ko
+ # special casing here assumes preferred option name will be
+ # first in the list.
+ ac_fs_option="$ac_fs_tmp"
+ ac_fs_subdir=$ac_fs_tmp
+ if test -n "$2"
then
- eval "ac_cv_mount_type_$ac_fs_name=\\\"$ac_fs_tmp\\\""
+ if test "$ac_fs_tmp" = "nfsv3" -o "$ac_fs_tmp" = "nfsv4"
+ then
+ ac_fs_subdir="nfs"
+ ac_fs_option="$ac_fs_name"
+ fi
+ if test "$ac_fs_tmp" = "vfat" -o "$ac_fs_tmp" = "msdos"
+ then
+ ac_fs_subdir="fat"
+ fi
+ fi
+ if test -f /lib/modules/$host_os_version/kernel/fs/$ac_fs_subdir/$ac_fs_tmp.ko.xz
+ then
+ eval "ac_cv_mount_type_$ac_fs_name=\\\"$ac_fs_option\\\""
break
fi
- if test -f /lib/modules/$host_os_version/kernel/fs/$ac_fs_tmp/$ac_fs_tmp.o
+ if test -f /lib/modules/$host_os_version/kernel/fs/$ac_fs_subdir/$ac_fs_tmp.ko
then
- eval "ac_cv_mount_type_$ac_fs_name=\\\"$ac_fs_tmp\\\""
+ eval "ac_cv_mount_type_$ac_fs_name=\\\"$ac_fs_option\\\""
+ break
+ fi
+ if test -f /lib/modules/$host_os_version/kernel/fs/$ac_fs_subdir/$ac_fs_tmp.o
+ then
+ eval "ac_cv_mount_type_$ac_fs_name=\\\"$ac_fs_option\\\""
break
fi

View file

@ -2,7 +2,7 @@ Summary: Automount utilities including an updated version of Amd
Name: am-utils
Version: 6.2.0
%define upstream_version 6.2
Release: 48%{?dist}
Release: 51%{?dist}
License: BSD
Epoch: 5
URL: http://am-utils.org
@ -98,6 +98,10 @@ Patch44: am-utils-6.2-fix-fsmount-naming-conflict.patch
Patch45: am-utils-6.2-fix-SEGV-on-quick-reply-error.patch
Patch46: am-utils-6.2-fix-mountd-version-used-when-mount-is-nfs-v4.patch
Patch47: am-utils-6.2-fix-linux-nfs-kernel-module-search.patch
Patch48: am-utils-6.2-dont-include-linux_mount_h.patch
Patch49: am-utils-6.2-fix-fedora-mock-build-fail.patch
# Not needed since autoreconf/libtool appear to do this automatically
# Leaving it set doesn't appear to be a problem so leave it set in
# case this changes.
@ -173,6 +177,10 @@ mounting and unmounting filesystems.
%patch45 -p1
%patch46 -p1
%patch47 -p1
%patch48 -p1
%patch49 -p1
./bootstrap
find_requires=%{old_find_requires}
@ -275,6 +283,13 @@ fi
%{_libdir}/libamu.so*
%changelog
* Mon Aug 15 2022 Ian Kent <raven@themaw.net> - 5:6.2.0-51
- add hack to ensure NFSv4 is seen as supported on s390x.
* Mon Aug 15 2022 Ian Kent <raven@themaw.net> - 5:6.2.0-49
- fix linux nfs kernel module search.
- dont include linux/mount.h.
* Thu Aug 04 2022 Ian Kent <raven@themaw.net> - 5:6.2.0-48
- fix fsmount naming conflict.
- fix SEGV on quick reply error.