Whamcloud - gitweb
LU-18678 build: dkms in-kernel check kernel source 05/57905/2
authorShaun Tancheff <shaun.tancheff@hpe.com>
Mon, 27 Jan 2025 10:28:24 +0000 (17:28 +0700)
committerOleg Drokin <green@whamcloud.com>
Thu, 6 Feb 2025 01:30:06 +0000 (01:30 +0000)
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 <shaun.tancheff@hpe.com>
Change-Id: I645acfa9f0cd6308fd5c234dc679c63f94172164
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/57905
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Caleb Carlson <caleb.carlson@hpe.com>
Reviewed-by: Petros Koutoupis <petros.koutoupis@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/scripts/dkms.mkconf

index dadb441..d4cad76 100755 (executable)
@@ -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-)