From f94557bd13860b7b74a30680d5123d4331e63948 Mon Sep 17 00:00:00 2001 From: Shaun Tancheff Date: Mon, 27 Jan 2025 17:28:24 +0700 Subject: [PATCH] LU-18678 build: dkms in-kernel check kernel source From dkms the default $kernel_source_dir will be @MODDIR@/$kernelver/build unless otherwise specified with the --kernelsourcedir option. Unfortunately the check for kernel headers will fail as only the generated headers are available from the 'build' symbolic link on SUSE. Probe for the 'source' symbolic link if it points to a directory with 'include/linux' proceed to prefer it when checking for in-kernel rdma support. HPE-bug-id: LUS-12710 Test-Parameters: trivial Signed-off-by: Shaun Tancheff Change-Id: I645acfa9f0cd6308fd5c234dc679c63f94172164 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/57905 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Caleb Carlson Reviewed-by: Petros Koutoupis Reviewed-by: Oleg Drokin --- lustre/scripts/dkms.mkconf | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lustre/scripts/dkms.mkconf b/lustre/scripts/dkms.mkconf index dadb441..d4cad76 100755 --- a/lustre/scripts/dkms.mkconf +++ b/lustre/scripts/dkms.mkconf @@ -76,9 +76,11 @@ can_o2ib_mofed=no can_o2ib_in_kernel=no ext_mofed=no int_mofed=no -[[ -f \${kernel_source_dir}/include/rdma/rdma_cm.h ]] && -[[ -f \${kernel_source_dir}/include/rdma/ib_cm.h ]] && -[[ -f \${kernel_source_dir}/include/rdma/ib_verbs.h ]] && +ksrc=\$(dirname \${kernel_source_dir})/source +[[ -d \$ksrc/include/linux ]] || ksrc=\${kernel_source_dir} +[[ -f \${ksrc}/include/rdma/rdma_cm.h ]] && +[[ -f \${ksrc}/include/rdma/ib_cm.h ]] && +[[ -f \${ksrc}/include/rdma/ib_verbs.h ]] && can_o2ib_in_kernel=yes # Now check if ext_o2ib is explicit, or will be auto-detected: o2ib=\$(echo \${OPTS} | tr ' ' '\\n' | grep -- '--with-o2ib=' | cut -c 13-) -- 1.8.3.1