From e056269e13c5ccf779c0f109b66e898e440b938c Mon Sep 17 00:00:00 2001 From: Ian Kent Date: Mon, 15 Aug 2022 17:19:54 +0800 Subject: [PATCH] - ensure NFSv4 is seen as supported on s390x build. --- am-utils-6.2-fix-fedora-mock-build-fail.patch | 82 +++++++++++++++++++ am-utils.spec | 12 +-- 2 files changed, 89 insertions(+), 5 deletions(-) create mode 100644 am-utils-6.2-fix-fedora-mock-build-fail.patch diff --git a/am-utils-6.2-fix-fedora-mock-build-fail.patch b/am-utils-6.2-fix-fedora-mock-build-fail.patch new file mode 100644 index 0000000..7fb2b0c --- /dev/null +++ b/am-utils-6.2-fix-fedora-mock-build-fail.patch @@ -0,0 +1,82 @@ +am-utils-6.2 - fix fedora mock build fail + +From: Ian Kent + +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 +--- + 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( diff --git a/am-utils.spec b/am-utils.spec index c6acac0..fc6bf4a 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: 50%{?dist} +Release: 51%{?dist} License: BSD Epoch: 5 URL: http://am-utils.org @@ -25,10 +25,6 @@ BuildRequires: texinfo BuildRequires: gcc BuildRequires: m4 BuildRequires: libtirpc-devel -# configure can't find kernel modules on s390x without this package. -# dracut fails of course but the modules are present for configure -# to use. -BuildRequires: kernel-modules BuildRequires: kernel-headers BuildRequires: libnsl2-devel BuildRequires: rpcsvc-proto-devel @@ -104,6 +100,7 @@ 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 @@ -182,6 +179,7 @@ mounting and unmounting filesystems. %patch47 -p1 %patch48 -p1 +%patch49 -p1 ./bootstrap @@ -285,6 +283,10 @@ fi %{_libdir}/libamu.so* %changelog +* Mon Aug 15 2022 Ian Kent - 5:6.2.0-50 +- remove BuildRequires: kernel-modules for s390x. +- add hack to ensure NFSv4 is seen as supported on s390x. + * Mon Aug 15 2022 Ian Kent - 5:6.2.0-50 - add BuildRequires: kernel-modules for s390x.