diff options
author | Daniel Drake <dsd@gentoo.org> | 2004-10-06 21:25:11 +0000 |
---|---|---|
committer | Daniel Drake <dsd@gentoo.org> | 2004-10-06 21:25:11 +0000 |
commit | 95dac673beef0cf016884e9aba6f83ca27bcef3e (patch) | |
tree | 6f7615af22a90054518993dca61f695bcde2d2d2 /eclass | |
parent | Added bug no. in ChangeLog (Manifest recommit) (diff) | |
download | gentoo-2-95dac673beef0cf016884e9aba6f83ca27bcef3e.tar.gz gentoo-2-95dac673beef0cf016884e9aba6f83ca27bcef3e.tar.bz2 gentoo-2-95dac673beef0cf016884e9aba6f83ca27bcef3e.zip |
Add .config parsing functions
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/kernel-mod.eclass | 43 |
1 files changed, 42 insertions, 1 deletions
diff --git a/eclass/kernel-mod.eclass b/eclass/kernel-mod.eclass index a0c47b335d1d..67145ae9d36e 100644 --- a/eclass/kernel-mod.eclass +++ b/eclass/kernel-mod.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/kernel-mod.eclass,v 1.8 2004/06/25 00:39:48 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/kernel-mod.eclass,v 1.9 2004/10/06 21:25:11 dsd Exp $ # This eclass provides help for compiling external kernel modules from # source. @@ -85,6 +85,47 @@ kernel-mod_getversion () einfo "Building for Linux ${KV_VERSION_FULL} found in ${KERNEL_DIR}" } +kernel-mod_configoption_present () +{ + [ -e "${KERNEL_DIR}/.config" ] || die "kernel has not been configured yet" + + if egrep "^CONFIG_${1}=[ym]" ${ROOT}/usr/src/linux/.config >/dev/null + then + return 0 + else + return -1 + fi +} + +kernel-mod_configoption_module () +{ + [ -e "${KERNEL_DIR}/.config" ] || die "kernel has not been configured yet" + + if egrep "^CONFIG_${1}=[m]" ${ROOT}/usr/src/linux/.config >/dev/null + then + return 0 + else + return -1 + fi +} + +kernel-mod_configoption_builtin () +{ + [ -e "${KERNEL_DIR}/.config" ] || die "kernel has not been configured yet" + + if egrep "^CONFIG_${1}=[y]" ${ROOT}/usr/src/linux/.config >/dev/null + then + return 0 + else + return -1 + fi +} + +kernel-mod_modules_supported () +{ + kernel-mod_configoption_builtin "MODULES" +} + kernel-mod_checkzlibinflate_configured () { einfo "Checking for status of CONFIG_ZLIB_INFLATE support in your kernel" |