Whamcloud - gitweb
LU-12904 build: External _module_ decorator removed 76/36576/2
authorShaun Tancheff <stancheff@cray.com>
Fri, 25 Oct 2019 13:10:59 +0000 (08:10 -0500)
committerOleg Drokin <green@whamcloud.com>
Fri, 6 Dec 2019 01:10:38 +0000 (01:10 +0000)
As of 5.4 the _module_ decorator prefix is not used for external
kernel modules. This breaks building kernel modules for 5.4.
Prior kernels still require the _module_ decorator.

Add a configure check to test for and handle _module_ decorator is
used.

Linux-commit: d7b0827f28ab3a4fd65864451ffefa695e3255fd

Test-Parameters: trivial
Cray-bug-id: LUS-8042
Signed-off-by: Shaun Tancheff <stancheff@cray.com>
Change-Id: I4359452cea8e32a31234b9becc2ed319954c55a4
Reviewed-on: https://review.whamcloud.com/36576
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Petros Koutoupis <pkoutoupis@cray.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
config/lustre-build-linux.m4

index 2f3db74..8ce66b8 100644 (file)
@@ -8,26 +8,35 @@ KMODEXT=".ko"
 AC_SUBST(KMODEXT)
 
 makerule="$PWD/build"
-AC_CACHE_CHECK([for external module build target], lb_cv_module_target, [
-lb_cv_module_target=""
-MODULE_TARGET="SUBDIRS"
-rm -f build/conftest.i
-LB_LINUX_TRY_MAKE([], [],
-       [$makerule LUSTRE_KERNEL_TEST=conftest.i],
-       [test -s build/conftest.i],
-       [lb_cv_module_target="SUBDIRS"], [
-               MODULE_TARGET="M"
-               makerule="_module_$PWD/build"
-               LB_LINUX_TRY_MAKE([], [],
-                       [$makerule LUSTRE_KERNEL_TEST=conftest.i],
-                       [test -s build/conftest.i],
-                       [lb_cv_module_target="M"], [
-                               AC_MSG_ERROR([unknown; check config.log for details])
-                       ])
-       ])
+AC_CACHE_CHECK([for external module build target], lb_cv_module_target,
+[
+       lb_cv_module_target=""
+       MODULE_TARGET="SUBDIRS"
+       rm -f build/conftest.i
+       LB_LINUX_TRY_MAKE([], [],
+               [$makerule LUSTRE_KERNEL_TEST=conftest.i],
+               [test -s build/conftest.i],
+               [lb_cv_module_target="SUBDIRS"],[
+       MODULE_TARGET="M"
+       makerule="$PWD/build/"
+       LB_LINUX_TRY_MAKE([], [],
+               [$makerule LUSTRE_KERNEL_TEST=conftest.i],
+               [test -s build/conftest.i],
+               [lb_cv_module_target="M54"], [
+       MODULE_TARGET="M"
+       makerule="_module_$PWD/build"
+       LB_LINUX_TRY_MAKE([], [],
+               [$makerule LUSTRE_KERNEL_TEST=conftest.i],
+               [test -s build/conftest.i],
+               [lb_cv_module_target="M"], [
+                       AC_MSG_ERROR([kernel module make failed; check config.log for details])
+       ])])])
 ])
 AS_IF([test -z "$lb_cv_module_target"],
        [AC_MSG_ERROR([unknown external module build target])],
+[test "x$lb_cv_module_target" = "xM54"],
+       [makerule="$PWD/build"
+       lb_cv_module_target="M"],
 [test "x$lb_cv_module_target" = "xM"],
        [makerule="_module_$PWD/build"])
 MODULE_TARGET=$lb_cv_module_target