Whamcloud - gitweb
LU-15962 build: add in-kernel Module.symvers to symbol path 99/47699/2
authorJian Yu <yujian@whamcloud.com>
Wed, 22 Jun 2022 18:52:45 +0000 (11:52 -0700)
committerOleg Drokin <green@whamcloud.com>
Wed, 6 Jul 2022 03:34:54 +0000 (03:34 +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.

Test-Parameters: trivial

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

index ac18e66..0cc50fa 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],