/[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.26 Revision 1.27
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.26 2005/01/31 20:03:47 johnm Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/linux-mod.eclass,v 1.27 2005/02/01 09:58:36 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.
171 module_enabled="$(eval echo \${MODULESD_${currm}_ENABLED})" 171 module_enabled="$(eval echo \${MODULESD_${currm}_ENABLED})"
172 module_aliases="$(eval echo \${#MODULESD_${currm}_ALIASES[*]})" 172 module_aliases="$(eval echo \${#MODULESD_${currm}_ALIASES[*]})"
173 module_additions="$(eval echo \${#MODULESD_${currm}_ADDITIONS[*]})" 173 module_additions="$(eval echo \${#MODULESD_${currm}_ADDITIONS[*]})"
174 module_examples="$(eval echo \${#MODULESD_${currm}_EXAMPLES[*]})" 174 module_examples="$(eval echo \${#MODULESD_${currm}_EXAMPLES[*]})"
175 175
176 [ ${module_aliases} -eq 0 ] && unset module_aliases 176 [[ ${module_aliases} -eq 0 ]] && unset module_aliases
177 [ ${module_additions} -eq 0 ] && unset module_additions 177 [[ ${module_additions} -eq 0 ]] && unset module_additions
178 [ ${module_examples} -eq 0 ] && unset module_examples 178 [[ ${module_examples} -eq 0 ]] && unset module_examples
179 179
180 # If we specify we dont want it, then lets exit, otherwise we assume 180 # If we specify we dont want it, then lets exit, otherwise we assume
181 # that if its set, we do want it. 181 # that if its set, we do want it.
182 [[ ${module_enabled} == no ]] && return 0 182 [[ ${module_enabled} == no ]] && return 0
183 183
193 # and generate the modules.d file. 193 # and generate the modules.d file.
194 module_modinfo="$(modinfo -p ${currm_path}.${KV_OBJ})" 194 module_modinfo="$(modinfo -p ${currm_path}.${KV_OBJ})"
195 module_config="${T}/modulesd-${currm}" 195 module_config="${T}/modulesd-${currm}"
196 196
197 ebegin "Preparing file for modules.d" 197 ebegin "Preparing file for modules.d"
198 einfo "Using: ${module_config}"
198 #----------------------------------------------------------------------- 199 #-----------------------------------------------------------------------
199 echo "# modules.d configuration file for ${currm}" >> ${module_config} 200 echo "# modules.d configuration file for ${currm}" >> ${module_config}
200 #----------------------------------------------------------------------- 201 #-----------------------------------------------------------------------
201 [[ -n ${module_docs} ]] && \ 202 [[ -n ${module_docs} ]] && \
202 echo "# For more information please read:" >> ${module_config} 203 echo "# For more information please read:" >> ${module_config}
205 echo "# ${t//*\/}" >> ${module_config} 206 echo "# ${t//*\/}" >> ${module_config}
206 done 207 done
207 echo >> ${module_config} 208 echo >> ${module_config}
208 209
209 #----------------------------------------------------------------------- 210 #-----------------------------------------------------------------------
210 if [ ${module_aliases} -gt 0 ] 211 if [[ ${module_aliases} -gt 0 ]]
211 then 212 then
212 echo "# Internal Aliases - Do not edit" >> ${module_config} 213 echo "# Internal Aliases - Do not edit" >> ${module_config}
213 echo "# ------------------------------" >> ${module_config} 214 echo "# ------------------------------" >> ${module_config}
214 215
215 for((t=0; t<${module_aliases}; t++)) 216 for((t=0; t<${module_aliases}; t++))
254 do 255 do
255 echo "# options ${currm} ${t//:*}=${t//*:}" >> ${module_config} 256 echo "# options ${currm} ${t//:*}=${t//*:}" >> ${module_config}
256 done 257 done
257 echo '' >> ${module_config} 258 echo '' >> ${module_config}
258 fi 259 fi
259 elif [ ${module_examples} -gt 0 ] 260 elif [[ ${module_examples} -gt 0 ]]
260 then 261 then
261 echo "# For Example..." >> ${module_config} 262 echo "# For Example..." >> ${module_config}
262 echo "# --------------" >> ${module_config} 263 echo "# --------------" >> ${module_config}
263 for((t=0; t<${module_examples}; t++)) 264 for((t=0; t<${module_examples}; t++))
264 do 265 do
267 done 268 done
268 echo '' >> ${module_config} 269 echo '' >> ${module_config}
269 fi 270 fi
270 271
271 #----------------------------------------------------------------------- 272 #-----------------------------------------------------------------------
272 if [ ${module_additions} -gt 0 ] 273 if [[ ${module_additions} -gt 0 ]]
273 then 274 then
274 for((t=0; t<${module_additions}; t++)) 275 for((t=0; t<${module_additions}; t++))
275 do 276 do
276 echo "$(eval echo \${MODULESD_${currm}_ADDITIONS[$t]})" \ 277 echo "$(eval echo \${MODULESD_${currm}_ADDITIONS[$t]})" \
277 >> ${module_config} 278 >> ${module_config}
281 282
282 #----------------------------------------------------------------------- 283 #-----------------------------------------------------------------------
283 284
284 # then we install it 285 # then we install it
285 insinto /etc/modules.d 286 insinto /etc/modules.d
286 newins ${module_config} ${currm_path} 287 newins ${module_config} ${currm_path//*\/}
287 288
288 # and install any documentation we might have. 289 # and install any documentation we might have.
289 [[ -n ${module_docs} ]] && dodoc ${module_docs} 290 [[ -n ${module_docs} ]] && dodoc ${module_docs}
290 done 291 done
291 eend 0 292 eend 0
292 return 0 293 return 0

Legend:
Removed from v.1.26  
changed lines
  Added in v.1.27

  ViewVC Help
Powered by ViewVC 1.1.20