Whamcloud - gitweb
LU-9775 Look for kernel-devel in /usr/src/kernels 46/28046/3
authorBrian J. Murrell <brian.murrell@intel.com>
Fri, 14 Jul 2017 12:40:55 +0000 (08:40 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 24 Jul 2017 15:49:10 +0000 (11:49 -0400)
If one is building in a build [ch]root such as mock provides, one may
not have the kernel installed which corresponds to $(uname -r).  In such
a case, also try to look for the kernel-devel in /usr/src/kernels/ and
just build for the latest one.  Ideally there is only one installed in any case.

Test-Parameters: trivial

Signed-off-by: Brian J. Murrell <brian.murrell@intel.com>
Change-Id: I7704c6ce7078a507fd6b5f9178b07f750dc03789
Reviewed-on: https://review.whamcloud.com/28064
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Minh Diep <minh.diep@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
config/lustre-build-linux.m4

index 1224fdb..260047c 100644 (file)
@@ -175,7 +175,7 @@ AC_DEFUN([LB_ARG_CANON_PATH], [
 # Find paths for linux, handling kernel-source rpms
 #
 AC_DEFUN([LB_LINUX_PATH], [
-for DEFAULT_LINUX in /lib/modules/$(uname -r)/{source,build} /usr/src/linux; do
+for DEFAULT_LINUX in /lib/modules/$(uname -r)/{source,build} /usr/src/linux $(find /usr/src/kernels/ -maxdepth 1 -name @<:@0-9@:>@\* | xargs -r ls -d | tail -n 1); do
        AS_IF([readlink -q -e $DEFAULT_LINUX >/dev/null], [break])
 done
 if test "$DEFAULT_LINUX" = "/lib/modules/$(uname -r)/source"; then