Gentoo Archives: gentoo-commits

From: "Mike Frysinger (vapier)" <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in eclass: linux-info.eclass
Date: Tue, 02 Jun 2015 04:27:40
Message-Id: 20150602042735.83547A19@oystercatcher.gentoo.org
1 vapier 15/06/02 04:27:35
2
3 Modified: linux-info.eclass
4 Log:
5 fix looking up output dir when cross-compiling (fix by Nam Nguyen from Chromium OS)
6
7 Revision Changes Path
8 1.106 eclass/linux-info.eclass
9
10 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?rev=1.106&view=markup
11 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?rev=1.106&content-type=text/plain
12 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?r1=1.105&r2=1.106
13
14 Index: linux-info.eclass
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v
17 retrieving revision 1.105
18 retrieving revision 1.106
19 diff -u -r1.105 -r1.106
20 --- linux-info.eclass 9 May 2015 08:03:40 -0000 1.105
21 +++ linux-info.eclass 2 Jun 2015 04:27:35 -0000 1.106
22 @@ -1,6 +1,6 @@
23 # Copyright 1999-2015 Gentoo Foundation
24 # Distributed under the terms of the GNU General Public License v2
25 -# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.105 2015/05/09 08:03:40 ulm Exp $
26 +# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.106 2015/06/02 04:27:35 vapier Exp $
27
28 # @ECLASS: linux-info.eclass
29 # @MAINTAINER:
30 @@ -529,7 +529,15 @@
31 # but before we do this, we need to find if we use a different object directory.
32 # This *WILL* break if the user is using localversions, but we assume it was
33 # caught before this if they are.
34 - OUTPUT_DIR="${OUTPUT_DIR:-/lib/modules/${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${KV_EXTRA}/build}"
35 + if [[ -z ${OUTPUT_DIR} ]] ; then
36 + # Try to locate a kernel that is most relevant for us.
37 + for OUTPUT_DIR in "${SYROOT}" "${ROOT}" "" ; do
38 + OUTPUT_DIR+="/lib/modules/${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${KV_EXTRA}/build"
39 + if [[ -e ${OUTPUT_DIR} ]] ; then
40 + break
41 + fi
42 + done
43 + fi
44
45 [ -h "${OUTPUT_DIR}" ] && KV_OUT_DIR="$(readlink -f ${OUTPUT_DIR})"
46 [ -d "${OUTPUT_DIR}" ] && KV_OUT_DIR="${OUTPUT_DIR}"