summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Drake <dsd@gentoo.org>2004-10-06 21:25:11 +0000
committerDaniel Drake <dsd@gentoo.org>2004-10-06 21:25:11 +0000
commitb1abb2decd427e81df145b02432d7877f81be8ac (patch)
tree63b7f2adf72632548f409cc58dc5421b80c77d96 /eclass/kernel-mod.eclass
parentAdded bug no. in ChangeLog (diff)
downloadhistorical-b1abb2decd427e81df145b02432d7877f81be8ac.tar.gz
historical-b1abb2decd427e81df145b02432d7877f81be8ac.tar.bz2
historical-b1abb2decd427e81df145b02432d7877f81be8ac.zip
Add .config parsing functions
Diffstat (limited to 'eclass/kernel-mod.eclass')
-rw-r--r--eclass/kernel-mod.eclass43
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"