/[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.2 Revision 1.3
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.2 2004/11/25 19:47:18 johnm Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/linux-mod.eclass,v 1.3 2004/11/25 22:40:29 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
16 sys-apps/sed" 16 sys-apps/sed"
17 17
18 18
19# 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
20# modules into the kernel tree. 20# modules into the kernel tree.
21
21 22
22# eclass utilities 23# eclass utilities
23# ---------------------------------- 24# ----------------------------------
24 25
25use_m() { 26use_m() {
55 ewarn "${KV_DIR}/System.map not found." 56 ewarn "${KV_DIR}/System.map not found."
56 ewarn "You must manually update the kernel module dependencies using depmod." 57 ewarn "You must manually update the kernel module dependencies using depmod."
57 ewarn 58 ewarn
58 fi 59 fi
59 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
60} 70}
61 71
62set_kvobj() { 72set_kvobj() {
63 if kernel_is 2 6 73 if kernel_is 2 6
64 then 74 then
107linux-mod_src_compile() { 117linux-mod_src_compile() {
108 local modulename moduledir sourcedir module_temp xarch i 118 local modulename moduledir sourcedir module_temp xarch i
109 xarch="${ARCH}" 119 xarch="${ARCH}"
110 unset ARCH 120 unset ARCH
111 121
112 for i in ${MODULE_NAMES} 122 for i in "${MODULE_NAMES}"
113 do 123 do
114 module_temp="$(echo ${i} | sed -e "s:.*(\(.*\)):\1:")" 124 module_temp="$(echo ${i} | sed -e "s:.*(\(.*\)):\1:")"
115 modulename="${i/(*/}" 125 modulename="${i/(*/}"
116 moduledir="${module_temp/:*/}" 126 moduledir="${module_temp/:*/}"
117 moduledir="${moduledir:-misc}" 127 moduledir="${moduledir:-misc}"
118 sourcedir="${module_temp/*:/}" 128 sourcedir="${module_temp/*:/}"
119 sourcedir="${sourcedir:-${S}}" 129 sourcedir="${sourcedir:-${S}}"
120 130
121 einfo "Preparing ${modulename} module" 131 einfo "Preparing ${modulename} module"
122 cd ${sourcedir} 132 cd ${sourcedir}
123 make clean 133 emake clean || die Unable to make clean.
124 make ${BUILD_PARAMS} module 134 emake ${BUILD_PARAMS} module || die Unable to make ${BUILD_PARAMS} module.
125 done 135 done
126 ARCH="${xarch}" 136 ARCH="${xarch}"
127} 137}
128 138
129linux-mod_src_install() { 139linux-mod_src_install() {
145 done 155 done
146} 156}
147 157
148linux-mod_pkg_postinst() { 158linux-mod_pkg_postinst() {
149 update_depmod; 159 update_depmod;
160 update_modules;
150 display_postinst; 161 display_postinst;
151} 162}

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.20