/[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.86 Revision 1.103
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.86 2008/10/31 22:24:55 dsd Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/linux-mod.eclass,v 1.103 2011/08/09 22:11:53 vapier 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#
41 41
42# @ECLASS-VARIABLE: MODULE_NAMES 42# @ECLASS-VARIABLE: MODULE_NAMES
43# @DESCRIPTION: 43# @DESCRIPTION:
44# It's a string containing the modules to be built automatically using the default 44# It's a string containing the modules to be built automatically using the default
45# src_compile/src_install. It will only make ${BUILD_TARGETS} once in any directory. 45# src_compile/src_install. It will only make ${BUILD_TARGETS} once in any directory.
46
47# 46#
48# The structure of each MODULE_NAMES entry is as follows: 47# The structure of each MODULE_NAMES entry is as follows:
49# 48#
50# modulename(libdir:srcdir:objdir) 49# modulename(libdir:srcdir:objdir)
51# 50#
52# where: 51# where:
53# 52#
54# modulename = name of the module file excluding the .ko 53# modulename = name of the module file excluding the .ko
55# libdir = place in system modules directory where module is installed: 54# libdir = place in system modules directory where module is installed (by default it's misc)
56# srcdir = place for ebuild to cd to before running make 55# srcdir = place for ebuild to cd to before running make (by default it's ${S})
57# objdir = place the .ko and objects are located after make runs 56# objdir = place the .ko and objects are located after make runs (by default it's set to srcdir)
58# 57#
59# 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
60# of code from around line 540 in this eclass: 59# of code from around line 540 in this eclass:
61# 60#
62# einfo "Installing ${modulename} module" 61# einfo "Installing ${modulename} module"
63# cd ${objdir} || die "${objdir} does not exist" 62# cd ${objdir} || die "${objdir} does not exist"
64# insinto /lib/modules/${KV_FULL}/${libdir} 63# insinto /lib/modules/${KV_FULL}/${libdir}
65# doins ${modulename}.${KV_OBJ} || die "doins ${modulename}.${KV_OBJ} failed" 64# doins ${modulename}.${KV_OBJ} || die "doins ${modulename}.${KV_OBJ} failed"
66# 65#
124 123
125# @ECLASS-VARIABLE: KV_OBJ 124# @ECLASS-VARIABLE: KV_OBJ
126# @DESCRIPTION: 125# @DESCRIPTION:
127# It's a read-only variable. It contains the extension of the kernel modules. 126# It's a read-only variable. It contains the extension of the kernel modules.
128 127
129# The order of these is important as both of linux-info and eutils contain
130# set_arch_to_kernel and set_arch_to_portage functions and the ones in eutils
131# are deprecated in favor of the ones in linux-info.
132# See http://bugs.gentoo.org/show_bug.cgi?id=127506
133
134inherit eutils linux-info multilib 128inherit eutils linux-info multilib
135EXPORT_FUNCTIONS pkg_setup pkg_preinst pkg_postinst src_install src_compile pkg_postrm 129EXPORT_FUNCTIONS pkg_setup pkg_preinst pkg_postinst src_install src_compile pkg_postrm
136 130
137IUSE="kernel_linux" 131IUSE="kernel_linux"
138SLOT="0" 132SLOT="0"
139DESCRIPTION="Based on the $ECLASS eclass" 133DESCRIPTION="Based on the $ECLASS eclass"
140RDEPEND="kernel_linux? ( virtual/modutils )" 134RDEPEND="kernel_linux? ( sys-apps/module-init-tools )"
141DEPEND="${RDEPEND} 135DEPEND="${RDEPEND}
142 sys-apps/sed" 136 sys-apps/sed
137 kernel_linux? ( virtual/linux-sources )"
143 138
144# eclass utilities 139# eclass utilities
145# ---------------------------------- 140# ----------------------------------
146 141
147check_vermagic() { 142check_vermagic() {
148 debug-print-function ${FUNCNAME} $* 143 debug-print-function ${FUNCNAME} $*
149 144
150 local curr_gcc_ver=$(gcc -dumpversion) 145 local curr_gcc_ver=$(gcc -dumpversion)
151 local tmpfile old_chost old_gcc_ver result=0 146 local tmpfile old_chost old_gcc_ver result=0
152 147
153 tmpfile=`find ${KV_DIR}/ -iname "*.o.cmd" -exec grep usr/lib/gcc {} \; -quit` 148 tmpfile=`find "${KV_DIR}/" -iname "*.o.cmd" -exec grep usr/lib/gcc {} \; -quit`
154 tmpfile=${tmpfile//*usr/lib} 149 tmpfile=${tmpfile//*usr/lib}
155 tmpfile=${tmpfile//\/include*} 150 tmpfile=${tmpfile//\/include*}
156 old_chost=${tmpfile//*gcc\/} 151 old_chost=${tmpfile//*gcc\/}
157 old_chost=${old_chost//\/*} 152 old_chost=${old_chost//\/*}
158 old_gcc_ver=${tmpfile//*\/} 153 old_gcc_ver=${tmpfile//*\/}
193 # if we haven't determined the version yet, we need too. 188 # if we haven't determined the version yet, we need too.
194 get_version; 189 get_version;
195 190
196 # if the kernel version is greater than 2.6.6 then we should use 191 # if the kernel version is greater than 2.6.6 then we should use
197 # M= instead of SUBDIRS= 192 # M= instead of SUBDIRS=
193 [ ${KV_MAJOR} -eq 3 ] && return 0
198 [ ${KV_MAJOR} -eq 2 -a ${KV_MINOR} -gt 5 -a ${KV_PATCH} -gt 5 ] && \ 194 [ ${KV_MAJOR} -eq 2 -a ${KV_MINOR} -gt 5 -a ${KV_PATCH} -gt 5 ] && \
199 return 0 || return 1 195 return 0 || return 1
200} 196}
201 197
202# @FUNCTION: convert_to_m 198# @FUNCTION: convert_to_m
209 if use_m 205 if use_m
210 then 206 then
211 [ ! -f "${1}" ] && \ 207 [ ! -f "${1}" ] && \
212 die "convert_to_m() requires a filename as an argument" 208 die "convert_to_m() requires a filename as an argument"
213 ebegin "Converting ${1/${WORKDIR}\//} to use M= instead of SUBDIRS=" 209 ebegin "Converting ${1/${WORKDIR}\//} to use M= instead of SUBDIRS="
214 sed -i 's:SUBDIRS=:M=:g' ${1} 210 sed -i 's:SUBDIRS=:M=:g' "${1}"
215 eend $? 211 eend $?
216 fi 212 fi
217} 213}
218 214
219# internal function 215# internal function
226 222
227 # if we haven't determined the version yet, we need too. 223 # if we haven't determined the version yet, we need too.
228 get_version; 224 get_version;
229 225
230 ebegin "Updating module dependencies for ${KV_FULL}" 226 ebegin "Updating module dependencies for ${KV_FULL}"
231 if [ -r ${KV_OUT_DIR}/System.map ] 227 if [ -r "${KV_OUT_DIR}"/System.map ]
232 then 228 then
233 depmod -ae -F ${KV_OUT_DIR}/System.map -b ${ROOT} -r ${KV_FULL} 229 depmod -ae -F "${KV_OUT_DIR}"/System.map -b "${ROOT}" -r ${KV_FULL}
234 eend $? 230 eend $?
235 else 231 else
236 ewarn 232 ewarn
237 ewarn "${KV_OUT_DIR}/System.map not found." 233 ewarn "${KV_OUT_DIR}/System.map not found."
238 ewarn "You must manually update the kernel module dependencies using depmod." 234 ewarn "You must manually update the kernel module dependencies using depmod."
248# It calls the update-modules utility. 244# It calls the update-modules utility.
249update_modules() { 245update_modules() {
250 debug-print-function ${FUNCNAME} $* 246 debug-print-function ${FUNCNAME} $*
251 247
252 if [ -x /sbin/update-modules ] && \ 248 if [ -x /sbin/update-modules ] && \
253 grep -v -e "^#" -e "^$" ${D}/etc/modules.d/* >/dev/null 2>&1; then 249 grep -v -e "^#" -e "^$" "${D}"/etc/modules.d/* >/dev/null 2>&1; then
254 ebegin "Updating modules.conf" 250 ebegin "Updating modules.conf"
255 /sbin/update-modules 251 /sbin/update-modules
256 eend $? 252 eend $?
257 elif [ -x /sbin/update-modules ] && \ 253 elif [ -x /sbin/update-modules ] && \
258 grep -v -e "^#" -e "^$" ${D}/etc/modules.d/* >/dev/null 2>&1; then 254 grep -v -e "^#" -e "^$" "${D}"/etc/modules.d/* >/dev/null 2>&1; then
259 ebegin "Updating modules.conf" 255 ebegin "Updating modules.conf"
260 /sbin/update-modules 256 /sbin/update-modules
261 eend $? 257 eend $?
262 fi 258 fi
263} 259}
268# DESCRIPTION: 264# DESCRIPTION:
269# It updates the location of the database used by the module-rebuild utility. 265# It updates the location of the database used by the module-rebuild utility.
270move_old_moduledb() { 266move_old_moduledb() {
271 debug-print-function ${FUNCNAME} $* 267 debug-print-function ${FUNCNAME} $*
272 268
273 local OLDDIR=${ROOT}/usr/share/module-rebuild/ 269 local OLDDIR="${ROOT}"/usr/share/module-rebuild/
274 local NEWDIR=${ROOT}/var/lib/module-rebuild/ 270 local NEWDIR="${ROOT}"/var/lib/module-rebuild/
275 271
276 if [[ -f ${OLDDIR}/moduledb ]]; then 272 if [[ -f "${OLDDIR}"/moduledb ]]; then
277 [[ ! -d ${NEWDIR} ]] && mkdir -p ${NEWDIR} 273 [[ ! -d "${NEWDIR}" ]] && mkdir -p "${NEWDIR}"
278 [[ ! -f ${NEWDIR}/moduledb ]] && \ 274 [[ ! -f "${NEWDIR}"/moduledb ]] && \
279 mv ${OLDDIR}/moduledb ${NEWDIR}/moduledb 275 mv "${OLDDIR}"/moduledb "${NEWDIR}"/moduledb
280 rm -f ${OLDDIR}/* 276 rm -f "${OLDDIR}"/*
281 rmdir ${OLDDIR} 277 rmdir "${OLDDIR}"
282 fi 278 fi
283} 279}
284 280
285# internal function 281# internal function
286# 282#
288# DESCRIPTION: 284# DESCRIPTION:
289# It adds the package to the /var/lib/module-rebuild/moduledb database used by the module-rebuild utility. 285# It adds the package to the /var/lib/module-rebuild/moduledb database used by the module-rebuild utility.
290update_moduledb() { 286update_moduledb() {
291 debug-print-function ${FUNCNAME} $* 287 debug-print-function ${FUNCNAME} $*
292 288
293 local MODULEDB_DIR=${ROOT}/var/lib/module-rebuild/ 289 local MODULEDB_DIR="${ROOT}"/var/lib/module-rebuild/
294 move_old_moduledb 290 move_old_moduledb
295 291
296 if [[ ! -f ${MODULEDB_DIR}/moduledb ]]; then 292 if [[ ! -f "${MODULEDB_DIR}"/moduledb ]]; then
297 [[ ! -d ${MODULEDB_DIR} ]] && mkdir -p ${MODULEDB_DIR} 293 [[ ! -d "${MODULEDB_DIR}" ]] && mkdir -p "${MODULEDB_DIR}"
298 touch ${MODULEDB_DIR}/moduledb 294 touch "${MODULEDB_DIR}"/moduledb
299 fi 295 fi
300 296
301 if ! grep -qs ${CATEGORY}/${PN}-${PVR} ${MODULEDB_DIR}/moduledb ; then 297 if ! grep -qs ${CATEGORY}/${PN}-${PVR} "${MODULEDB_DIR}"/moduledb ; then
302 einfo "Adding module to moduledb." 298 einfo "Adding module to moduledb."
303 echo "a:1:${CATEGORY}/${PN}-${PVR}" >> ${MODULEDB_DIR}/moduledb 299 echo "a:1:${CATEGORY}/${PN}-${PVR}" >> "${MODULEDB_DIR}"/moduledb
304 fi 300 fi
305} 301}
306 302
307# internal function 303# internal function
308# 304#
311# It removes the package from the /var/lib/module-rebuild/moduledb database used by 307# It removes the package from the /var/lib/module-rebuild/moduledb database used by
312# the module-rebuild utility. 308# the module-rebuild utility.
313remove_moduledb() { 309remove_moduledb() {
314 debug-print-function ${FUNCNAME} $* 310 debug-print-function ${FUNCNAME} $*
315 311
316 local MODULEDB_DIR=${ROOT}/var/lib/module-rebuild/ 312 local MODULEDB_DIR="${ROOT}"/var/lib/module-rebuild/
317 move_old_moduledb 313 move_old_moduledb
318 314
319 if grep -qs ${CATEGORY}/${PN}-${PVR} ${MODULEDB_DIR}/moduledb ; then 315 if grep -qs ${CATEGORY}/${PN}-${PVR} "${MODULEDB_DIR}"/moduledb ; then
320 einfo "Removing ${CATEGORY}/${PN}-${PVR} from moduledb." 316 einfo "Removing ${CATEGORY}/${PN}-${PVR} from moduledb."
321 sed -i -e "/.*${CATEGORY}\/${PN}-${PVR}.*/d" ${MODULEDB_DIR}/moduledb 317 sed -i -e "/.*${CATEGORY}\/${PN}-${PVR}.*/d" "${MODULEDB_DIR}"/moduledb
322 fi 318 fi
323} 319}
324 320
325# @FUNCTION: set_kvobj 321# @FUNCTION: set_kvobj
326# @DESCRIPTION: 322# @DESCRIPTION:
327# It sets the KV_OBJ variable. 323# It sets the KV_OBJ variable.
328set_kvobj() { 324set_kvobj() {
329 debug-print-function ${FUNCNAME} $* 325 debug-print-function ${FUNCNAME} $*
330 326
331 if kernel_is 2 6 327 if kernel_is ge 2 6
332 then 328 then
333 KV_OBJ="ko" 329 KV_OBJ="ko"
334 else 330 else
335 KV_OBJ="o" 331 KV_OBJ="o"
336 fi 332 fi
414 module_modinfo="$(modinfo -p ${currm_path}.${KV_OBJ})" 410 module_modinfo="$(modinfo -p ${currm_path}.${KV_OBJ})"
415 module_config="${T}/modulesd-${currm}" 411 module_config="${T}/modulesd-${currm}"
416 412
417 ebegin "Preparing file for modules.d" 413 ebegin "Preparing file for modules.d"
418 #----------------------------------------------------------------------- 414 #-----------------------------------------------------------------------
419 echo "# modules.d configuration file for ${currm}" >> ${module_config} 415 echo "# modules.d configuration file for ${currm}" >> "${module_config}"
420 #----------------------------------------------------------------------- 416 #-----------------------------------------------------------------------
421 [[ -n ${module_docs} ]] && \ 417 [[ -n ${module_docs} ]] && \
422 echo "# For more information please read:" >> ${module_config} 418 echo "# For more information please read:" >> "${module_config}"
423 for t in ${module_docs} 419 for t in ${module_docs}
424 do 420 do
425 echo "# ${t//*\/}" >> ${module_config} 421 echo "# ${t//*\/}" >> "${module_config}"
426 done 422 done
427 echo >> ${module_config} 423 echo >> "${module_config}"
428 424
429 #----------------------------------------------------------------------- 425 #-----------------------------------------------------------------------
430 if [[ ${module_aliases} -gt 0 ]] 426 if [[ ${module_aliases} -gt 0 ]]
431 then 427 then
432 echo "# Internal Aliases - Do not edit" >> ${module_config} 428 echo "# Internal Aliases - Do not edit" >> "${module_config}"
433 echo "# ------------------------------" >> ${module_config} 429 echo "# ------------------------------" >> "${module_config}"
434 430
435 for((t=0; t<${module_aliases}; t++)) 431 for((t=0; t<${module_aliases}; t++))
436 do 432 do
437 echo "alias $(eval echo \${MODULESD_${currm}_ALIASES[$t]})" \ 433 echo "alias $(eval echo \${MODULESD_${currm}_ALIASES[$t]})" \
438 >> ${module_config} 434 >> "${module_config}"
439 done 435 done
440 echo '' >> ${module_config} 436 echo '' >> "${module_config}"
441 fi 437 fi
442 438
443 #----------------------------------------------------------------------- 439 #-----------------------------------------------------------------------
444 if [[ -n ${module_modinfo} ]] 440 if [[ -n ${module_modinfo} ]]
445 then 441 then
446 echo >> ${module_config} 442 echo >> "${module_config}"
447 echo "# Configurable module parameters" >> ${module_config} 443 echo "# Configurable module parameters" >> "${module_config}"
448 echo "# ------------------------------" >> ${module_config} 444 echo "# ------------------------------" >> "${module_config}"
449 myIFS="${IFS}" 445 myIFS="${IFS}"
450 IFS="$(echo -en "\n\b")" 446 IFS="$(echo -en "\n\b")"
451 447
452 for t in ${module_modinfo} 448 for t in ${module_modinfo}
453 do 449 do
454 myVAR="$(echo ${t#*:} | grep -e " [0-9][ =]" | sed "s:.*\([01][= ]\).*:\1:")" 450 myVAR="$(echo ${t#*:} | grep -e " [0-9][ =]" | sed "s:.*\([01][= ]\).*:\1:")"
455 if [[ -n ${myVAR} ]] 451 if [[ -n ${myVAR} ]]
456 then 452 then
457 module_opts="${module_opts} ${t%%:*}:${myVAR}" 453 module_opts="${module_opts} ${t%%:*}:${myVAR}"
458 fi 454 fi
459 echo -e "# ${t%%:*}:\t${t#*:}" >> ${module_config} 455 echo -e "# ${t%%:*}:\t${t#*:}" >> "${module_config}"
460 done 456 done
461 IFS="${myIFS}" 457 IFS="${myIFS}"
462 echo '' >> ${module_config} 458 echo '' >> "${module_config}"
463 fi 459 fi
464 460
465 #----------------------------------------------------------------------- 461 #-----------------------------------------------------------------------
466 if [[ $(eval echo \${MODULESD_${currm}_ALIASES[0]}) == guess ]] 462 if [[ $(eval echo \${MODULESD_${currm}_ALIASES[0]}) == guess ]]
467 then 463 then
468 # So lets do some guesswork eh? 464 # So lets do some guesswork eh?
469 if [[ -n ${module_opts} ]] 465 if [[ -n ${module_opts} ]]
470 then 466 then
471 echo "# For Example..." >> ${module_config} 467 echo "# For Example..." >> "${module_config}"
472 echo "# --------------" >> ${module_config} 468 echo "# --------------" >> "${module_config}"
473 for t in ${module_opts} 469 for t in ${module_opts}
474 do 470 do
475 echo "# options ${currm} ${t//:*}=${t//*:}" >> ${module_config} 471 echo "# options ${currm} ${t//:*}=${t//*:}" >> "${module_config}"
476 done 472 done
477 echo '' >> ${module_config} 473 echo '' >> "${module_config}"
478 fi 474 fi
479 elif [[ ${module_examples} -gt 0 ]] 475 elif [[ ${module_examples} -gt 0 ]]
480 then 476 then
481 echo "# For Example..." >> ${module_config} 477 echo "# For Example..." >> "${module_config}"
482 echo "# --------------" >> ${module_config} 478 echo "# --------------" >> "${module_config}"
483 for((t=0; t<${module_examples}; t++)) 479 for((t=0; t<${module_examples}; t++))
484 do 480 do
485 echo "options $(eval echo \${MODULESD_${currm}_EXAMPLES[$t]})" \ 481 echo "options $(eval echo \${MODULESD_${currm}_EXAMPLES[$t]})" \
486 >> ${module_config} 482 >> "${module_config}"
487 done 483 done
488 echo '' >> ${module_config} 484 echo '' >> "${module_config}"
489 fi 485 fi
490 486
491 #----------------------------------------------------------------------- 487 #-----------------------------------------------------------------------
492 if [[ ${module_additions} -gt 0 ]] 488 if [[ ${module_additions} -gt 0 ]]
493 then 489 then
494 for((t=0; t<${module_additions}; t++)) 490 for((t=0; t<${module_additions}; t++))
495 do 491 do
496 echo "$(eval echo \${MODULESD_${currm}_ADDITIONS[$t]})" \ 492 echo "$(eval echo \${MODULESD_${currm}_ADDITIONS[$t]})" \
497 >> ${module_config} 493 >> "${module_config}"
498 done 494 done
499 echo '' >> ${module_config} 495 echo '' >> "${module_config}"
500 fi 496 fi
501 497
502 #----------------------------------------------------------------------- 498 #-----------------------------------------------------------------------
503 499
504 # then we install it 500 # then we install it
505 if kernel_is ge 2 6; then 501 if kernel_is ge 2 6; then
506 insinto /etc/modprobe.d 502 insinto /etc/modprobe.d
507 else 503 else
508 insinto /etc/modules.d 504 insinto /etc/modules.d
509 fi 505 fi
510 newins ${module_config} ${currm_path//*\/} 506 newins "${module_config}" "${currm_path//*\/}.conf"
511 507
512 # and install any documentation we might have. 508 # and install any documentation we might have.
513 [[ -n ${module_docs} ]] && dodoc ${module_docs} 509 [[ -n ${module_docs} ]] && dodoc ${module_docs}
514 done 510 done
515 eend 0 511 eend 0
574# configured, verifies that the sources are prepared, verifies that the modules support is builtin 570# 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. 571# in the kernel and sets the object extension KV_OBJ.
576linux-mod_pkg_setup() { 572linux-mod_pkg_setup() {
577 debug-print-function ${FUNCNAME} $* 573 debug-print-function ${FUNCNAME} $*
578 574
575 local is_bin="${MERGE_TYPE}"
576
577 # If we are installing a binpkg, take a different path.
578 # use MERGE_TYPE if available (eapi>=4); else use non-PMS EMERGE_FROM (eapi<4)
579 if has ${EAPI} 0 1 2 3; then
580 is_bin=${EMERGE_FROM}
581 fi
582
583 if [[ ${is_bin} == binary ]]; then
584 linux-mod_pkg_setup_binary
585 return
586 fi
587
579 linux-info_pkg_setup; 588 linux-info_pkg_setup;
580 require_configured_kernel 589 require_configured_kernel
581 check_kernel_built; 590 check_kernel_built;
582 strip_modulenames; 591 strip_modulenames;
583 [[ -n ${MODULE_NAMES} ]] && check_modules_supported 592 [[ -n ${MODULE_NAMES} ]] && check_modules_supported
586 # who intentionally use different kernel and userland compilers can be 595 # who intentionally use different kernel and userland compilers can be
587 # introduced - Jason Wever <weeve@gentoo.org>, 23 Oct 2005 596 # introduced - Jason Wever <weeve@gentoo.org>, 23 Oct 2005
588 #check_vermagic; 597 #check_vermagic;
589} 598}
590 599
600# @FUNCTION: linux-mod_pkg_setup_binary
601# @DESCRIPTION:
602# Perform all kernel option checks non-fatally, as the .config and
603# /proc/config.gz might not be present. Do not do anything that requires kernel
604# sources.
605linux-mod_pkg_setup_binary() {
606 debug-print-function ${FUNCNAME} $*
607 local new_CONFIG_CHECK
608 # ~ needs always to be quoted, else bash expands it.
609 for config in $CONFIG_CHECK ; do
610 optional='~'
611 [[ ${config:0:1} == "~" ]] && optional=''
612 new_CONFIG_CHECK="${new_CONFIG_CHECK} ${optional}${config}"
613 done
614 export CONFIG_CHECK="${new_CONFIG_CHECK}"
615 linux-info_pkg_setup;
616}
617
591strip_modulenames() { 618strip_modulenames() {
592 debug-print-function ${FUNCNAME} $* 619 debug-print-function ${FUNCNAME} $*
593 620
594 local i 621 local i
595 for i in ${MODULE_IGNORE}; do 622 for i in ${MODULE_IGNORE}; do
613 ABI="${KERNEL_ABI}" 640 ABI="${KERNEL_ABI}"
614 641
615 BUILD_TARGETS=${BUILD_TARGETS:-clean module} 642 BUILD_TARGETS=${BUILD_TARGETS:-clean module}
616 strip_modulenames; 643 strip_modulenames;
617 cd "${S}" 644 cd "${S}"
645 touch Module.symvers
618 for i in ${MODULE_NAMES} 646 for i in ${MODULE_NAMES}
619 do 647 do
620 unset libdir srcdir objdir 648 unset libdir srcdir objdir
621 for n in $(find_module_params ${i}) 649 for n in $(find_module_params ${i})
622 do 650 do
626 srcdir=${srcdir:-${S}} 654 srcdir=${srcdir:-${S}}
627 objdir=${objdir:-${srcdir}} 655 objdir=${objdir:-${srcdir}}
628 656
629 if [ ! -f "${srcdir}/.built" ]; 657 if [ ! -f "${srcdir}/.built" ];
630 then 658 then
631 cd ${srcdir} 659 cd "${srcdir}"
660 ln -s "${S}"/Module.symvers Module.symvers
632 einfo "Preparing ${modulename} module" 661 einfo "Preparing ${modulename} module"
633 if [[ -n ${ECONF_PARAMS} ]] 662 if [[ -n ${ECONF_PARAMS} ]]
634 then 663 then
635 econf ${ECONF_PARAMS} || \ 664 econf ${ECONF_PARAMS} || \
636 die "Unable to run econf ${ECONF_PARAMS}" 665 die "Unable to run econf ${ECONF_PARAMS}"
646 LDFLAGS=\"$(get_abi_LDFLAGS)\" \ 675 LDFLAGS=\"$(get_abi_LDFLAGS)\" \
647 ${BUILD_FIXES} \ 676 ${BUILD_FIXES} \
648 ${BUILD_PARAMS} \ 677 ${BUILD_PARAMS} \
649 ${BUILD_TARGETS} " \ 678 ${BUILD_TARGETS} " \
650 || die "Unable to emake HOSTCC="$(tc-getBUILD_CC)" CROSS_COMPILE=${CHOST}- LDFLAGS="$(get_abi_LDFLAGS)" ${BUILD_FIXES} ${BUILD_PARAMS} ${BUILD_TARGETS}" 679 || die "Unable to emake HOSTCC="$(tc-getBUILD_CC)" CROSS_COMPILE=${CHOST}- LDFLAGS="$(get_abi_LDFLAGS)" ${BUILD_FIXES} ${BUILD_PARAMS} ${BUILD_TARGETS}"
680 cd "${OLDPWD}"
651 touch ${srcdir}/.built 681 touch "${srcdir}"/.built
652 cd ${OLDPWD}
653 fi 682 fi
654 done 683 done
655 684
656 set_arch_to_portage 685 set_arch_to_portage
657 ABI="${myABI}" 686 ABI="${myABI}"
684 libdir=${libdir:-misc} 713 libdir=${libdir:-misc}
685 srcdir=${srcdir:-${S}} 714 srcdir=${srcdir:-${S}}
686 objdir=${objdir:-${srcdir}} 715 objdir=${objdir:-${srcdir}}
687 716
688 einfo "Installing ${modulename} module" 717 einfo "Installing ${modulename} module"
689 cd ${objdir} || die "${objdir} does not exist" 718 cd "${objdir}" || die "${objdir} does not exist"
690 insinto /lib/modules/${KV_FULL}/${libdir} 719 insinto /lib/modules/${KV_FULL}/${libdir}
691 doins ${modulename}.${KV_OBJ} || die "doins ${modulename}.${KV_OBJ} failed" 720 doins ${modulename}.${KV_OBJ} || die "doins ${modulename}.${KV_OBJ} failed"
692 cd ${OLDPWD} 721 cd "${OLDPWD}"
693 722
694 generate_modulesd ${objdir}/${modulename} 723 generate_modulesd "${objdir}/${modulename}"
695 done 724 done
696} 725}
697 726
698# @FUNCTION: linux-mod_pkg_preinst 727# @FUNCTION: linux-mod_pkg_preinst
699# @DESCRIPTION: 728# @DESCRIPTION:

Legend:
Removed from v.1.86  
changed lines
  Added in v.1.103

  ViewVC Help
Powered by ViewVC 1.1.20