/[gentoo-x86]/eclass/linux-info.eclass
Gentoo

Diff of /eclass/linux-info.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.75 Revision 1.76
1# Copyright 1999-2006 Gentoo Foundation 1# Copyright 1999-2006 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.75 2009/12/11 20:54:06 robbat2 Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.76 2009/12/11 21:33:30 robbat2 Exp $
4# 4#
5# Original author: John Mylchreest <johnm@gentoo.org> 5# Original author: John Mylchreest <johnm@gentoo.org>
6# Maintainer: kernel-misc@gentoo.org 6# Maintainer: kernel-misc@gentoo.org
7# 7#
8# Please direct your bugs to the current eclass maintainer :) 8# Please direct your bugs to the current eclass maintainer :)
230# as linux_chkconfig* in non-legacy mode WILL return an undefined value if no 230# as linux_chkconfig* in non-legacy mode WILL return an undefined value if no
231# config is available at all. 231# config is available at all.
232_LINUX_CONFIG_EXISTS_DONE= 232_LINUX_CONFIG_EXISTS_DONE=
233 233
234linux_config_qa_check() { 234linux_config_qa_check() {
235 local funcname="$1" 235 local f="$1"
236 if [ -z "${_LINUX_CONFIG_EXISTS_DONE}" ]; then 236 if [ -z "${_LINUX_CONFIG_EXISTS_DONE}" ]; then
237 ewarn "QA: You called $1 before any linux_config_exists!" 237 ewarn "QA: You called $f before any linux_config_exists!"
238 ewarn "QA: The return value of $1 will NOT gaurenteed later!" 238 ewarn "QA: The return value of $f will NOT gaurenteed later!"
239 fi 239 fi
240} 240}
241 241
242# @FUNCTION: linux_config_src_exists 242# @FUNCTION: linux_config_src_exists
243# @RETURN: true or false 243# @RETURN: true or false
288# @DESCRIPTION: 288# @DESCRIPTION:
289# It checks that CONFIG_<option>=y or CONFIG_<option>=m is present in the current kernel .config 289# It checks that CONFIG_<option>=y or CONFIG_<option>=m is present in the current kernel .config
290# If linux_config_exists returns false, the results of this are UNDEFINED. You 290# If linux_config_exists returns false, the results of this are UNDEFINED. You
291# MUST call linux_config_exists first. 291# MUST call linux_config_exists first.
292linux_chkconfig_present() { 292linux_chkconfig_present() {
293 linux_config_qa_check 293 linux_config_qa_check linux_chkconfig_present
294 local RESULT 294 local RESULT
295 [ -z "${I_KNOW_WHAT_I_AM_DOING}" ] && require_configured_kernel 295 [ -z "${I_KNOW_WHAT_I_AM_DOING}" ] && require_configured_kernel
296 local config 296 local config
297 config="${KV_OUT_DIR}/.config" 297 config="${KV_OUT_DIR}/.config"
298 [ ! -f "${config}" ] && config="/proc/config.gz" 298 [ ! -f "${config}" ] && config="/proc/config.gz"
306# @DESCRIPTION: 306# @DESCRIPTION:
307# It checks that CONFIG_<option>=m is present in the current kernel .config 307# It checks that CONFIG_<option>=m is present in the current kernel .config
308# If linux_config_exists returns false, the results of this are UNDEFINED. You 308# If linux_config_exists returns false, the results of this are UNDEFINED. You
309# MUST call linux_config_exists first. 309# MUST call linux_config_exists first.
310linux_chkconfig_module() { 310linux_chkconfig_module() {
311 linux_config_qa_check 311 linux_config_qa_check linux_chkconfig_module
312 local RESULT 312 local RESULT
313 [ -z "${I_KNOW_WHAT_I_AM_DOING}" ] && require_configured_kernel 313 [ -z "${I_KNOW_WHAT_I_AM_DOING}" ] && require_configured_kernel
314 local config 314 local config
315 config="${KV_OUT_DIR}/.config" 315 config="${KV_OUT_DIR}/.config"
316 [ ! -f "${config}" ] && config="/proc/config.gz" 316 [ ! -f "${config}" ] && config="/proc/config.gz"
324# @DESCRIPTION: 324# @DESCRIPTION:
325# It checks that CONFIG_<option>=y is present in the current kernel .config 325# It checks that CONFIG_<option>=y is present in the current kernel .config
326# If linux_config_exists returns false, the results of this are UNDEFINED. You 326# If linux_config_exists returns false, the results of this are UNDEFINED. You
327# MUST call linux_config_exists first. 327# MUST call linux_config_exists first.
328linux_chkconfig_builtin() { 328linux_chkconfig_builtin() {
329 linux_config_qa_check 329 linux_config_qa_check linux_chkconfig_builtin
330 local RESULT 330 local RESULT
331 [ -z "${I_KNOW_WHAT_I_AM_DOING}" ] && require_configured_kernel 331 [ -z "${I_KNOW_WHAT_I_AM_DOING}" ] && require_configured_kernel
332 local config 332 local config
333 config="${KV_OUT_DIR}/.config" 333 config="${KV_OUT_DIR}/.config"
334 [ ! -f "${config}" ] && config="/proc/config.gz" 334 [ ! -f "${config}" ] && config="/proc/config.gz"
342# @DESCRIPTION: 342# @DESCRIPTION:
343# It prints the CONFIG_<option> value of the current kernel .config (it requires a configured kernel). 343# It prints the CONFIG_<option> value of the current kernel .config (it requires a configured kernel).
344# If linux_config_exists returns false, the results of this are UNDEFINED. You 344# If linux_config_exists returns false, the results of this are UNDEFINED. You
345# MUST call linux_config_exists first. 345# MUST call linux_config_exists first.
346linux_chkconfig_string() { 346linux_chkconfig_string() {
347 linux_config_qa_check 347 linux_config_qa_check linux_chkconfig_string
348 [ -z "${I_KNOW_WHAT_I_AM_DOING}" ] && require_configured_kernel 348 [ -z "${I_KNOW_WHAT_I_AM_DOING}" ] && require_configured_kernel
349 local config 349 local config
350 config="${KV_OUT_DIR}/.config" 350 config="${KV_OUT_DIR}/.config"
351 [ ! -f "${config}" ] && config="/proc/config.gz" 351 [ ! -f "${config}" ] && config="/proc/config.gz"
352 getfilevar_noexec "CONFIG_${1}" "${config}" 352 getfilevar_noexec "CONFIG_${1}" "${config}"

Legend:
Removed from v.1.75  
changed lines
  Added in v.1.76

  ViewVC Help
Powered by ViewVC 1.1.20