Whamcloud - gitweb
LU-15962 build: add in-kernel Module.symvers to symbol path 60/47760/4
authorJian Yu <yujian@whamcloud.com>
Fri, 24 Jun 2022 07:02:31 +0000 (00:02 -0700)
committerOleg Drokin <green@whamcloud.com>
Wed, 6 Jul 2022 03:42:16 +0000 (03:42 +0000)
After building Lustre with in-kernel OFED, installing
ko2iblnd module hit the following errors:

ko2iblnd: disagrees about version of symbol __ib_alloc_pd
ko2iblnd: Unknown symbol __ib_alloc_pd (err -22)
ko2iblnd: disagrees about version of symbol rdma_resolve_addr
ko2iblnd: Unknown symbol rdma_resolve_addr (err -22)

Those exported symbols are contained in in-kernel Module.symvers,
which should be added to the symbol path KBUILD_EXTRA_SYMBOLS.

Lustre-change: https://review.whamcloud.com/47699
Lustre-commit: 1f4aaefe1aae8eb5c75fff446f4dc377e968677f

Test-Parameters: trivial

Change-Id: Ic30caa7079af00a452ea24e7e982a856874af702
Signed-off-by: Jian Yu <yujian@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/47760
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lnet/autoconf/lustre-lnet.m4

index cd487fb..7edd2a0 100644 (file)
@@ -206,18 +206,17 @@ AS_IF([test $ENABLEO2IB = "no"], [
                ])
                # we know at this point that the found OFED source is good
                O2IB_SYMVER=""
-               if test $ENABLEO2IB = "withpath" -o "x$OFED" = "xyes" ; then
-                       if test -f $O2IBPATH/Module.symvers; then
-                               O2IB_SYMVER=$O2IBPATH/Module.symvers;
-                               break;
-                       fi
-                       if test -n "$O2IB_SYMVER"; then
-                               AC_MSG_NOTICE([adding $O2IB_SYMVER to Symbol Path])
-                               EXTRA_SYMBOLS="$EXTRA_SYMBOLS $O2IB_SYMVER"
-                               AC_SUBST(EXTRA_SYMBOLS)
-                       else
-                               AC_MSG_ERROR([an external source tree was, either specified or detected, for o2iblnd however I could not find a $O2IBPATH/Module.symvers there])
-                       fi
+               if test -f $O2IBPATH/Module.symvers; then
+                       O2IB_SYMVER=$O2IBPATH/Module.symvers
+               elif test "x$SUSE_KERNEL" = "xyes"; then
+                       O2IB_SYMVER=$(find ${O2IBPATH}* -name Module.symvers)
+               fi
+               if test -n "$O2IB_SYMVER"; then
+                       AC_MSG_NOTICE([adding $O2IB_SYMVER to Symbol Path])
+                       EXTRA_SYMBOLS="$EXTRA_SYMBOLS $O2IB_SYMVER"
+                       AC_SUBST(EXTRA_SYMBOLS)
+               else
+                       AC_MSG_ERROR([an external source tree was, either specified or detected, for o2iblnd however I could not find a $O2IBPATH/Module.symvers there])
                fi
 
                LB_CHECK_COMPILE([if Linux kernel has kthread_worker],