From: Shaun Tancheff Date: Mon, 27 Jan 2025 10:28:24 +0000 (+0700) Subject: LU-18678 build: dkms in-kernel check kernel source X-Git-Tag: 2.16.52~2 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=f94557bd13860b7b74a30680d5123d4331e63948;p=fs%2Flustre-release.git 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 --- 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-)