/[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.61 Revision 1.71
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.61 2009/08/30 22:37:06 robbat2 Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.71 2009/09/08 12:34:21 robbat2 Exp $
4# 4#
5# Original author: John Mylchreest <johnm@gentoo.org> 5# Original author: John Mylchreest <johnm@gentoo.org>
6# Maintainer: kernel-misc@gentoo.org 6# Maintainer: kernel-misc@gentoo.org
7# 7#
8# Please direct your bugs to the current eclass maintainer :) 8# Please direct your bugs to the current eclass maintainer :)
11# @MAINTAINER: 11# @MAINTAINER:
12# kernel-misc@gentoo.org 12# kernel-misc@gentoo.org
13# @BLURB: eclass used for accessing kernel related information 13# @BLURB: eclass used for accessing kernel related information
14# @DESCRIPTION: 14# @DESCRIPTION:
15# This eclass is used as a central eclass for accessing kernel 15# This eclass is used as a central eclass for accessing kernel
16# related information for sources already installed. 16# related information for source or binary already installed.
17# It is vital for linux-mod.eclass to function correctly, and is split 17# It is vital for linux-mod.eclass to function correctly, and is split
18# out so that any ebuild behaviour "templates" are abstracted out 18# out so that any ebuild behaviour "templates" are abstracted out
19# using additional eclasses. 19# using additional eclasses.
20#
21# "kernel config" in this file means:
22# The .config of the currently installed sources is used as the first
23# preference, with a fall-back to bundled config (/proc/config.gz) if available.
20 24
21# A Couple of env vars are available to effect usage of this eclass 25# A Couple of env vars are available to effect usage of this eclass
22# These are as follows: 26# These are as follows:
23 27
24# @ECLASS-VARIABLE: KERNEL_DIR 28# @ECLASS-VARIABLE: KERNEL_DIR
36# You can also check that an option doesn't exist by 40# You can also check that an option doesn't exist by
37# prepending it with an exclamation mark (!). 41# prepending it with an exclamation mark (!).
38# 42#
39# e.g.: CONFIG_CHECK="!MTRR" 43# e.g.: CONFIG_CHECK="!MTRR"
40# 44#
41# To simply warn about a missing option, prepend a '~'. 45# To simply warn about a missing option, prepend a '~'.
46# It may be combined with '!'.
47#
48# In general, most checks should be non-fatal. The only time fatal checks should
49# be used is for building kernel modules or cases that a compile will fail
50# without the option.
51#
52# This is to allow usage of binary kernels, and minimal systems without kernel
53# sources.
42 54
43# @ECLASS-VARIABLE: ERROR_<CFG> 55# @ECLASS-VARIABLE: ERROR_<CFG>
44# @DESCRIPTION: 56# @DESCRIPTION:
45# A string containing the error message to display when the check against CONFIG_CHECK 57# A string containing the error message to display when the check against CONFIG_CHECK
46# fails. <CFG> should reference the appropriate option used in CONFIG_CHECK. 58# fails. <CFG> should reference the appropriate option used in CONFIG_CHECK.
87# @ECLASS-VARIABLE: KV_OUT_DIR 99# @ECLASS-VARIABLE: KV_OUT_DIR
88# @DESCRIPTION: 100# @DESCRIPTION:
89# A read-only variable. It's a string containing the kernel object directory, will be KV_DIR unless 101# A read-only variable. It's a string containing the kernel object directory, will be KV_DIR unless
90# KBUILD_OUTPUT is used. This should be used for referencing .config. 102# KBUILD_OUTPUT is used. This should be used for referencing .config.
91 103
104# @ECLASS-VARIABLE: I_KNOW_WHAT_I_AM_DOING
105# @DESCRIPTION:
106# Temporary variable for the migration to making linux-info non-fatal.
107
92# And to ensure all the weirdness with crosscompile 108# And to ensure all the weirdness with crosscompile
93inherit toolchain-funcs versionator 109inherit toolchain-funcs versionator
94 110
95EXPORT_FUNCTIONS pkg_setup 111EXPORT_FUNCTIONS pkg_setup
96 112
113DEPEND=""
114RDEPEND=""
115
116[ -z "${I_KNOW_WHAT_I_AM_DOING}" ] && \
97DEPEND="kernel_linux? ( virtual/linux-sources )" 117DEPEND="kernel_linux? ( virtual/linux-sources )"
98RDEPEND=""
99 118
100# Overwritable environment Var's 119# Overwritable environment Var's
101# --------------------------------------- 120# ---------------------------------------
102KERNEL_DIR="${KERNEL_DIR:-${ROOT}usr/src/linux}" 121KERNEL_DIR="${KERNEL_DIR:-${ROOT}usr/src/linux}"
103 122
178# @DESCRIPTION: 197# @DESCRIPTION:
179# It detects the value of the variable defined in the file configfile. 198# It detects the value of the variable defined in the file configfile.
180# This is done with sed matching an expression only. If the variable is defined, 199# This is done with sed matching an expression only. If the variable is defined,
181# you will run into problems. See getfilevar for those cases. 200# you will run into problems. See getfilevar for those cases.
182getfilevar_noexec() { 201getfilevar_noexec() {
183local ERROR basefname basedname myARCH="${ARCH}" 202 local ERROR basefname basedname mycat myARCH="${ARCH}"
184 ERROR=0 203 ERROR=0
204 mycat='cat'
185 205
186 [ -z "${1}" ] && ERROR=1 206 [ -z "${1}" ] && ERROR=1
187 [ ! -f "${2}" ] && ERROR=1 207 [ ! -f "${2}" ] && ERROR=1
208 [ "${2%.gz}" != "${2}" ] && mycat='zcat'
188 209
189 if [ "${ERROR}" = 1 ] 210 if [ "${ERROR}" = 1 ]
190 then 211 then
191 echo -e "\n" 212 echo -e "\n"
192 eerror "getfilevar_noexec requires 2 variables, with the second a valid file." 213 eerror "getfilevar_noexec requires 2 variables, with the second a valid file."
193 eerror " getfilevar_noexec <VARIABLE> <CONFIGFILE>" 214 eerror " getfilevar_noexec <VARIABLE> <CONFIGFILE>"
194 else 215 else
216 ${mycat} "${2}" | \
195 sed -n \ 217 sed -n \
196 -e "/^[[:space:]]*${1}[[:space:]]*=[[:space:]]*\(.*\)\$/{ 218 -e "/^[[:space:]]*${1}[[:space:]]*=[[:space:]]*\(.*\)\$/{
197 s,^[^=]*[[:space:]]*=[[:space:]]*,,g ; 219 s,^[^=]*[[:space:]]*=[[:space:]]*,,g ;
198 s,[[:space:]]*\$,,g ; 220 s,[[:space:]]*\$,,g ;
199 p 221 p
200 }" \ 222 }"
201 "${2}"
202 fi 223 fi
203} 224}
204 225
226
227# @FUNCTION: linux_config_src_exists
228# @RETURN: true or false
229# @DESCRIPTION:
230# It returns true if .config exists in a build directory otherwise false
231linux_config_src_exists() {
232 [ -s "${KV_OUT_DIR}/.config" ]
233}
234
235# @FUNCTION: linux_config_bin_exists
236# @RETURN: true or false
237# @DESCRIPTION:
238# It returns true if .config exists in /proc, otherwise false
239linux_config_bin_exists() {
240 [ -s "/proc/config.gz" ]
241}
205 242
206# @FUNCTION: linux_config_exists 243# @FUNCTION: linux_config_exists
207# @RETURN: true or false 244# @RETURN: true or false
208# @DESCRIPTION: 245# @DESCRIPTION:
209# It returns true if .config exists otherwise false 246# It returns true if .config exists otherwise false
247#
248# This function MUST be checked before using any of the linux_chkconfig_*
249# functions.
210linux_config_exists() { 250linux_config_exists() {
211 [ -s "${KV_OUT_DIR}/.config" ] 251 linux_config_src_exists || linux_config_bin_exists
212} 252}
213 253
214# @FUNCTION: require_configured_kernel 254# @FUNCTION: require_configured_kernel
215# @DESCRIPTION: 255# @DESCRIPTION:
216# This function verifies that the current kernel is configured (it checks against the existence of .config) 256# This function verifies that the current kernel is configured (it checks against the existence of .config)
217# otherwise it dies. 257# otherwise it dies.
218require_configured_kernel() { 258require_configured_kernel() {
219 if ! linux_config_exists; then 259 if ! linux_config_src_exists; then
220 qeerror "Could not find a usable .config in the kernel source directory." 260 qeerror "Could not find a usable .config in the kernel source directory."
221 qeerror "Please ensure that ${KERNEL_DIR} points to a configured set of Linux sources." 261 qeerror "Please ensure that ${KERNEL_DIR} points to a configured set of Linux sources."
222 qeerror "If you are using KBUILD_OUTPUT, please set the environment var so that" 262 qeerror "If you are using KBUILD_OUTPUT, please set the environment var so that"
223 qeerror "it points to the necessary object directory so that it might find .config." 263 qeerror "it points to the necessary object directory so that it might find .config."
224 die "Kernel not configured; no .config found in ${KV_OUT_DIR}" 264 die "Kernel not configured; no .config found in ${KV_OUT_DIR}"
228# @FUNCTION: linux_chkconfig_present 268# @FUNCTION: linux_chkconfig_present
229# @USAGE: option 269# @USAGE: option
230# @RETURN: true or false 270# @RETURN: true or false
231# @DESCRIPTION: 271# @DESCRIPTION:
232# It checks that CONFIG_<option>=y or CONFIG_<option>=m is present in the current kernel .config 272# It checks that CONFIG_<option>=y or CONFIG_<option>=m is present in the current kernel .config
273# If linux_config_exists returns false, the results of this are UNDEFINED. You
274# MUST call linux_config_exists first.
233linux_chkconfig_present() { 275linux_chkconfig_present() {
234local RESULT 276local RESULT
235 require_configured_kernel 277 [ -z "${I_KNOW_WHAT_I_AM_DOING}" ] && require_configured_kernel
278 local config
279 config="${KV_OUT_DIR}/.config"
280 [ ! -f "${config}" ] && config="/proc/config.gz"
236 RESULT="$(getfilevar_noexec CONFIG_${1} ${KV_OUT_DIR}/.config)" 281 RESULT="$(getfilevar_noexec CONFIG_${1} "${config}")"
237 [ "${RESULT}" = "m" -o "${RESULT}" = "y" ] && return 0 || return 1 282 [ "${RESULT}" = "m" -o "${RESULT}" = "y" ] && return 0 || return 1
238} 283}
239 284
240# @FUNCTION: linux_chkconfig_module 285# @FUNCTION: linux_chkconfig_module
241# @USAGE: option 286# @USAGE: option
242# @RETURN: true or false 287# @RETURN: true or false
243# @DESCRIPTION: 288# @DESCRIPTION:
244# It checks that CONFIG_<option>=m is present in the current kernel .config 289# It checks that CONFIG_<option>=m is present in the current kernel .config
290# If linux_config_exists returns false, the results of this are UNDEFINED. You
291# MUST call linux_config_exists first.
245linux_chkconfig_module() { 292linux_chkconfig_module() {
246local RESULT 293local RESULT
247 require_configured_kernel 294 [ -z "${I_KNOW_WHAT_I_AM_DOING}" ] && require_configured_kernel
295 local config
296 config="${KV_OUT_DIR}/.config"
297 [ ! -f "${config}" ] && config="/proc/config.gz"
248 RESULT="$(getfilevar_noexec CONFIG_${1} ${KV_OUT_DIR}/.config)" 298 RESULT="$(getfilevar_noexec CONFIG_${1} "${config}")"
249 [ "${RESULT}" = "m" ] && return 0 || return 1 299 [ "${RESULT}" = "m" ] && return 0 || return 1
250} 300}
251 301
252# @FUNCTION: linux_chkconfig_builtin 302# @FUNCTION: linux_chkconfig_builtin
253# @USAGE: option 303# @USAGE: option
254# @RETURN: true or false 304# @RETURN: true or false
255# @DESCRIPTION: 305# @DESCRIPTION:
256# It checks that CONFIG_<option>=y is present in the current kernel .config 306# It checks that CONFIG_<option>=y is present in the current kernel .config
307# If linux_config_exists returns false, the results of this are UNDEFINED. You
308# MUST call linux_config_exists first.
257linux_chkconfig_builtin() { 309linux_chkconfig_builtin() {
258local RESULT 310local RESULT
259 require_configured_kernel 311 [ -z "${I_KNOW_WHAT_I_AM_DOING}" ] && require_configured_kernel
312 local config
313 config="${KV_OUT_DIR}/.config"
314 [ ! -f "${config}" ] && config="/proc/config.gz"
260 RESULT="$(getfilevar_noexec CONFIG_${1} ${KV_OUT_DIR}/.config)" 315 RESULT="$(getfilevar_noexec CONFIG_${1} "${config}")"
261 [ "${RESULT}" = "y" ] && return 0 || return 1 316 [ "${RESULT}" = "y" ] && return 0 || return 1
262} 317}
263 318
264# @FUNCTION: linux_chkconfig_string 319# @FUNCTION: linux_chkconfig_string
265# @USAGE: option 320# @USAGE: option
266# @RETURN: CONFIG_<option> 321# @RETURN: CONFIG_<option>
267# @DESCRIPTION: 322# @DESCRIPTION:
268# It prints the CONFIG_<option> value of the current kernel .config (it requires a configured kernel). 323# It prints the CONFIG_<option> value of the current kernel .config (it requires a configured kernel).
324# If linux_config_exists returns false, the results of this are UNDEFINED. You
325# MUST call linux_config_exists first.
269linux_chkconfig_string() { 326linux_chkconfig_string() {
270 require_configured_kernel 327 [ -z "${I_KNOW_WHAT_I_AM_DOING}" ] && require_configured_kernel
328 local config
329 config="${KV_OUT_DIR}/.config"
330 [ ! -f "${config}" ] && config="/proc/config.gz"
271 getfilevar_noexec "CONFIG_${1}" "${KV_OUT_DIR}/.config" 331 getfilevar_noexec "CONFIG_${1}" "${config}"
272} 332}
273 333
274# Versioning Functions 334# Versioning Functions
275# --------------------------------------- 335# ---------------------------------------
276 336
292 352
293# got the jist yet? 353# got the jist yet?
294 354
295kernel_is() { 355kernel_is() {
296 # if we haven't determined the version yet, we need to. 356 # if we haven't determined the version yet, we need to.
297 get_version 357 linux-info_get_any_version
358
298 local operator test value x=0 y=0 z=0 359 local operator test value x=0 y=0 z=0
299 360
300 case ${1} in 361 case ${1} in
301 lt) operator="-lt"; shift;; 362 -lt|lt) operator="-lt"; shift;;
302 gt) operator="-gt"; shift;; 363 -gt|gt) operator="-gt"; shift;;
303 le) operator="-le"; shift;; 364 -le|le) operator="-le"; shift;;
304 ge) operator="-ge"; shift;; 365 -ge|ge) operator="-ge"; shift;;
305 eq) operator="-eq"; shift;; 366 -eq|eq) operator="-eq"; shift;;
306 *) operator="-eq";; 367 *) operator="-eq";;
307 esac 368 esac
308 369
309 for x in ${@}; do 370 for x in ${@}; do
310 for((y=0; y<$((3 - ${#x})); y++)); do value="${value}0"; done 371 for((y=0; y<$((3 - ${#x})); y++)); do value="${value}0"; done
311 value="${value}${x}" 372 value="${value}${x}"
338 done 399 done
339 x=${x/ /} 400 x=${x/ /}
340 echo ${x} 401 echo ${x}
341} 402}
342 403
404# internal variable, so we know to only print the warning once
405get_version_warning_done=
406
343# @FUNCTION: get_version 407# @FUNCTION: get_version
344# @DESCRIPTION: 408# @DESCRIPTION:
345# It gets the version of the kernel inside KERNEL_DIR and populates the KV_FULL variable 409# It gets the version of the kernel inside KERNEL_DIR and populates the KV_FULL variable
346# (if KV_FULL is already set it does nothing). 410# (if KV_FULL is already set it does nothing).
347# 411#
360 # if we dont know KV_FULL, then we need too. 424 # if we dont know KV_FULL, then we need too.
361 # make sure KV_DIR isnt set since we need to work it out via KERNEL_DIR 425 # make sure KV_DIR isnt set since we need to work it out via KERNEL_DIR
362 unset KV_DIR 426 unset KV_DIR
363 427
364 # KV_DIR will contain the full path to the sources directory we should use 428 # KV_DIR will contain the full path to the sources directory we should use
429 [ -z "${get_version_warning_done}" ] && \
365 qeinfo "Determining the location of the kernel source code" 430 qeinfo "Determining the location of the kernel source code"
366 [ -h "${KERNEL_DIR}" ] && KV_DIR="$(readlink -f ${KERNEL_DIR})" 431 [ -h "${KERNEL_DIR}" ] && KV_DIR="$(readlink -f ${KERNEL_DIR})"
367 [ -d "${KERNEL_DIR}" ] && KV_DIR="${KERNEL_DIR}" 432 [ -d "${KERNEL_DIR}" ] && KV_DIR="${KERNEL_DIR}"
368 433
369 if [ -z "${KV_DIR}" ] 434 if [ -z "${KV_DIR}" ]
370 then 435 then
436 if [ -z "${get_version_warning_done}" ]; then
437 get_version_warning_done=1
371 qeerror "Unable to find kernel sources at ${KERNEL_DIR}" 438 qeerror "Unable to find kernel sources at ${KERNEL_DIR}"
372 qeinfo "This package requires Linux sources." 439 #qeinfo "This package requires Linux sources."
373 if [ "${KERNEL_DIR}" == "/usr/src/linux" ] ; then 440 if [ "${KERNEL_DIR}" == "/usr/src/linux" ] ; then
374 qeinfo "Please make sure that ${KERNEL_DIR} points at your running kernel, " 441 qeinfo "Please make sure that ${KERNEL_DIR} points at your running kernel, "
375 qeinfo "(or the kernel you wish to build against)." 442 qeinfo "(or the kernel you wish to build against)."
376 qeinfo "Alternatively, set the KERNEL_DIR environment variable to the kernel sources location" 443 qeinfo "Alternatively, set the KERNEL_DIR environment variable to the kernel sources location"
377 else 444 else
378 qeinfo "Please ensure that the KERNEL_DIR environment variable points at full Linux sources of the kernel you wish to compile against." 445 qeinfo "Please ensure that the KERNEL_DIR environment variable points at full Linux sources of the kernel you wish to compile against."
446 fi
379 fi 447 fi
380 return 1 448 return 1
381 fi 449 fi
382 450
451 if [ -z "${get_version_warning_done}" ]; then
383 qeinfo "Found kernel source directory:" 452 qeinfo "Found kernel source directory:"
384 qeinfo " ${KV_DIR}" 453 qeinfo " ${KV_DIR}"
454 fi
385 455
386 if [ ! -s "${KV_DIR}/Makefile" ] 456 if [ ! -s "${KV_DIR}/Makefile" ]
387 then 457 then
458 if [ -z "${get_version_warning_done}" ]; then
459 get_version_warning_done=1
388 qeerror "Could not find a Makefile in the kernel source directory." 460 qeerror "Could not find a Makefile in the kernel source directory."
389 qeerror "Please ensure that ${KERNEL_DIR} points to a complete set of Linux sources" 461 qeerror "Please ensure that ${KERNEL_DIR} points to a complete set of Linux sources"
462 fi
390 return 1 463 return 1
391 fi 464 fi
392 465
393 # OK so now we know our sources directory, but they might be using 466 # OK so now we know our sources directory, but they might be using
394 # KBUILD_OUTPUT, and we need this for .config and localversions-* 467 # KBUILD_OUTPUT, and we need this for .config and localversions-*
408 KV_PATCH="$(getfilevar_noexec SUBLEVEL ${KV_DIR}/Makefile)" 481 KV_PATCH="$(getfilevar_noexec SUBLEVEL ${KV_DIR}/Makefile)"
409 KV_EXTRA="$(getfilevar_noexec EXTRAVERSION ${KV_DIR}/Makefile)" 482 KV_EXTRA="$(getfilevar_noexec EXTRAVERSION ${KV_DIR}/Makefile)"
410 483
411 if [ -z "${KV_MAJOR}" -o -z "${KV_MINOR}" -o -z "${KV_PATCH}" ] 484 if [ -z "${KV_MAJOR}" -o -z "${KV_MINOR}" -o -z "${KV_PATCH}" ]
412 then 485 then
486 if [ -z "${get_version_warning_done}" ]; then
487 get_version_warning_done=1
413 qeerror "Could not detect kernel version." 488 qeerror "Could not detect kernel version."
414 qeerror "Please ensure that ${KERNEL_DIR} points to a complete set of Linux sources." 489 qeerror "Please ensure that ${KERNEL_DIR} points to a complete set of Linux sources."
490 fi
415 return 1 491 return 1
416 fi 492 fi
417 493
418 # and in newer versions we can also pull LOCALVERSION if it is set. 494 # and in newer versions we can also pull LOCALVERSION if it is set.
419 # but before we do this, we need to find if we use a different object directory. 495 # but before we do this, we need to find if we use a different object directory.
433 fi 509 fi
434 # and if we STILL have not got it, then we better just set it to KV_DIR 510 # and if we STILL have not got it, then we better just set it to KV_DIR
435 KV_OUT_DIR="${KV_OUT_DIR:-${KV_DIR}}" 511 KV_OUT_DIR="${KV_OUT_DIR:-${KV_DIR}}"
436 512
437 KV_LOCAL="${KV_LOCAL}$(get_localversion ${KV_DIR})" 513 KV_LOCAL="${KV_LOCAL}$(get_localversion ${KV_DIR})"
438 if linux_config_exists; then 514 if linux_config_src_exists; then
439 KV_LOCAL="${KV_LOCAL}$(linux_chkconfig_string LOCALVERSION)" 515 KV_LOCAL="${KV_LOCAL}$(linux_chkconfig_string LOCALVERSION)"
440 KV_LOCAL="${KV_LOCAL//\"/}" 516 KV_LOCAL="${KV_LOCAL//\"/}"
441 517
442 # For things like git that can append extra stuff: 518 # For things like git that can append extra stuff:
443 [ -e ${KV_DIR}/scripts/setlocalversion ] && 519 [ -e ${KV_DIR}/scripts/setlocalversion ] &&
480 && KV_EXTRA="-${KV_FULL#*-}" 556 && KV_EXTRA="-${KV_FULL#*-}"
481 fi 557 fi
482 return 0 558 return 0
483} 559}
484 560
561# This next function is named with the eclass prefix to avoid conflicts with
562# some old versionator-like eclass functions.
563
564# @FUNCTION: linux-info_get_any_version
565# @DESCRIPTION:
566# This attempts to find the version of the sources, and otherwise falls back to
567# the version of the running kernel.
568linux-info_get_any_version() {
569 get_version
570 if [[ $? -ne 0 ]]; then
571 ewarn "Unable to calculate Linux Kernel version for build, attempting to use running version"
572 get_running_version
573 fi
574}
575
485 576
486# ebuild check functions 577# ebuild check functions
487# --------------------------------------- 578# ---------------------------------------
488 579
489# @FUNCTION: check_kernel_built 580# @FUNCTION: check_kernel_built
533check_extra_config() { 624check_extra_config() {
534 local config negate die error reworkmodulenames 625 local config negate die error reworkmodulenames
535 local soft_errors_count=0 hard_errors_count=0 config_required=0 626 local soft_errors_count=0 hard_errors_count=0 config_required=0
536 627
537 # if we haven't determined the version yet, we need to 628 # if we haven't determined the version yet, we need to
538 get_version 629 linux-info_get_any_version
539 630
540 # Determine if we really need a .config. The only time when we don't need 631 # Determine if we really need a .config. The only time when we don't need
541 # one is when all of the CONFIG_CHECK options are prefixed with "~". 632 # one is when all of the CONFIG_CHECK options are prefixed with "~".
542 for config in ${CONFIG_CHECK} 633 for config in ${CONFIG_CHECK}
543 do 634 do
551 # In the case where we don't require a .config, we can now bail out 642 # In the case where we don't require a .config, we can now bail out
552 # if the user has no .config as there is nothing to do. Otherwise 643 # if the user has no .config as there is nothing to do. Otherwise
553 # code later will cause a failure due to missing .config. 644 # code later will cause a failure due to missing .config.
554 if ! linux_config_exists; then 645 if ! linux_config_exists; then
555 ewarn "Unable to check for the following kernel config options due" 646 ewarn "Unable to check for the following kernel config options due"
556 ewarn "to absence of any configured kernel sources:" 647 ewarn "to absence of any configured kernel sources or compiled"
648 ewarn "config:"
557 for config in ${CONFIG_CHECK}; do 649 for config in ${CONFIG_CHECK}; do
558 ewarn " - ${config#\~}" 650 ewarn " - ${config#\~}"
559 done 651 done
560 ewarn "You're on your own to make sure they are set if needed." 652 ewarn "You're on your own to make sure they are set if needed."
561 return 0 653 return 0
562 fi 654 fi
563 else 655 else
564 require_configured_kernel 656 [ -n "${I_KNOW_WHAT_I_AM_DOING}" ] && require_configured_kernel
565 fi 657 fi
566 658
567 einfo "Checking for suitable kernel configuration options..." 659 einfo "Checking for suitable kernel configuration options..."
568 660
569 for config in ${CONFIG_CHECK} 661 for config in ${CONFIG_CHECK}
729# @FUNCTION: linux-info_pkg_setup 821# @FUNCTION: linux-info_pkg_setup
730# @DESCRIPTION: 822# @DESCRIPTION:
731# Force a get_version() call when inherited from linux-mod.eclass and then check if the kernel is configured 823# Force a get_version() call when inherited from linux-mod.eclass and then check if the kernel is configured
732# to support the options specified in CONFIG_CHECK (if not null) 824# to support the options specified in CONFIG_CHECK (if not null)
733linux-info_pkg_setup() { 825linux-info_pkg_setup() {
734 get_version || die "Unable to calculate Linux Kernel version" 826 linux-info_get_any_version
735 827
736 if kernel_is 2 4; then 828 if kernel_is 2 4; then
737 if [ "$( gcc-major-version )" -eq "4" ] ; then 829 if [ "$( gcc-major-version )" -eq "4" ] ; then
738 echo 830 echo
739 ewarn "Be warned !! >=sys-devel/gcc-4.0.0 isn't supported with" 831 ewarn "Be warned !! >=sys-devel/gcc-4.0.0 isn't supported with"

Legend:
Removed from v.1.61  
changed lines
  Added in v.1.71

  ViewVC Help
Powered by ViewVC 1.1.20