/[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.15 Revision 1.16
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.15 2004/12/31 09:23:43 mrness Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.16 2005/01/06 13:58:15 johnm Exp $
4# 4#
5# Description: This eclass is used as a central eclass for accessing kernel 5# Description: This eclass is used as a central eclass for accessing kernel
6# related information for sources already installed. 6# related information for sources already installed.
7# It is vital for linux-mod to function correctly, and is split 7# It is vital for linux-mod to function correctly, and is split
8# out so that any ebuild behaviour "templates" are abstracted out 8# out so that any ebuild behaviour "templates" are abstracted out
56# Overwritable environment Var's 56# Overwritable environment Var's
57# --------------------------------------- 57# ---------------------------------------
58KERNEL_DIR="${KERNEL_DIR:-/usr/src/linux}" 58KERNEL_DIR="${KERNEL_DIR:-/usr/src/linux}"
59 59
60 60
61# Bug fixes
62
63# fix to bug #75034
64case ${ARCH} in
65 ppc) BUILD_FIXES="${BUILD_FIXES} TOUT=${T}/.tmp_gas_check";;
66 ppc64) BUILD_FIXES="${BUILD_FIXES} TOUT=${T}/.tmp_gas_check";;
67esac
68
61# Pulled from eutils as it might be more useful only being here since 69# Pulled from eutils as it might be more useful only being here since
62# very few ebuilds which dont use this eclass will ever ever use these functions 70# very few ebuilds which dont use this eclass will ever ever use these functions
63set_arch_to_kernel() { 71set_arch_to_kernel() {
64 export PORTAGE_ARCH="${ARCH}" 72 export PORTAGE_ARCH="${ARCH}"
65 case ${ARCH} in 73 case ${ARCH} in
114# getfilevar <VARIABLE> <CONFIGFILE> 122# getfilevar <VARIABLE> <CONFIGFILE>
115 123
116getfilevar() { 124getfilevar() {
117local ERROR workingdir basefname basedname xarch 125local ERROR workingdir basefname basedname xarch
118 ERROR=0 126 ERROR=0
119 127
120 [ -z "${1}" ] && ERROR=1 128 [ -z "${1}" ] && ERROR=1
121 [ ! -f "${2}" ] && ERROR=1 129 [ ! -f "${2}" ] && ERROR=1
122 130
123 if [ "${ERROR}" = 1 ] 131 if [ "${ERROR}" = 1 ]
124 then 132 then
133 xarch=${ARCH} 141 xarch=${ARCH}
134 unset ARCH 142 unset ARCH
135 143
136 cd ${basedname} 144 cd ${basedname}
137 echo -e "include ${basefname}\ne:\n\t@echo \$(${1})" | \ 145 echo -e "include ${basefname}\ne:\n\t@echo \$(${1})" | \
138 make -f - e 2>/dev/null 146 make ${BUILD_FIXES} -f - e 2>/dev/null
139 cd ${workingdir} 147 cd ${workingdir}
140 148
141 ARCH=${xarch} 149 ARCH=${xarch}
142 fi 150 fi
143} 151}
353 361
354check_kernel_built() { 362check_kernel_built() {
355 # if we haven't determined the version yet, we need too. 363 # if we haven't determined the version yet, we need too.
356 get_version; 364 get_version;
357 365
358 if [ ! -f "${KV_OUT_DIR}/System.map" ] 366 if [ ! -f "${KV_OUT_DIR}/include/linux/version.h" ]
359 then 367 then
360 eerror "These sources have not yet been compiled." 368 eerror "These sources have not yet been prepared."
361 eerror "We cannot build against an uncompiled tree." 369 eerror "We cannot build against an unprepared tree."
362 eerror "To resolve this, please type the following:" 370 eerror "To resolve this, please type the following:"
363 eerror 371 eerror
364 eerror "# cd ${KV_DIR}" 372 eerror "# cd ${KV_DIR}"
365 eerror "# make oldconfig" 373 eerror "# make oldconfig"
366 eerror "# make bzImage modules modules_install" 374 eerror "# make modules_prepare"
367 eerror 375 eerror
368 eerror "Then please try merging this module again." 376 eerror "Then please try merging this module again."
369 die "Kernel sources need compiling first" 377 die "Kernel sources need compiling first"
370 fi 378 fi
371} 379}

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16

  ViewVC Help
Powered by ViewVC 1.1.20