| 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-info.eclass,v 1.1 2004/11/24 16:36:38 johnm Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.3 2004/11/27 11:26:52 johnm Exp $ |
| 4 | # |
4 | # |
| 5 | # This eclass provides functions for querying the installed kernel |
5 | # This eclass provides functions for querying the installed kernel |
| 6 | # source version, selected kernel options etc. |
6 | # source version, selected kernel options etc. |
| 7 | # |
7 | # |
| 8 | |
8 | |
| … | |
… | |
| 32 | if [ "${ERROR}" = 1 ] |
32 | if [ "${ERROR}" = 1 ] |
| 33 | then |
33 | then |
| 34 | eerror "getfilevar requires 2 variables, with the second a valid file." |
34 | eerror "getfilevar requires 2 variables, with the second a valid file." |
| 35 | eerror " getfilevar <VARIABLE> <CONFIGFILE>" |
35 | eerror " getfilevar <VARIABLE> <CONFIGFILE>" |
| 36 | else |
36 | else |
| 37 | grep -e "^$1" $2 | sed 's: = :=:' | cut -d= -f2- |
37 | grep -e "^$1[= ]" $2 | sed 's: = :=:' | cut -d= -f2- |
| 38 | fi |
38 | fi |
| 39 | } |
39 | } |
| 40 | |
40 | |
| 41 | getfilevar_isset() { |
41 | getfilevar_isset() { |
| 42 | local RESULT |
42 | local RESULT |
| … | |
… | |
| 180 | if [ "$?" != 0 ] |
180 | if [ "$?" != 0 ] |
| 181 | then |
181 | then |
| 182 | eerror "These sources do not support loading external modules." |
182 | eerror "These sources do not support loading external modules." |
| 183 | eerror "to be able to use this module please enable \"Loadable modules support\"" |
183 | eerror "to be able to use this module please enable \"Loadable modules support\"" |
| 184 | eerror "in your kernel, recompile and then try merging this module again." |
184 | eerror "in your kernel, recompile and then try merging this module again." |
|
|
185 | die No support for external modules in ${KV_FUll} config |
|
|
186 | fi |
|
|
187 | } |
|
|
188 | |
|
|
189 | check_extra_config() { |
|
|
190 | local config negate error |
|
|
191 | |
|
|
192 | # if we haven't determined the version yet, we need too. |
|
|
193 | get_version; |
|
|
194 | |
|
|
195 | einfo "Checking for suitable kernel configuration options" |
|
|
196 | for config in ${CONFIG_CHECK} |
|
|
197 | do |
|
|
198 | negate="${config:0:1}" |
|
|
199 | if [ "${negate}" == "!" ]; |
|
|
200 | then |
|
|
201 | config="${config:1}" |
|
|
202 | if getfilevar_isset ${config} ${KV_DIR}/.config ; |
|
|
203 | then |
|
|
204 | eerror " ${config}:\tshould not be set in the kernel configuration, but it is." |
|
|
205 | error=1 |
|
|
206 | fi |
|
|
207 | else |
|
|
208 | if ! getfilevar_isset ${config} ${KV_DIR}/.config ; |
|
|
209 | then |
|
|
210 | eerror " ${config}:\tshould be set in the kernel configuration, but isn't" |
|
|
211 | error=1 |
|
|
212 | fi |
|
|
213 | fi |
|
|
214 | done |
|
|
215 | |
|
|
216 | if [ -n "${error}" ] ; |
|
|
217 | then |
|
|
218 | eerror "Please check to make sure these options are set correctly." |
|
|
219 | eerror "Once you have satisfied these options, please try merging" |
|
|
220 | eerror "this package again." |
|
|
221 | die Incorrect kernel configuration options |
| 185 | fi |
222 | fi |
| 186 | } |
223 | } |
| 187 | |
224 | |
| 188 | check_zlibinflate() { |
225 | check_zlibinflate() { |
| 189 | # if we haven't determined the version yet, we need too. |
226 | # if we haven't determined the version yet, we need too. |