diff --git a/am-utils-6.2-dont-include-linux_mount_h.patch b/am-utils-6.2-dont-include-linux_mount_h.patch new file mode 100644 index 0000000..2f8aaf5 --- /dev/null +++ b/am-utils-6.2-dont-include-linux_mount_h.patch @@ -0,0 +1,35 @@ +am-utils-6.2 - dont include linux/mount.h + +From: Ian Kent + +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 +--- + 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 + # else ++# ifdef HAVE_SYS_MOUNT_H ++# define _LINUX_MOUNT_H ++# endif /* HAVE_SYS_MOUNT_H */ + # include + # endif/* (!__GLIBC__ || __GLIBC__ < 2) */ + #endif /* HAVE_LINUX_FS_H */ diff --git a/am-utils-6.2-fix-linux-nfs-kernel-module-search.patch b/am-utils-6.2-fix-linux-nfs-kernel-module-search.patch new file mode 100644 index 0000000..41c539c --- /dev/null +++ b/am-utils-6.2-fix-linux-nfs-kernel-module-search.patch @@ -0,0 +1,134 @@ +am-utils-6.2 - fix linux nfs kernel module search + +From: Ian Kent + +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 +--- + 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 + #include ++#include + + 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 + diff --git a/am-utils.spec b/am-utils.spec index 51f260b..047b35c 100644 --- a/am-utils.spec +++ b/am-utils.spec @@ -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 - 5:6.2.0-49 +- fix linux nfs kernel module search. +- dont include linux/mount.h. + * Thu Aug 04 2022 Ian Kent - 5:6.2.0-48 - fix fsmount naming conflict. - fix SEGV on quick reply error.