| 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.64 2006/05/11 08:23:43 johnm Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/linux-mod.eclass,v 1.66 2006/06/20 19:47:37 vapier 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. |
| … | |
… | |
| 82 | # set_arch_to_kernel and set_arch_to_portage functions and the ones in eutils |
82 | # set_arch_to_kernel and set_arch_to_portage functions and the ones in eutils |
| 83 | # are deprecated in favor of the ones in linux-info. |
83 | # are deprecated in favor of the ones in linux-info. |
| 84 | # See http://bugs.gentoo.org/show_bug.cgi?id=127506 |
84 | # See http://bugs.gentoo.org/show_bug.cgi?id=127506 |
| 85 | |
85 | |
| 86 | inherit eutils linux-info multilib |
86 | inherit eutils linux-info multilib |
| 87 | EXPORT_FUNCTIONS pkg_setup pkg_postinst src_install src_compile pkg_postrm |
87 | EXPORT_FUNCTIONS pkg_setup pkg_preinst pkg_postinst src_install src_compile pkg_postrm |
| 88 | |
88 | |
| 89 | IUSE="" # don't put pcmcia here, rather in the ebuilds that actually support pcmcia |
89 | IUSE="" # don't put pcmcia here, rather in the ebuilds that actually support pcmcia |
| 90 | SLOT="0" |
90 | SLOT="0" |
| 91 | DESCRIPTION="Based on the $ECLASS eclass" |
91 | DESCRIPTION="Based on the $ECLASS eclass" |
| 92 | RDEPEND="virtual/modutils |
92 | RDEPEND="kernel_linux? ( virtual/modutils |
| 93 | pcmcia? ( virtual/pcmcia )" |
93 | pcmcia? ( virtual/pcmcia ) )" |
| 94 | DEPEND="sys-apps/sed |
94 | DEPEND="${RDEPEND} |
| 95 | pcmcia? ( virtual/pcmcia )" |
95 | sys-apps/sed" |
| 96 | |
96 | |
| 97 | # eclass utilities |
97 | # eclass utilities |
| 98 | # ---------------------------------- |
98 | # ---------------------------------- |
| 99 | |
99 | |
| 100 | check_vermagic() { |
100 | check_vermagic() { |
| … | |
… | |
| 510 | die "Unable to run econf ${ECONF_PARAMS}" |
510 | die "Unable to run econf ${ECONF_PARAMS}" |
| 511 | fi |
511 | fi |
| 512 | |
512 | |
| 513 | emake HOSTCC=${CC_HOSTCC} CC=${CC_CC}\ |
513 | emake HOSTCC=${CC_HOSTCC} CC=${CC_CC}\ |
| 514 | ${BUILD_FIXES} ${BUILD_PARAMS} ${BUILD_TARGETS} \ |
514 | ${BUILD_FIXES} ${BUILD_PARAMS} ${BUILD_TARGETS} \ |
| 515 | || die "Unable to make \ |
|
|
| 516 | ${BUILD_FIXES} ${BUILD_PARAMS} ${BUILD_TARGETS}." |
515 | || die "Unable to make ${BUILD_FIXES} ${BUILD_PARAMS} ${BUILD_TARGETS}." |
| 517 | touch ${srcdir}/.built |
516 | touch ${srcdir}/.built |
| 518 | cd ${OLDPWD} |
517 | cd ${OLDPWD} |
| 519 | fi |
518 | fi |
| 520 | done |
519 | done |
| 521 | |
520 | |
| … | |
… | |
| 546 | |
545 | |
| 547 | generate_modulesd ${objdir}/${modulename} |
546 | generate_modulesd ${objdir}/${modulename} |
| 548 | done |
547 | done |
| 549 | } |
548 | } |
| 550 | |
549 | |
|
|
550 | linux-mod_pkg_preinst() { |
|
|
551 | [ -d ${IMAGE}/lib/modules ] && UPDATE_DEPMOD=true || UPDATE_DEPMOD=false |
|
|
552 | [ -d ${IMAGE}/etc/modules.d ] && UPDATE_MODULES=true || UPDATE_MODULES=false |
|
|
553 | [ -d ${IMAGE}/lib/modules ] && UPDATE_MODULEDB=true || UPDATE_MODULEDB=false |
|
|
554 | } |
|
|
555 | |
| 551 | linux-mod_pkg_postinst() { |
556 | linux-mod_pkg_postinst() { |
| 552 | update_depmod; |
557 | ${UPDATE_DEPMOD} && update_depmod; |
| 553 | update_modules; |
558 | ${UPDATE_MODULES} && update_modules; |
| 554 | update_moduledb; |
559 | ${UPDATE_MODULEDB} && update_moduledb; |
| 555 | } |
560 | } |
| 556 | |
561 | |
| 557 | linux-mod_pkg_postrm() { |
562 | linux-mod_pkg_postrm() { |
| 558 | remove_moduledb; |
563 | remove_moduledb; |
| 559 | } |
564 | } |