/[gentoo-x86]/eclass/linux-info.eclass
Gentoo

Diff of /eclass/linux-info.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.38 Revision 1.42
1# Copyright 1999-2006 Gentoo Foundation 1# Copyright 1999-2006 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.38 2006/01/20 14:27:47 dsd Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.42 2006/03/03 22:11:28 johnm Exp $
4# 4#
5# Description: This eclass is used as a central eclass for accessing kernel 5# Description: This eclass is used as a central eclass for accessing kernel
6# related information for sources already installed. 6# related information for sources already installed.
7# It is vital for linux-mod to function correctly, and is split 7# It is vital for linux-mod to function correctly, and is split
8# out so that any ebuild behaviour "templates" are abstracted out 8# out so that any ebuild behaviour "templates" are abstracted out
52# And to ensure all the weirdness with crosscompile 52# And to ensure all the weirdness with crosscompile
53inherit toolchain-funcs versionator 53inherit toolchain-funcs versionator
54 54
55EXPORT_FUNCTIONS pkg_setup 55EXPORT_FUNCTIONS pkg_setup
56 56
57DEPEND="kernel_linux? ( virtual/linux-sources )"
58RDEPEND=""
59
57# Overwritable environment Var's 60# Overwritable environment Var's
58# --------------------------------------- 61# ---------------------------------------
59KERNEL_DIR="${KERNEL_DIR:-${ROOT}usr/src/linux}" 62KERNEL_DIR="${KERNEL_DIR:-${ROOT}usr/src/linux}"
60 63
61 64
114 basefname="$(basename ${2})" 117 basefname="$(basename ${2})"
115 basedname="$(dirname ${2})" 118 basedname="$(dirname ${2})"
116 unset ARCH 119 unset ARCH
117 120
118 cd "${basedname}" 121 cd "${basedname}"
119 echo -e "include ${basefname}\ne:\n\t@echo \$(${1})" | \ 122 echo -e "e:\\n\\t@echo \$(${1})\\ninclude ${basefname}" | \
120 make ${BUILD_FIXES} -s -f - e 2>/dev/null 123 make ${BUILD_FIXES} -s -f - 2>/dev/null
121 cd "${workingdir}" 124 cd "${workingdir}"
122 125
123 ARCH=${myARCH} 126 ARCH=${myARCH}
124 fi 127 fi
125} 128}
287 qeinfo "Found kernel object directory:" 290 qeinfo "Found kernel object directory:"
288 qeinfo " ${KV_OUT_DIR}" 291 qeinfo " ${KV_OUT_DIR}"
289 292
290 KV_LOCAL="$(get_localversion ${KV_OUT_DIR})" 293 KV_LOCAL="$(get_localversion ${KV_OUT_DIR})"
291 fi 294 fi
292 # and if we STILL haven't got it, then we better just set it to KV_DIR 295 # and if we STILL have not got it, then we better just set it to KV_DIR
293 KV_OUT_DIR="${KV_OUT_DIR:-${KV_DIR}}" 296 KV_OUT_DIR="${KV_OUT_DIR:-${KV_DIR}}"
294
295 KV_LOCAL="${KV_LOCAL}$(get_localversion ${KV_DIR})"
296 KV_LOCAL="${KV_LOCAL}$(linux_chkconfig_string LOCALVERSION)"
297 KV_LOCAL="${KV_LOCAL//\"/}"
298
299 # And we should set KV_FULL to the full expanded version
300 KV_FULL="${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${KV_EXTRA}${KV_LOCAL}"
301
302 qeinfo "Found sources for kernel version:"
303 qeinfo " ${KV_FULL}"
304 297
305 if [ ! -s "${KV_OUT_DIR}/.config" ] 298 if [ ! -s "${KV_OUT_DIR}/.config" ]
306 then 299 then
307 qeerror "Could not find a usable .config in the kernel source directory." 300 qeerror "Could not find a usable .config in the kernel source directory."
308 qeerror "Please ensure that ${KERNEL_DIR} points to a configured set of Linux sources." 301 qeerror "Please ensure that ${KERNEL_DIR} points to a configured set of Linux sources."
309 qeerror "If you are using KBUILD_OUTPUT, please set the environment var so that" 302 qeerror "If you are using KBUILD_OUTPUT, please set the environment var so that"
310 qeerror "it points to the necessary object directory so that it might find .config." 303 qeerror "it points to the necessary object directory so that it might find .config."
311 return 1 304 return 1
312 fi 305 fi
306
307 KV_LOCAL="${KV_LOCAL}$(get_localversion ${KV_DIR})"
308 KV_LOCAL="${KV_LOCAL}$(linux_chkconfig_string LOCALVERSION)"
309 KV_LOCAL="${KV_LOCAL//\"/}"
310
311 # And we should set KV_FULL to the full expanded version
312 KV_FULL="${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${KV_EXTRA}${KV_LOCAL}"
313
314 qeinfo "Found sources for kernel version:"
315 qeinfo " ${KV_FULL}"
313 316
314 return 0 317 return 0
315} 318}
316 319
317get_running_version() { 320get_running_version() {

Legend:
Removed from v.1.38  
changed lines
  Added in v.1.42

  ViewVC Help
Powered by ViewVC 1.1.20