/[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.36 Revision 1.37
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.36 2005/04/25 18:47:12 johnm Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/linux-mod.eclass,v 1.37 2005/05/03 22:55:03 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 pkg_postrm
86 86
87IUSE="${IUSE} pcmcia"
87SLOT="0" 88SLOT="0"
88DESCRIPTION="Based on the $ECLASS eclass" 89DESCRIPTION="Based on the $ECLASS eclass"
89DEPEND="virtual/linux-sources 90DEPEND="virtual/linux-sources
90 sys-apps/sed 91 sys-apps/sed
91 virtual/modutils 92 virtual/modutils
182 if [ -x /sbin/modules-update ] && \ 183 if [ -x /sbin/modules-update ] && \
183 grep -v -e "^#" -e "^$" ${D}/etc/modules.d/* >/dev/null 2>&1; then 184 grep -v -e "^#" -e "^$" ${D}/etc/modules.d/* >/dev/null 2>&1; then
184 ebegin "Updating modules.conf" 185 ebegin "Updating modules.conf"
185 /sbin/modules-update 186 /sbin/modules-update
186 eend $? 187 eend $?
188 fi
189}
190
191update_moduledb() {
192 if [[ ! -f ${ROOT}/usr/share/module-rebuild/moduledb ]]; then
193 [[ ! -d ${ROOT}/usr/share/module-rebuild/ ]] && mkdir ${ROOT}/usr/share/module-rebuild/
194 touch ${ROOT}/usr/share/module-rebuild/moduledb
195 fi
196 if [[ -z $(grep ${CATEGORY}/${PN}-${PVR} ${ROOT}/usr/share/module-rebuild/moduledb) ]]; then
197 einfo "Adding module to moduledb."
198 echo "a:1:${CATEGORY}/${PN}-${PVR}" >> ${ROOT}/usr/share/module-rebuild/moduledb
199 fi
200}
201
202remove_moduledb() {
203 if [[ -n $(grep ${CATEGORY}/${PN}-${PVR} ${ROOT}/usr/share/module-rebuild/moduledb) ]]; then
204 einfo "Removing ${CATEGORY}/${PN}-${PVR} from moduledb."
205 sed -ie "/.*${CATEGORY}\/${P}.*/d" ${ROOT}/usr/share/module-rebuild/moduledb
187 fi 206 fi
188} 207}
189 208
190set_kvobj() { 209set_kvobj() {
191 if kernel_is 2 6 210 if kernel_is 2 6
491} 510}
492 511
493linux-mod_pkg_postinst() { 512linux-mod_pkg_postinst() {
494 update_depmod; 513 update_depmod;
495 update_modules; 514 update_modules;
515 update_moduledb;
496 display_postinst; 516 display_postinst;
497} 517}
518
519linux-mod_pkg_postrm() {
520 remove_moduledb;
521}

Legend:
Removed from v.1.36  
changed lines
  Added in v.1.37

  ViewVC Help
Powered by ViewVC 1.1.20