Whamcloud - gitweb
LU-16090 build: Module.symvers lookup by flavor on SUSE
authorShaun Tancheff <shaun.tancheff@hpe.com>
Wed, 14 Sep 2022 07:48:16 +0000 (00:48 -0700)
committerAndreas Dilger <adilger@whamcloud.com>
Fri, 23 Sep 2022 16:33:50 +0000 (16:33 +0000)
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 <shaun.tancheff@hpe.com>
Change-Id: I1c9af91108534d3a67f816077756fded4cd0b653
Reviewed-on: https://review.whamcloud.com/48329
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lnet/autoconf/lustre-lnet.m4

index 09b932f..bd52abe 100644 (file)
@@ -228,6 +228,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