# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/linux-mod.eclass,v 1.68 2006/10/16 14:10:46 genstef Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-mod.eclass,v 1.69 2006/11/25 10:16:04 genstef Exp $
# Description: This eclass is used to interface with linux-info in such a way
# to provide the functionality required and initial functions
# ----------------------------------
check_vermagic() {
+ debug-print-function ${FUNCNAME} $*
+
local curr_gcc_ver=$(gcc -dumpversion)
local tmpfile old_chost old_gcc_ver result=0
}
use_m() {
+ debug-print-function ${FUNCNAME} $*
+
# if we haven't determined the version yet, we need too.
get_version;
}
convert_to_m() {
+ debug-print-function ${FUNCNAME} $*
+
if use_m
then
[ ! -f "${1}" ] && \
}
update_depmod() {
+ debug-print-function ${FUNCNAME} $*
+
# if we haven't determined the version yet, we need too.
get_version;
}
update_modules() {
+ debug-print-function ${FUNCNAME} $*
+
if [ -x /sbin/modules-update ] && \
grep -v -e "^#" -e "^$" ${D}/etc/modules.d/* >/dev/null 2>&1; then
ebegin "Updating modules.conf"
}
move_old_moduledb() {
+ debug-print-function ${FUNCNAME} $*
+
local OLDDIR=${ROOT}/usr/share/module-rebuild/
local NEWDIR=${ROOT}/var/lib/module-rebuild/
}
update_moduledb() {
+ debug-print-function ${FUNCNAME} $*
+
local MODULEDB_DIR=${ROOT}/var/lib/module-rebuild/
move_old_moduledb
}
remove_moduledb() {
+ debug-print-function ${FUNCNAME} $*
+
local MODULEDB_DIR=${ROOT}/var/lib/module-rebuild/
move_old_moduledb
}
set_kvobj() {
+ debug-print-function ${FUNCNAME} $*
+
if kernel_is 2 6
then
KV_OBJ="ko"
}
get-KERNEL_CC() {
+ debug-print-function ${FUNCNAME} $*
+
local kernel_cc
if [ -n "${KERNEL_ABI}" ]; then
# In future, an arch might want to define CC_$ABI
}
generate_modulesd() {
+ debug-print-function ${FUNCNAME} $*
+
# This function will generate the neccessary modules.d file from the
# information contained in the modules exported parms
}
find_module_params() {
+ debug-print-function ${FUNCNAME} $*
+
local matched_offset=0 matched_opts=0 test="${@}" temp_var result
local i=0 y=0 z=0
# --------------------------------
linux-mod_pkg_setup() {
+ debug-print-function ${FUNCNAME} $*
+
linux-info_pkg_setup;
check_kernel_built;
strip_modulenames;
}
strip_modulenames() {
+ debug-print-function ${FUNCNAME} $*
+
local i
for i in ${MODULE_IGNORE}; do
MODULE_NAMES=${MODULE_NAMES//${i}(*}
}
linux-mod_src_compile() {
+ debug-print-function ${FUNCNAME} $*
+
local modulename libdir srcdir objdir i n myARCH="${ARCH}" myABI="${ABI}"
ARCH="$(tc-arch-kernel)"
ABI="${KERNEL_ABI}"
- CC_HOSTCC=$(tc-getBUILD_CC)
- CC_CC=$(get-KERNEL_CC)
BUILD_TARGETS=${BUILD_TARGETS:-clean module}
strip_modulenames;
die "Unable to run econf ${ECONF_PARAMS}"
fi
- emake HOSTCC=${CC_HOSTCC} CC=${CC_CC} LDFLAGS="$(get_abi_LDFLAGS)" \
+ emake HOSTCC="$(tc-getBUILD_CC)" CC="$(get-KERNEL_CC)" LDFLAGS="$(get_abi_LDFLAGS)" \
${BUILD_FIXES} ${BUILD_PARAMS} ${BUILD_TARGETS} \
|| die "Unable to make ${BUILD_FIXES} ${BUILD_PARAMS} ${BUILD_TARGETS}."
touch ${srcdir}/.built
}
linux-mod_src_install() {
+ debug-print-function ${FUNCNAME} $*
+
local modulename libdir srcdir objdir i n
strip_modulenames;
}
linux-mod_pkg_preinst() {
+ debug-print-function ${FUNCNAME} $*
+
[ -d ${IMAGE}/lib/modules ] && UPDATE_DEPMOD=true || UPDATE_DEPMOD=false
[ -d ${IMAGE}/etc/modules.d ] && UPDATE_MODULES=true || UPDATE_MODULES=false
[ -d ${IMAGE}/lib/modules ] && UPDATE_MODULEDB=true || UPDATE_MODULEDB=false
}
linux-mod_pkg_postinst() {
+ debug-print-function ${FUNCNAME} $*
+
${UPDATE_DEPMOD} && update_depmod;
${UPDATE_MODULES} && update_modules;
${UPDATE_MODULEDB} && update_moduledb;
}
linux-mod_pkg_postrm() {
+ debug-print-function ${FUNCNAME} $*
remove_moduledb;
}