From 3a7930e63c15b0fbe51ac73db81a1186939115bb Mon Sep 17 00:00:00 2001 From: Jian Yu Date: Wed, 27 Jul 2022 15:45:49 -0700 Subject: [PATCH] LU-16050 build: replace ofed_info with dpkg/rpm After installing MLNX_OFED by running mlnxofedinstall command, mlnx-ofed-kernel-modules package is not listed by ofed_info, which causes Lustre configure fail as follows: checking whether to use Compat RDMA... /usr/bin/ofed_info dpkg-query: error: --listfiles needs at least one package name argument This patch fixes the above issue by replacing ofed_info with "dpkg -l" and "rpm -qa" commands to find OFED package. Test-Parameters: trivial Fixes: ec03c9628cae ("LU-15417 build: find the new path for MOFED 5.5") Signed-off-by: Jian Yu Change-Id: Ia3c2d6bf10e147ca2761221741eff6f93008556c Reviewed-on: https://review.whamcloud.com/48047 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Gaurang Tapase Reviewed-by: Minh Diep Reviewed-by: Oleg Drokin --- lnet/autoconf/lustre-lnet.m4 | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4 index 5e2aee6..3727cc5 100644 --- a/lnet/autoconf/lustre-lnet.m4 +++ b/lnet/autoconf/lustre-lnet.m4 @@ -60,15 +60,33 @@ AC_ARG_WITH([o2ib], case $with_o2ib in yes) AS_IF([which ofed_info 2>/dev/null], [ AS_IF([test x$uses_dpkg = xyes], [ - OFED_INFO="ofed_info | awk '{print \[$]2}'" + LIST_ALL_PKG="dpkg -l | awk '{print \[$]2}'" LSPKG="dpkg --listfiles" ], [ - OFED_INFO="ofed_info" + LIST_ALL_PKG="rpm -qa" 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 -v 'ofa_kernel-' | grep rdma_cm.h | sed 's/\/include\/rdma\/rdma_cm.h//') + + O2IBPKG="mlnx-ofed-kernel-dkms" + O2IBPKG+="|mlnx-ofed-kernel-modules" + O2IBPKG+="|mlnx-ofa_kernel-devel" + O2IBPKG+="|compat-rdma-devel" + O2IBPKG+="|kernel-ib-devel" + O2IBPKG+="|ofa_kernel-devel" + + O2IBDIR="/ofa_kernel" + O2IBDIR+="|/ofa_kernel/default" + O2IBDIR+="|/openib" + + O2IBDIR_PATH=$(eval $LIST_ALL_PKG | + egrep -w "$O2IBPKG" | xargs $LSPKG | + egrep "${O2IBDIR}$" | head -n1) + + if test -n "$O2IBDIR_PATH"; then + O2IBPATHS=$(find $O2IBDIR_PATH -name rdma_cm.h | + sed -e 's/\/include\/rdma\/rdma_cm.h//') + fi + AS_IF([test -z "$O2IBPATHS"], [ AC_MSG_ERROR([ You seem to have an OFED installed but have not installed it's devel package. -- 1.8.3.1