/[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.1 Revision 1.6
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.1 2004/11/24 16:36:38 johnm Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/linux-mod.eclass,v 1.6 2004/12/06 18:33:11 johnm Exp $
4 4
5# This eclass provides functions for compiling external kernel modules 5# This eclass provides functions for compiling external kernel modules
6# from source. 6# from source.
7 7
8inherit linux-info 8inherit linux-info
12 12
13DESCRIPTION="Based on the $ECLASS eclass" 13DESCRIPTION="Based on the $ECLASS eclass"
14SLOT=0 14SLOT=0
15DEPEND="virtual/linux-sources 15DEPEND="virtual/linux-sources
16 sys-apps/sed" 16 sys-apps/sed"
17
18
19 17
20 18
21# This eclass is designed to help ease the installation of external kernel 19# This eclass is designed to help ease the installation of external kernel
22# modules into the kernel tree. 20# modules into the kernel tree.
23 21
48update_depmod() { 46update_depmod() {
49 # if we haven't determined the version yet, we need too. 47 # if we haven't determined the version yet, we need too.
50 get_version; 48 get_version;
51 49
52 ebegin "Updating module dependencies for ${KV_FULL}" 50 ebegin "Updating module dependencies for ${KV_FULL}"
53 if [ -r ${KV_DIR}/System.map ] 51 if [ -r ${KV_OUT_DIR}/System.map ]
54 then 52 then
55 depmod -ae -F ${KV_DIR}/System.map -b ${ROOT} -r ${KV_FULL} 53 depmod -ae -F ${KV_OUT_DIR}/System.map -b ${ROOT} -r ${KV_FULL}
56 else 54 else
57 ewarn 55 ewarn
58 ewarn "${KV_DIR}/System.map not found." 56 ewarn "${KV_OUT_DIR}/System.map not found."
59 ewarn "You must manually update the kernel module dependencies using depmod." 57 ewarn "You must manually update the kernel module dependencies using depmod."
60 ewarn 58 ewarn
61 fi 59 fi
62 eend $? 60 eend $?
61}
62
63update_modules() {
64 if [ -x /sbin/modules-update ] ;
65 then
66 ebegin "Updating modules.conf"
67 /sbin/modules-update
68 eend $?
69 fi
63} 70}
64 71
65set_kvobj() { 72set_kvobj() {
66 if kernel_is 2 6 73 if kernel_is 2 6
67 then 74 then
99 106
100# default ebuild functions 107# default ebuild functions
101# -------------------------------- 108# --------------------------------
102 109
103linux-mod_pkg_setup() { 110linux-mod_pkg_setup() {
104 get_version; 111 linux-info_pkg_setup;
105 check_kernel_built 112 check_kernel_built;
106 check_modules_supported; 113 check_modules_supported;
114 check_extra_config;
107 set_kvobj; 115 set_kvobj;
108} 116}
109 117
110linux-mod_src_compile() { 118linux-mod_src_compile() {
111 local modulename moduledir sourcedir module_temp xarch i 119 local modulename moduledir sourcedir module_temp xarch i
112 xarch="${ARCH}" 120 xarch="${ARCH}"
113 unset ARCH 121 unset ARCH
114 122
115 for i in ${MODULE_NAMES} 123 for i in "${MODULE_NAMES}"
116 do 124 do
117 module_temp="$(echo ${i} | sed -e "s:.*(\(.*\)):\1:")" 125 module_temp="$(echo ${i} | sed -e "s:.*(\(.*\)):\1:")"
118 modulename="${i/(*/}" 126 modulename="${i/(*/}"
119 moduledir="${module_temp/:*/}" 127 moduledir="${module_temp/:*/}"
120 moduledir="${moduledir:-misc}" 128 moduledir="${moduledir:-misc}"
121 sourcedir="${module_temp/*:/}" 129 sourcedir="${module_temp/*:/}"
122 sourcedir="${sourcedir:-${S}}" 130 sourcedir="${sourcedir:-${S}}"
123 131
124 einfo "Preparing ${modulename} module" 132 einfo "Preparing ${modulename} module"
125 cd ${sourcedir} 133 cd ${sourcedir}
126 make clean 134 emake clean || die Unable to make clean.
127 make ${BUILD_PARAMS} module 135 emake ${BUILD_PARAMS} module || die Unable to make ${BUILD_PARAMS} module.
128 done 136 done
129 ARCH="${xarch}" 137 ARCH="${xarch}"
130} 138}
131 139
132linux-mod_src_install() { 140linux-mod_src_install() {
148 done 156 done
149} 157}
150 158
151linux-mod_pkg_postinst() { 159linux-mod_pkg_postinst() {
152 update_depmod; 160 update_depmod;
161 update_modules;
153 display_postinst; 162 display_postinst;
154} 163}

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.6

  ViewVC Help
Powered by ViewVC 1.1.20