/[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.63 Revision 1.67
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.63 2009/09/06 23:04:37 robbat2 Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.67 2009/09/06 23:31:47 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 :)
108# And to ensure all the weirdness with crosscompile 108# And to ensure all the weirdness with crosscompile
109inherit toolchain-funcs versionator 109inherit toolchain-funcs versionator
110 110
111EXPORT_FUNCTIONS pkg_setup 111EXPORT_FUNCTIONS pkg_setup
112 112
113DEPEND=""
114RDEPEND=""
115
116[ -z "${I_KNOW_WHAT_I_AM_DOING}" ] && \
113DEPEND="kernel_linux? ( virtual/linux-sources )" 117DEPEND="kernel_linux? ( virtual/linux-sources )"
114RDEPEND=""
115 118
116# Overwritable environment Var's 119# Overwritable environment Var's
117# --------------------------------------- 120# ---------------------------------------
118KERNEL_DIR="${KERNEL_DIR:-${ROOT}usr/src/linux}" 121KERNEL_DIR="${KERNEL_DIR:-${ROOT}usr/src/linux}"
119 122
200 ERROR=0 203 ERROR=0
201 mycat='cat' 204 mycat='cat'
202 205
203 [ -z "${1}" ] && ERROR=1 206 [ -z "${1}" ] && ERROR=1
204 [ ! -f "${2}" ] && ERROR=1 207 [ ! -f "${2}" ] && ERROR=1
205 [ "${2#.gz}" != "${2}" ] && mycat='zcat' 208 [ "${2%.gz}" != "${2}" ] && mycat='zcat'
206 209
207 if [ "${ERROR}" = 1 ] 210 if [ "${ERROR}" = 1 ]
208 then 211 then
209 echo -e "\n" 212 echo -e "\n"
210 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."
552 && KV_EXTRA="-${KV_FULL#*-}" 555 && KV_EXTRA="-${KV_FULL#*-}"
553 fi 556 fi
554 return 0 557 return 0
555} 558}
556 559
560# This next function is named with the eclass prefix to avoid conflicts with
561# some old versionator-like eclass functions.
562
563# @FUNCTION: linux-info_get_any_version
564# @DESCRIPTION:
565# This attempts to find the version of the sources, and otherwise falls back to
566# the version of the running kernel.
567linux-info_get_any_version() {
568 get_version
569 if [[ $? -ne 0 ]]; then
570 ewarn "Unable to calculate Linux Kernel version for build, attempting to use running version"
571 get_running_version
572 fi
573}
574
557 575
558# ebuild check functions 576# ebuild check functions
559# --------------------------------------- 577# ---------------------------------------
560 578
561# @FUNCTION: check_kernel_built 579# @FUNCTION: check_kernel_built
623 # In the case where we don't require a .config, we can now bail out 641 # In the case where we don't require a .config, we can now bail out
624 # if the user has no .config as there is nothing to do. Otherwise 642 # if the user has no .config as there is nothing to do. Otherwise
625 # code later will cause a failure due to missing .config. 643 # code later will cause a failure due to missing .config.
626 if ! linux_config_exists; then 644 if ! linux_config_exists; then
627 ewarn "Unable to check for the following kernel config options due" 645 ewarn "Unable to check for the following kernel config options due"
628 ewarn "to absence of any configured kernel sources:" 646 ewarn "to absence of any configured kernel sources or compiled"
647 ewarn "config:"
629 for config in ${CONFIG_CHECK}; do 648 for config in ${CONFIG_CHECK}; do
630 ewarn " - ${config#\~}" 649 ewarn " - ${config#\~}"
631 done 650 done
632 ewarn "You're on your own to make sure they are set if needed." 651 ewarn "You're on your own to make sure they are set if needed."
633 return 0 652 return 0
634 fi 653 fi
635 else 654 else
636 require_configured_kernel 655 [ -n "${I_KNOW_WHAT_I_AM_DOING}" ] && require_configured_kernel
637 fi 656 fi
638 657
639 einfo "Checking for suitable kernel configuration options..." 658 einfo "Checking for suitable kernel configuration options..."
640 659
641 for config in ${CONFIG_CHECK} 660 for config in ${CONFIG_CHECK}
801# @FUNCTION: linux-info_pkg_setup 820# @FUNCTION: linux-info_pkg_setup
802# @DESCRIPTION: 821# @DESCRIPTION:
803# Force a get_version() call when inherited from linux-mod.eclass and then check if the kernel is configured 822# Force a get_version() call when inherited from linux-mod.eclass and then check if the kernel is configured
804# to support the options specified in CONFIG_CHECK (if not null) 823# to support the options specified in CONFIG_CHECK (if not null)
805linux-info_pkg_setup() { 824linux-info_pkg_setup() {
806 get_version 825 linux-info_get_any_version
807 if [[ $rc -ne 0 ]]; then
808 ewarn "Unable to calculate Linux Kernel version for build, attempting to use running version"
809 get_running_version
810 fi
811 826
812 if kernel_is 2 4; then 827 if kernel_is 2 4; then
813 if [ "$( gcc-major-version )" -eq "4" ] ; then 828 if [ "$( gcc-major-version )" -eq "4" ] ; then
814 echo 829 echo
815 ewarn "Be warned !! >=sys-devel/gcc-4.0.0 isn't supported with" 830 ewarn "Be warned !! >=sys-devel/gcc-4.0.0 isn't supported with"

Legend:
Removed from v.1.63  
changed lines
  Added in v.1.67

  ViewVC Help
Powered by ViewVC 1.1.20