- more fixes for bug 2113103 - am-utils: FTBFS in Fedora rawhide/f37

This commit is contained in:
Ian Kent 2022-08-15 11:08:08 +08:00
parent fa9b2f2bb8
commit 9ba765bc8c
3 changed files with 180 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,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: 49%{?dist}
License: BSD
Epoch: 5
URL: http://am-utils.org
@ -98,6 +98,9 @@ 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
# 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 +176,9 @@ mounting and unmounting filesystems.
%patch45 -p1
%patch46 -p1
%patch47 -p1
%patch48 -p1
./bootstrap
find_requires=%{old_find_requires}
@ -275,6 +281,10 @@ fi
%{_libdir}/libamu.so*
%changelog
* 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.