/[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.21 Revision 1.22
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.21 2005/01/16 12:24:23 johnm Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/linux-mod.eclass,v 1.22 2005/01/16 22:54:56 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.
16# These are as follows: 16# These are as follows:
17# 17#
18# Env Var Option Default Description 18# Env Var Option Default Description
19# KERNEL_DIR <string> /usr/src/linux The directory containing kernel 19# KERNEL_DIR <string> /usr/src/linux The directory containing kernel
20# the target kernel sources. 20# the target kernel sources.
21# ECONF_PARAMS <string> The parameters to pass to econf.
22# If this is not set, then econf isn't
23# run.
21# BUILD_PARAMS <string> The parameters to pass to make. 24# BUILD_PARAMS <string> The parameters to pass to emake.
22# BUILD_TARGETS <string> clean modules The build targets to pass to make. 25# BUILD_TARGETS <string> clean modules The build targets to pass to make.
23# MODULE_NAMES <string> This is the modules which are 26# MODULE_NAMES <string> This is the modules which are
24# to be built automatically using the 27# to be built automatically using the
25# default pkg_compile/install. They 28# default pkg_compile/install. They
26# are explained properly below. 29# are explained properly below.
232 for i in ${MODULE_IGNORE} 235 for i in ${MODULE_IGNORE}
233 do 236 do
234 MODULE_NAMES=${MODULE_NAMES//${i}(*} 237 MODULE_NAMES=${MODULE_NAMES//${i}(*}
235 done 238 done
236 239
240 if [[ -n ${MODULE_NAMES} ]]
241 then
237 einfo "If you would like to load this module automatically upon boot" 242 einfo "If you would like to load this module automatically upon boot"
238 einfo "please type the following as root:" 243 einfo "please type the following as root:"
239 for i in ${MODULE_NAMES} 244 for i in ${MODULE_NAMES}
240 do 245 do
241 for n in $(find_module_params ${i}) 246 for n in $(find_module_params ${i})
242 do 247 do
243 eval ${n/:*}=${n/*:/} 248 eval ${n/:*}=${n/*:/}
244 done 249 done
245 libdir=${libdir:-misc}
246 srcdir=${srcdir:-${S}}
247 objdir=${objdir:-${srcdir}}
248
249 einfo " # echo \"${modulename}\" >> ${file}" 250 einfo " # echo \"${modulename}\" >> ${file}"
250 done 251 done
251 echo 252 einfo
253 fi
252} 254}
253 255
254find_module_params() { 256find_module_params() {
255 local matched_offset=0 matched_opts=0 test="${@}" temp_var result 257 local matched_offset=0 matched_opts=0 test="${@}" temp_var result
256 local i=0 y=0 z=0 258 local i=0 y=0 z=0
324 326
325 if [ ! -f "${srcdir}/.built" ]; 327 if [ ! -f "${srcdir}/.built" ];
326 then 328 then
327 cd ${srcdir} 329 cd ${srcdir}
328 einfo "Preparing ${modulename} module" 330 einfo "Preparing ${modulename} module"
331 if [[ -n ${ECONF_PARAMS} ]]
332 then
333 econf ${ECONF_PARAMS} || \
334 die "Unable to run econf ${ECONF_PARAMS}"
335 fi
336
329 emake ${BUILD_FIXES} ${BUILD_PARAMS} ${BUILD_TARGETS} \ 337 emake ${BUILD_FIXES} ${BUILD_PARAMS} ${BUILD_TARGETS} \
330 || die "Unable to make \ 338 || die "Unable to make \
331 ${BUILD_FIXES} ${BUILD_PARAMS} ${BUILD_TARGETS}." 339 ${BUILD_FIXES} ${BUILD_PARAMS} ${BUILD_TARGETS}."
332 touch ${srcdir}/.built 340 touch ${srcdir}/.built
333 cd ${OLDPWD} 341 cd ${OLDPWD}

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.22

  ViewVC Help
Powered by ViewVC 1.1.20