From f3a9921ae4f9c3e48328f2c682e0c7e61221e0d3 Mon Sep 17 00:00:00 2001 From: Shaun Tancheff Date: Thu, 11 Aug 2022 18:48:40 +0700 Subject: [PATCH] LU-16090 build: Module.symvers lookup by flavor on SUSE When multiple kernel flavors are found we need to select only the Module.symvers for the flavor that is being built. HPE-bug-id: LUS-11149 Test-Parameters: trivial Fixes: 1f4aaefe1aae ("LU-15962 build: add in-kernel Module.symvers to symbol path") Signed-off-by: Shaun Tancheff Change-Id: I1c9af91108534d3a67f816077756fded4cd0b653 Reviewed-on: https://review.whamcloud.com/48195 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Jian Yu Tested-by: Jian Yu Reviewed-by: James Simmons Reviewed-by: Petros Koutoupis Reviewed-by: Oleg Drokin --- lnet/autoconf/lustre-lnet.m4 | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4 index f76bf5a..5e2aee6 100644 --- a/lnet/autoconf/lustre-lnet.m4 +++ b/lnet/autoconf/lustre-lnet.m4 @@ -210,6 +210,18 @@ AS_IF([test $ENABLEO2IB = "no"], [ O2IB_SYMVER=$O2IBPATH/Module.symvers elif test "x$SUSE_KERNEL" = "xyes"; then O2IB_SYMVER=$(find ${O2IBPATH}* -name Module.symvers) + # Select only the current 'flavor' if there is more than 1 + NUM_AVAIL=$(find ${O2IBPATH}* -name Module.symvers | wc -l) + if test ${NUM_AVAIL} -gt 1; then + PREFER=$(basename ${LINUX_OBJ}) + for F in $(find ${O2IBPATH}-obj -name Module.symvers) + do + maybe=$(echo $F | grep "/${PREFER}") + if test "x$maybe" != "x"; then + O2IB_SYMVER=$F + fi + done + fi elif test -f $LINUX_OBJ/Module.symvers; then # Debian symvers is in the arch tree O2IB_SYMVER=$LINUX_OBJ/Module.symvers -- 1.8.3.1