From 1b3f3430fd8173eae72ee7f5c473e19ef2d2f3b0 Mon Sep 17 00:00:00 2001 From: Shaun Tancheff Date: Tue, 20 Feb 2024 01:40:52 +0700 Subject: [PATCH] LU-17560 build: with kfi check for kfabric or cray-kfabric The default location of kfabric is either /usr/src/kfabric or /usr/src/cray-kfabric Check for either during rpmbuild --with kfi Test-Parameters: trivial HPE-bug-id: LUS-12160 Signed-off-by: Shaun Tancheff Change-Id: Ibcd21335d554b66ec925619c60e61f87d79be63d Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54097 Reviewed-by: Andreas Dilger Reviewed-by: Petros Koutoupis Reviewed-by: Oleg Drokin Tested-by: jenkins Tested-by: Maloo --- lustre.spec.in | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lustre.spec.in b/lustre.spec.in index b63f0f6..8b811d2 100644 --- a/lustre.spec.in +++ b/lustre.spec.in @@ -633,6 +633,19 @@ fi # mpi %endif +# kfabric can be either cray-kfabric or kfabric +WITH_KFI="" +%if %{with kfi} + for kfabric in cray-kfabric kfabric + do + path=/usr/src/${kfabric}/default/Module.symvers + if [ -f $path ]; then + WITH_KFI="--with-kfi=$(dirname $path)" + break; + fi + done +%endif + WITH_O2IB="" %if %{with mofed} o2ib_path=$(find -H %{mofed_default_path} -type d -name ofed_scripts | xargs dirname) @@ -667,7 +680,7 @@ WITH_O2IB="" %{!?with_systemd:--with-systemdsystemunitdir=no} \ %{?with_systemd:--with-systemdsystemunitdir=%{_unitdir}} \ %{?with_multiple_lnds:--enable-multiple-lnds} \ - %{?with_kfi:--with-kfi=/usr/src/cray-kfabric/default} \ + ${WITH_KFI} \ %{?with_gni:--enable-gni} \ ${WITH_O2IB} \ %{!?with_l_getsepol:--disable-l_getsepol} \ -- 1.8.3.1