| 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.54 2005/10/22 17:35:39 johnm Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/linux-mod.eclass,v 1.60 2006/03/03 21:04:58 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. |
| … | |
… | |
| 77 | # MODULES_${modulename}_DOCS This is a string list which contains |
77 | # MODULES_${modulename}_DOCS This is a string list which contains |
| 78 | # the full path to any associated |
78 | # the full path to any associated |
| 79 | # documents for $modulename |
79 | # documents for $modulename |
| 80 | |
80 | |
| 81 | |
81 | |
| 82 | inherit linux-info |
82 | inherit linux-info eutils |
| 83 | EXPORT_FUNCTIONS pkg_setup pkg_postinst src_install src_compile pkg_postrm |
83 | EXPORT_FUNCTIONS pkg_setup pkg_postinst src_install src_compile pkg_postrm |
| 84 | |
84 | |
| 85 | IUSE="" # don't put pcmcia here, rather in the ebuilds that actually support pcmcia |
85 | IUSE="" # don't put pcmcia here, rather in the ebuilds that actually support pcmcia |
| 86 | SLOT="0" |
86 | SLOT="0" |
| 87 | DESCRIPTION="Based on the $ECLASS eclass" |
87 | DESCRIPTION="Based on the $ECLASS eclass" |
| 88 | RDEPEND="virtual/modutils |
88 | RDEPEND="virtual/modutils |
| 89 | pcmcia? ( virtual/pcmcia )" |
89 | pcmcia? ( virtual/pcmcia )" |
| 90 | DEPEND="virtual/linux-sources |
90 | DEPEND="sys-apps/sed |
| 91 | sys-apps/sed |
|
|
| 92 | pcmcia? ( virtual/pcmcia )" |
91 | pcmcia? ( virtual/pcmcia )" |
| 93 | |
92 | |
| 94 | # eclass utilities |
93 | # eclass utilities |
| 95 | # ---------------------------------- |
94 | # ---------------------------------- |
| 96 | |
95 | |
| … | |
… | |
| 167 | else |
166 | else |
| 168 | einfo "We have detected that you are running a 2.6 kernel" |
167 | einfo "We have detected that you are running a 2.6 kernel" |
| 169 | einfo "but you are not using the built-in PCMCIA support." |
168 | einfo "but you are not using the built-in PCMCIA support." |
| 170 | einfo "We will assume you know what you are doing, but please" |
169 | einfo "We will assume you know what you are doing, but please" |
| 171 | einfo "consider using the built in PCMCIA support instead." |
170 | einfo "consider using the built in PCMCIA support instead." |
| 172 | sleep 10 |
171 | epause 10 |
| 173 | |
172 | |
| 174 | unpack_pcmcia_sources ${pcmcia_tbz}; |
173 | unpack_pcmcia_sources ${pcmcia_tbz}; |
| 175 | fi |
174 | fi |
| 176 | fi |
175 | fi |
| 177 | } |
176 | } |
| … | |
… | |
| 255 | local MODULEDB_DIR=${ROOT}/var/lib/module-rebuild/ |
254 | local MODULEDB_DIR=${ROOT}/var/lib/module-rebuild/ |
| 256 | move_old_moduledb |
255 | move_old_moduledb |
| 257 | |
256 | |
| 258 | if [[ -n $(grep ${CATEGORY}/${PN}-${PVR} ${MODULEDB_DIR}/moduledb) ]]; then |
257 | if [[ -n $(grep ${CATEGORY}/${PN}-${PVR} ${MODULEDB_DIR}/moduledb) ]]; then |
| 259 | einfo "Removing ${CATEGORY}/${PN}-${PVR} from moduledb." |
258 | einfo "Removing ${CATEGORY}/${PN}-${PVR} from moduledb." |
| 260 | sed -ie "/.*${CATEGORY}\/${P}.*/d" ${MODULEDB_DIR}/moduledb |
259 | sed -ie "/.*${CATEGORY}\/${PN}-${PVR}.*/d" ${MODULEDB_DIR}/moduledb |
| 261 | fi |
260 | fi |
| 262 | } |
261 | } |
| 263 | |
262 | |
| 264 | set_kvobj() { |
263 | set_kvobj() { |
| 265 | if kernel_is 2 6 |
264 | if kernel_is 2 6 |
| … | |
… | |
| 461 | linux-mod_pkg_setup() { |
460 | linux-mod_pkg_setup() { |
| 462 | linux-info_pkg_setup; |
461 | linux-info_pkg_setup; |
| 463 | check_kernel_built; |
462 | check_kernel_built; |
| 464 | check_modules_supported; |
463 | check_modules_supported; |
| 465 | set_kvobj; |
464 | set_kvobj; |
|
|
465 | # Commented out with permission from johnm until a fixed version for arches |
|
|
466 | # who intentionally use different kernel and userland compilers can be |
|
|
467 | # introduced - Jason Wever <weeve@gentoo.org>, 23 Oct 2005 |
| 466 | check_vermagic; |
468 | #check_vermagic; |
| 467 | } |
469 | } |
| 468 | |
470 | |
| 469 | linux-mod_src_compile() { |
471 | linux-mod_src_compile() { |
| 470 | local modulename libdir srcdir objdir i n myARCH="${ARCH}" |
472 | local modulename libdir srcdir objdir i n myARCH="${ARCH}" |
| 471 | ARCH="$(tc-arch-kernel)" |
473 | ARCH="$(tc-arch-kernel)" |
| … | |
… | |
| 527 | libdir=${libdir:-misc} |
529 | libdir=${libdir:-misc} |
| 528 | srcdir=${srcdir:-${S}} |
530 | srcdir=${srcdir:-${S}} |
| 529 | objdir=${objdir:-${srcdir}} |
531 | objdir=${objdir:-${srcdir}} |
| 530 | |
532 | |
| 531 | einfo "Installing ${modulename} module" |
533 | einfo "Installing ${modulename} module" |
| 532 | cd ${objdir} |
534 | cd ${objdir} || die "${objdir} does not exist" |
| 533 | insinto ${ROOT}lib/modules/${KV_FULL}/${libdir} |
535 | insinto /lib/modules/${KV_FULL}/${libdir} |
| 534 | doins ${modulename}.${KV_OBJ} |
536 | doins ${modulename}.${KV_OBJ} || die "doins ${modulename}.${KV_OBJ} failed" |
| 535 | cd ${OLDPWD} |
537 | cd ${OLDPWD} |
| 536 | |
538 | |
| 537 | generate_modulesd ${objdir}/${modulename} |
539 | generate_modulesd ${objdir}/${modulename} |
| 538 | done |
540 | done |
| 539 | } |
541 | } |