Whamcloud - gitweb
LU-17560 build: with kfi check for kfabric or cray-kfabric 97/54097/2
authorShaun Tancheff <shaun.tancheff@hpe.com>
Mon, 19 Feb 2024 18:40:52 +0000 (01:40 +0700)
committerOleg Drokin <green@whamcloud.com>
Mon, 4 Mar 2024 20:05:15 +0000 (20:05 +0000)
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 <shaun.tancheff@hpe.com>
Change-Id: Ibcd21335d554b66ec925619c60e61f87d79be63d
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54097
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Petros Koutoupis <petros.koutoupis@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre.spec.in

index b63f0f6..8b811d2 100644 (file)
@@ -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} \