/[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.32 Revision 1.33
1# Copyright 1999-2004 Gentoo Foundation 1# Copyright 1999-2004 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.32 2005/03/28 09:27:31 johnm Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/linux-mod.eclass,v 1.33 2005/04/11 20:02:06 johnm Exp $
4 4
5# Description: This eclass is used to interface with linux-info in such a way 5# Description: This eclass is used to interface with linux-info in such a way
6# to provide the functionality required and initial functions 6# to provide the functionality required and initial functions
7# required to install external modules against a kernel source 7# required to install external modules against a kernel source
8# tree. 8# tree.
80 80
81 81
82inherit linux-info 82inherit linux-info
83ECLASS=linux-mod 83ECLASS=linux-mod
84INHERITED="$INHERITED $ECLASS" 84INHERITED="$INHERITED $ECLASS"
85EXPORT_FUNCTIONS pkg_setup pkg_postinst src_install src_compile \ 85EXPORT_FUNCTIONS pkg_setup pkg_postinst src_install src_compile
86 src_compile_userland src_install_userland
87 86
88SLOT="0" 87SLOT="0"
89DESCRIPTION="Based on the $ECLASS eclass" 88DESCRIPTION="Based on the $ECLASS eclass"
90DEPEND="virtual/linux-sources 89DEPEND="virtual/linux-sources
91 sys-apps/sed 90 sys-apps/sed
92 virtual/modutils" 91 virtual/modutils
93 92 pcmcia? ( virtual/pcmcia )"
94 93
95# eclass utilities 94# eclass utilities
96# ---------------------------------- 95# ----------------------------------
96
97unpack_pcmcia_sources() {
98 # So while the two eclasses exist side-by-side and also the ebuilds inherit
99 # both we need to check for PCMCIA_SOURCE_DIR, and if we find it, then we
100 # bail out and assume pcmcia.eclass is working on it.
101 [[ -n ${PCMCIA_SOURCE_DIR} ]] && return 1
102
103 if [[ -f "${1}" ]]; then
104 PCMCIA_SOURCE_DIR="${WORKDIR}/pcmcia-cs/"
105
106 ebegin "Decompressing pcmcia-cs sources"
107 mkdir -p ${PCMCIA_SOURCE_DIR}
108 tar -xjf ${1} -C ${PCMCIA_SOURCE_DIR}
109 eend $?
110
111 if [[ -f ${PCMCIA_SOURCE_DIR}/pcmcia-cs-version ]]; then
112 PCMCIA_VERSION=$(cat ${PCMCIA_SOURCE_DIR}/pcmcia-cs-version)
113 einfo "Found pcmcia-cs-${PCMCIA_VERSION}"
114 fi
115 fi
116}
117
118# Dummy function for compatibility.
119pcmcia_configure() { return 0; }
120
121pcmcia_src_unpack() {
122 local pcmcia_tbz="${ROOT}/usr/src/pcmcia-cs/pcmcia-cs-build-env.tbz2"
123
124 # if the kernel has pcmcia support built in, then we just ignore all this.
125 if linux_chkconfig_present PCMCIA; then
126 einfo "Kernel based PCMCIA support has been detected."
127 else
128 if kernel_is 2 4; then
129 unpack_pcmcia_sources ${pcmcia_tbz};
130 else
131 einfo "We have detected that you are running a 2.6 kernel"
132 einfo "but you are not using the built-in PCMCIA support."
133 einfo "We will assume you know what you are doing, but please"
134 einfo "consider using the built in PCMCIA support instead."
135 sleep 10
136
137 unpack_pcmcia_sources ${pcmcia_tbz};
138 fi
139 fi
140}
97 141
98use_m() { 142use_m() {
99 # if we haven't determined the version yet, we need too. 143 # if we haven't determined the version yet, we need too.
100 get_version; 144 get_version;
101 145
372 check_kernel_built; 416 check_kernel_built;
373 check_modules_supported; 417 check_modules_supported;
374 set_kvobj; 418 set_kvobj;
375} 419}
376 420
377linux-mod_src_compile_userland() {
378 return 0
379}
380
381linux-mod_src_install_userland() {
382 return 0
383}
384
385linux-mod_src_compile() { 421linux-mod_src_compile() {
386 local modulename libdir srcdir objdir i n myARCH="${ARCH}" 422 local modulename libdir srcdir objdir i n myARCH="${ARCH}"
387 unset ARCH 423 unset ARCH
388 424
389 BUILD_TARGETS=${BUILD_TARGETS:-clean module} 425 BUILD_TARGETS=${BUILD_TARGETS:-clean module}

Legend:
Removed from v.1.32  
changed lines
  Added in v.1.33

  ViewVC Help
Powered by ViewVC 1.1.20