/[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.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.2 2004/11/25 19:47:18 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
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() {
45update_depmod() { 46update_depmod() {
46 # if we haven't determined the version yet, we need too. 47 # if we haven't determined the version yet, we need too.
47 get_version; 48 get_version;
48 49
49 ebegin "Updating module dependencies for ${KV_FULL}" 50 ebegin "Updating module dependencies for ${KV_FULL}"
50 if [ -r ${KV_DIR}/System.map ] 51 if [ -r ${KV_OUT_DIR}/System.map ]
51 then 52 then
52 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}
53 else 54 else
54 ewarn 55 ewarn
55 ewarn "${KV_DIR}/System.map not found." 56 ewarn "${KV_OUT_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
96 106
97# default ebuild functions 107# default ebuild functions
98# -------------------------------- 108# --------------------------------
99 109
100linux-mod_pkg_setup() { 110linux-mod_pkg_setup() {
101 get_version; 111 linux-info_pkg_setup;
102 check_kernel_built 112 check_kernel_built;
103 check_modules_supported; 113 check_modules_supported;
114 check_extra_config;
104 set_kvobj; 115 set_kvobj;
105} 116}
106 117
107linux-mod_src_compile() { 118linux-mod_src_compile() {
108 local modulename moduledir sourcedir module_temp xarch i 119 local modulename moduledir sourcedir module_temp xarch i
109 xarch="${ARCH}" 120 xarch="${ARCH}"
110 unset ARCH 121 unset ARCH
111 122
112 for i in ${MODULE_NAMES} 123 for i in "${MODULE_NAMES}"
113 do 124 do
114 module_temp="$(echo ${i} | sed -e "s:.*(\(.*\)):\1:")" 125 module_temp="$(echo ${i} | sed -e "s:.*(\(.*\)):\1:")"
115 modulename="${i/(*/}" 126 modulename="${i/(*/}"
116 moduledir="${module_temp/:*/}" 127 moduledir="${module_temp/:*/}"
117 moduledir="${moduledir:-misc}" 128 moduledir="${moduledir:-misc}"
118 sourcedir="${module_temp/*:/}" 129 sourcedir="${module_temp/*:/}"
119 sourcedir="${sourcedir:-${S}}" 130 sourcedir="${sourcedir:-${S}}"
120 131
121 einfo "Preparing ${modulename} module" 132 einfo "Preparing ${modulename} module"
122 cd ${sourcedir} 133 cd ${sourcedir}
123 make clean 134 emake clean || die Unable to make clean.
124 make ${BUILD_PARAMS} module 135 emake ${BUILD_PARAMS} module || die Unable to make ${BUILD_PARAMS} module.
125 done 136 done
126 ARCH="${xarch}" 137 ARCH="${xarch}"
127} 138}
128 139
129linux-mod_src_install() { 140linux-mod_src_install() {
145 done 156 done
146} 157}
147 158
148linux-mod_pkg_postinst() { 159linux-mod_pkg_postinst() {
149 update_depmod; 160 update_depmod;
161 update_modules;
150 display_postinst; 162 display_postinst;
151} 163}

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

  ViewVC Help
Powered by ViewVC 1.1.20