From 1f4aaefe1aae8eb5c75fff446f4dc377e968677f Mon Sep 17 00:00:00 2001 From: Jian Yu Date: Wed, 22 Jun 2022 11:52:45 -0700 Subject: [PATCH] LU-15962 build: add in-kernel Module.symvers to symbol path 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 Reviewed-on: https://review.whamcloud.com/47699 Tested-by: jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Yang Sheng Reviewed-by: Oleg Drokin --- lnet/autoconf/lustre-lnet.m4 | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4 index ac18e66..0cc50fa 100644 --- a/lnet/autoconf/lustre-lnet.m4 +++ b/lnet/autoconf/lustre-lnet.m4 @@ -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], -- 1.8.3.1