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

Diff of /eclass/linux-mod.eclass

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

Revision 1.96 Revision 1.100
1# Copyright 1999-2004 Gentoo Foundation 1# Copyright 1999-2011 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-mod.eclass,v 1.96 2010/01/10 09:38:50 robbat2 Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/linux-mod.eclass,v 1.100 2011/04/24 18:55:20 ulm Exp $
4 4
5# Author(s): John Mylchreest <johnm@gentoo.org>, 5# Author(s): John Mylchreest <johnm@gentoo.org>,
6# Stefan Schweizer <genstef@gentoo.org> 6# Stefan Schweizer <genstef@gentoo.org>
7# Maintainer: kernel-misc@gentoo.org 7# Maintainer: kernel-misc@gentoo.org
8# 8#
55# srcdir = place for ebuild to cd to before running make (by default it's ${S}) 55# srcdir = place for ebuild to cd to before running make (by default it's ${S})
56# objdir = place the .ko and objects are located after make runs (by default it's set to srcdir) 56# objdir = place the .ko and objects are located after make runs (by default it's set to srcdir)
57# 57#
58# To get an idea of how these variables are used, here's a few lines 58# To get an idea of how these variables are used, here's a few lines
59# of code from around line 540 in this eclass: 59# of code from around line 540 in this eclass:
60# 60#
61# einfo "Installing ${modulename} module" 61# einfo "Installing ${modulename} module"
62# cd ${objdir} || die "${objdir} does not exist" 62# cd ${objdir} || die "${objdir} does not exist"
63# insinto /lib/modules/${KV_FULL}/${libdir} 63# insinto /lib/modules/${KV_FULL}/${libdir}
64# doins ${modulename}.${KV_OBJ} || die "doins ${modulename}.${KV_OBJ} failed" 64# doins ${modulename}.${KV_OBJ} || die "doins ${modulename}.${KV_OBJ} failed"
65# 65#
134EXPORT_FUNCTIONS pkg_setup pkg_preinst pkg_postinst src_install src_compile pkg_postrm 134EXPORT_FUNCTIONS pkg_setup pkg_preinst pkg_postinst src_install src_compile pkg_postrm
135 135
136IUSE="kernel_linux" 136IUSE="kernel_linux"
137SLOT="0" 137SLOT="0"
138DESCRIPTION="Based on the $ECLASS eclass" 138DESCRIPTION="Based on the $ECLASS eclass"
139RDEPEND="kernel_linux? ( virtual/modutils )" 139RDEPEND="kernel_linux? ( sys-apps/module-init-tools )"
140DEPEND="${RDEPEND} 140DEPEND="${RDEPEND}
141 sys-apps/sed 141 sys-apps/sed
142 kernel_linux? ( virtual/linux-sources )" 142 kernel_linux? ( virtual/linux-sources )"
143 143
144# eclass utilities 144# eclass utilities
574# configured, verifies that the sources are prepared, verifies that the modules support is builtin 574# configured, verifies that the sources are prepared, verifies that the modules support is builtin
575# in the kernel and sets the object extension KV_OBJ. 575# in the kernel and sets the object extension KV_OBJ.
576linux-mod_pkg_setup() { 576linux-mod_pkg_setup() {
577 debug-print-function ${FUNCNAME} $* 577 debug-print-function ${FUNCNAME} $*
578 578
579 # If we are installing a binpkg, take a different path.
580 if [[ $EMERGE_FROM == binary ]]; then
581 linux-mod_pkg_setup_binary
582 return
583 fi
584
579 linux-info_pkg_setup; 585 linux-info_pkg_setup;
580 require_configured_kernel 586 require_configured_kernel
581 check_kernel_built; 587 check_kernel_built;
582 strip_modulenames; 588 strip_modulenames;
583 [[ -n ${MODULE_NAMES} ]] && check_modules_supported 589 [[ -n ${MODULE_NAMES} ]] && check_modules_supported
584 set_kvobj; 590 set_kvobj;
585 # Commented out with permission from johnm until a fixed version for arches 591 # Commented out with permission from johnm until a fixed version for arches
586 # who intentionally use different kernel and userland compilers can be 592 # who intentionally use different kernel and userland compilers can be
587 # introduced - Jason Wever <weeve@gentoo.org>, 23 Oct 2005 593 # introduced - Jason Wever <weeve@gentoo.org>, 23 Oct 2005
588 #check_vermagic; 594 #check_vermagic;
595}
596
597# @FUNCTION: linux-mod_pkg_setup_binary
598# @DESCRIPTION:
599# Perform all kernel option checks non-fatally, as the .config and
600# /proc/config.gz might not be present. Do not do anything that requires kernel
601# sources.
602linux-mod_pkg_setup_binary() {
603 debug-print-function ${FUNCNAME} $*
604 local new_CONFIG_CHECK
605 # ~ needs always to be quoted, else bash expands it.
606 for config in $CONFIG_CHECK ; do
607 optional='~'
608 [[ ${config:0:1} == "~" ]] && optional=''
609 new_CONFIG_CHECK="${new_CONFIG_CHECK} ${optional}${config}"
610 done
611 export CONFIG_CHECK="${new_CONFIG_CHECK}"
612 linux-info_pkg_setup;
589} 613}
590 614
591strip_modulenames() { 615strip_modulenames() {
592 debug-print-function ${FUNCNAME} $* 616 debug-print-function ${FUNCNAME} $*
593 617

Legend:
Removed from v.1.96  
changed lines
  Added in v.1.100

  ViewVC Help
Powered by ViewVC 1.1.20