From 3c8812e6d364829c4faa78fe02feda755c83164a Mon Sep 17 00:00:00 2001 From: Jian Yu Date: Mon, 19 Sep 2022 09:53:54 -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. Lustre-change: https://review.whamcloud.com/48047 Lustre-commit: 3a7930e63c15b0fbe51ac73db81a1186939115bb 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-by: Gaurang Tapase Reviewed-by: Minh Diep Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/48592 Reviewed-by: Oleg Drokin Tested-by: jenkins Tested-by: Maloo --- 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 a9cab06..dc421ba 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