Whamcloud - gitweb
LU-9775 Look for kernel-devel in /usr/src/kernels 64/28064/4
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:47:34 +0000 (15:47 +0000)
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>

index dcee98c..8895e96 100644 (file)
@@ -210,7 +210,7 @@ AC_DEFUN([LB_ARG_CANON_PATH], [
 # Find paths for linux, handling kernel-source rpms
-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])
 if test "$DEFAULT_LINUX" = "/lib/modules/$(uname -r)/source"; then