From: Aurelien Degremont Date: Wed, 3 Jul 2024 13:43:36 +0000 (+0200) Subject: LU-18002 build: proper MOFED detection with multiple installations X-Git-Tag: 2.15.65~35 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=refs%2Fchanges%2F25%2F55625%2F4;p=fs%2Flustre-release.git LU-18002 build: proper MOFED detection with multiple installations For build step, OFED detection is based on header path detected from the locally installed packages. Building with multiple OFED headers installed (for different kernels by example) is broken since v2_15_63-60-g0e9708016b. This patch is at least fixing the Ubuntu case, and the EL case is not changed, what was working is still working, but the broken case is still broken. Also simplify the package query a little bit. Fixes: 0e9708016 ("LU-16819 build: use mofed path based on target kernel") Signed-off-by: Aurelien Degremont Change-Id: Ib15f971ea745d9deded6288e3ed4663bdd385da0 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55625 Tested-by: jenkins Tested-by: Maloo Reviewed-by: ake sandgren Reviewed-by: Shaun Tancheff Reviewed-by: Oleg Drokin --- diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4 index 8595211..cb44649 100644 --- a/lnet/autoconf/lustre-lnet.m4 +++ b/lnet/autoconf/lustre-lnet.m4 @@ -82,32 +82,34 @@ case $with_o2ib in # Use ofed_info to find external driver AS_IF([which ofed_info 2>/dev/null], [ AS_IF([test x$uses_dpkg = xyes], [ - LIST_ALL_PKG="dpkg -l | awk '{print \[$]2}'" LSPKG="dpkg --listfiles" ], [ - LIST_ALL_PKG="rpm -qa" LSPKG="rpm -ql" ]) 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" + 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 | + O2IBDIR_PATH=$(eval $LSPKG $O2IBPKG 2>/dev/null | egrep "${O2IBDIR}$" | grep -v /ofed_scripts/ | head -n1) + # Nowadays, path should always be + # /usr/src/ofa_kernel/$ARCH/${LINUXRELEASE} + # and we could clean all that complexity + # but I don't know how far we should be retro-compatible. + if test -n "$O2IBDIR_PATH"; then - if test -d $O2IBDIR_PATH/${LINUXRELEASE}; then - O2IBDIR_PATH=$O2IBDIR_PATH/${LINUXRELEASE} + if test -d $O2IBDIR_PATH/${target_cpu}/${LINUXRELEASE}; then + O2IBDIR_PATH=$O2IBDIR_PATH/${target_cpu}/${LINUXRELEASE} fi EXT_O2IBPATHS=$(find $O2IBDIR_PATH -name rdma_cm.h | sed -e 's/\/include\/rdma\/rdma_cm.h//')