From ae5ca4d6de847a186de7ef0e1121d846a900d4c2 Mon Sep 17 00:00:00 2001 From: Ake Sandgren Date: Tue, 13 Nov 2018 12:48:22 -0500 Subject: [PATCH] LU-11541 build: Adjust OFED check for DKMS enabled MLNX OFED. The DKMS packaging of MLNX OFED, i.e. mlnx-ofed-kernel-dkms, (at least v4.4 and newer), doesn't have /usr/src/ofa_kernel/default as part of the package, it is created as a link during package installation. Restore LB_USES_DPKG autoconf test that was removed since it is needed in lustre-lnet.m4 so Debian / Ubuntu can build properly with external infiniband stacks. Test-Parameters: trivial Signed-off-by: Ake Sandgren Change-Id: I1739a67e16bc0dab8cf551b460b424441d81fc91 Reviewed-on: https://review.whamcloud.com/33396 Tested-by: Jenkins Reviewed-by: James Simmons Reviewed-by: Li Dongyang Tested-by: Maloo Reviewed-by: Sebastien Buisson Reviewed-by: Oleg Drokin --- config/lustre-build-linux.m4 | 14 ++++++++++++++ config/lustre-build.m4 | 1 + lnet/autoconf/lustre-lnet.m4 | 5 ++++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/config/lustre-build-linux.m4 b/config/lustre-build-linux.m4 index a1b5155..ba250e3 100644 --- a/config/lustre-build-linux.m4 +++ b/config/lustre-build-linux.m4 @@ -412,6 +412,20 @@ LC_MODULE_LOADING ]) # +# LB_USES_DPKG +# +# Determine if the target is a dpkg system or rpm +# +AC_DEFUN([LB_USES_DPKG], [ +AC_CACHE_CHECK([if this distro uses dpkg], lb_cv_uses_dpkg, [ +lb_cv_uses_dpkg="no" +AS_CASE([$(lsb_release -i -s 2>/dev/null)], + [Ubuntu | Debian], [lb_cv_uses_dpkg="yes"]) +]) +uses_dpkg=$lb_cv_uses_dpkg +]) + +# # LB_CHECK_EXPORT # # check symbol exported or not diff --git a/config/lustre-build.m4 b/config/lustre-build.m4 index c2da79e..7fec7bb 100644 --- a/config/lustre-build.m4 +++ b/config/lustre-build.m4 @@ -573,6 +573,7 @@ LB_CANONICAL_SYSTEM LB_CONFIG_DIST LB_DOWNSTREAM_RELEASE +LB_USES_DPKG LB_LIBCFS_DIR diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4 index 8607f57..f5b084a4 100644 --- a/lnet/autoconf/lustre-lnet.m4 +++ b/lnet/autoconf/lustre-lnet.m4 @@ -114,7 +114,7 @@ case $with_o2ib in OFED_INFO="ofed_info" LSPKG="rpm -ql" ]) - O2IBPATHS=$(eval $OFED_INFO | egrep -w 'mlnx-ofed-kernel-dkms|mlnx-ofa_kernel-devel|compat-rdma-devel|kernel-ib-devel|ofa_kernel-devel' | xargs $LSPKG | grep '\(/openib\|/ofa_kernel/default\)$' | head -n1) + O2IBPATHS=$(eval $OFED_INFO | egrep -w 'mlnx-ofed-kernel-dkms|mlnx-ofa_kernel-devel|compat-rdma-devel|kernel-ib-devel|ofa_kernel-devel' | xargs $LSPKG | grep '\(/openib\|/ofa_kernel/default\|/ofa_kernel\)$' | head -n1) AS_IF([test -z "$O2IBPATHS"], [ AC_MSG_ERROR([ You seem to have an OFED installed but have not installed it's devel package. @@ -129,6 +129,9 @@ If you still want to build Lustre for your OFED I/B stack, you need to install a Instead, if you want to build Lustre for your kernel's built-in I/B stack rather than your installed OFED stack, either remove the OFED package(s) or use --with-o2ib=no. ]) ]) + if test -e $O2IBPATHS/default; then + O2IBPATHS=$O2IBPATHS/default + fi OFED="yes" ], [ O2IBPATHS="$LINUX $LINUX/drivers/infiniband" -- 1.8.3.1