From 8827fafb1ef6acc3c736f1e37d1b85357678ba30 Mon Sep 17 00:00:00 2001 From: Jonathan Callen Date: Thu, 17 Jun 2010 23:46:25 +0000 Subject: Add better support for finding out-of-tree builds when searching in /lib/modules --- eclass/linux-info.eclass | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'eclass/linux-info.eclass') diff --git a/eclass/linux-info.eclass b/eclass/linux-info.eclass index 8733addd0698..8e0e8ab41be9 100644 --- a/eclass/linux-info.eclass +++ b/eclass/linux-info.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.83 2010/01/17 21:46:55 robbat2 Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.84 2010/06/17 23:46:25 abcd Exp $ # # Original author: John Mylchreest # Maintainer: kernel-misc@gentoo.org @@ -568,7 +568,13 @@ get_version() { get_running_version() { KV_FULL=$(uname -r) - if [[ -f ${ROOT}/lib/modules/${KV_FULL}/source/Makefile ]]; then + if [[ -f ${ROOT}/lib/modules/${KV_FULL}/source/Makefile && -f ${ROOT}/lib/modules/${KV_FULL}/build/Makefile ]]; then + KERNEL_DIR=$(readlink -f ${ROOT}/lib/modules/${KV_FULL}/source) + KBUILD_OUTPUT=$(readlink -f ${ROOT}/lib/modules/${KV_FULL}/build) + unset KV_FULL + get_version + return $? + elif [[ -f ${ROOT}/lib/modules/${KV_FULL}/source/Makefile ]]; then KERNEL_DIR=$(readlink -f ${ROOT}/lib/modules/${KV_FULL}/source) unset KV_FULL get_version -- cgit v1.2.3-65-gdbad