From: Shaun Tancheff Date: Wed, 24 Aug 2022 19:26:13 +0000 (-0700) Subject: LU-16090 build: Module.symvers lookup by flavor on SUSE X-Git-Tag: 2.15.2-RC1~40 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=06de210b43bca103b4517f306b03fb7553bad297 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. Lustre-change: https://review.whamcloud.com/48195 Lustre-commit: f3a9921ae4f9c3e48328f2c682e0c7e61221e0d3 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/48328 Tested-by: jenkins Tested-by: Maloo Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4 index f4d8495..a9cab06 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