/[gentoo-x86]/eclass/kernel-2.eclass
Gentoo

Diff of /eclass/kernel-2.eclass

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

Revision 1.159 Revision 1.163
1# Copyright 1999-2005 Gentoo Foundation 1# Copyright 1999-2005 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/kernel-2.eclass,v 1.159 2006/02/17 22:18:20 swegener Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/kernel-2.eclass,v 1.163 2006/03/08 11:02:29 robbat2 Exp $
4 4
5# Description: kernel.eclass rewrite for a clean base regarding the 2.6 5# Description: kernel.eclass rewrite for a clean base regarding the 2.6
6# series of kernel with back-compatibility for 2.4 6# series of kernel with back-compatibility for 2.4
7# 7#
8# Maintainer: John Mylchreest <johnm@gentoo.org> 8# Maintainer: John Mylchreest <johnm@gentoo.org>
21# EXTRAVERSION would be something like : -wolk-4.19-r1 21# EXTRAVERSION would be something like : -wolk-4.19-r1
22# K_NOSETEXTRAVERSION - if this is set then EXTRAVERSION will not be 22# K_NOSETEXTRAVERSION - if this is set then EXTRAVERSION will not be
23# automatically set within the kernel Makefile 23# automatically set within the kernel Makefile
24# K_NOUSENAME - if this is set then EXTRAVERSION will not include the 24# K_NOUSENAME - if this is set then EXTRAVERSION will not include the
25# first part of ${PN} in EXTRAVERSION 25# first part of ${PN} in EXTRAVERSION
26# K_NOUSEPR - if this is set then EXTRAVERSION will not include the
27# anything based on ${PR}.
26# K_PREPATCHED - if the patchset is prepatched (ie: mm-sources, 28# K_PREPATCHED - if the patchset is prepatched (ie: mm-sources,
27# ck-sources, ac-sources) it will use PR (ie: -r5) as 29# ck-sources, ac-sources) it will use PR (ie: -r5) as
28# the patchset version for 30# the patchset version for
29# and not use it as a true package revision 31# and not use it as a true package revision
30# K_EXTRAEINFO - this is a new-line seperated list of einfo displays in 32# K_EXTRAEINFO - this is a new-line seperated list of einfo displays in
54# the doc dir 56# the doc dir
55# UNIPATCH_STRICTORDER - if this is set places patches into directories of 57# UNIPATCH_STRICTORDER - if this is set places patches into directories of
56# order, so they are applied in the order passed 58# order, so they are applied in the order passed
57 59
58inherit toolchain-funcs versionator multilib 60inherit toolchain-funcs versionator multilib
59EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install \ 61EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_preinst pkg_postinst
60 pkg_preinst pkg_postinst
61 62
62# Added by Daniel Ostrow <dostrow@gentoo.org> 63# Added by Daniel Ostrow <dostrow@gentoo.org>
63# This is an ugly hack to get around an issue with a 32-bit userland on ppc64. 64# This is an ugly hack to get around an issue with a 32-bit userland on ppc64.
64# I will remove it when I come up with something more reasonable. 65# I will remove it when I come up with something more reasonable.
65[[ ${PROFILE_ARCH} == 'ppc64' ]] && CHOST='powerpc64-unknown-linux-gnu' 66[[ ${PROFILE_ARCH} == 'ppc64' ]] && CHOST='powerpc64-unknown-linux-gnu'
73LICENSE="GPL-2" 74LICENSE="GPL-2"
74 75
75# set LINUX_HOSTCFLAGS if not already set 76# set LINUX_HOSTCFLAGS if not already set
76[[ -z ${LINUX_HOSTCFLAGS} ]] && \ 77[[ -z ${LINUX_HOSTCFLAGS} ]] && \
77 LINUX_HOSTCFLAGS="-Wall -Wstrict-prototypes -Os -fomit-frame-pointer -I${S}/include" 78 LINUX_HOSTCFLAGS="-Wall -Wstrict-prototypes -Os -fomit-frame-pointer -I${S}/include"
79
80# debugging functions
81#==============================================================
82# this function exists only to help debug kernel-2.eclass
83# if you are adding new functionality in, put a call to it
84# at the start of src_unpack, or during SRC_URI/dep generation.
85debug-print-kernel2-variables() {
86 debug-print "PVR: ${PVR}"
87 debug-print "CKV: ${CKV}"
88 debug-print "OKV: ${OKV}"
89 debug-print "KV: ${KV}"
90 debug-print "KV_FULL: ${KV_FULL}"
91 debug-print "RELEASETYPE: ${RELEASETYPE}"
92 debug-print "RELEASE: ${RELEASE}"
93 debug-print "UNIPATCH_LIST_DEFAULT: ${UNIPATCH_LIST_DEFAULT} "
94 debug-print "UNIPATCH_LIST_GENPATCHES: ${UNIPATCH_LIST_GENPATCHES} "
95 debug-print "UNIPATCH_LIST: ${UNIPATCH_LIST}"
96 debug-print "S: ${S}"
97 debug-print "KERNEL_URI: ${KERNEL_URI}"
98}
78 99
79#Eclass functions only from here onwards ... 100#Eclass functions only from here onwards ...
80#============================================================== 101#==============================================================
81handle_genpatches() { 102handle_genpatches() {
82 local tarball 103 local tarball
139 # Now we know that RELEASE is the -rc/-git 160 # Now we know that RELEASE is the -rc/-git
140 # and RELEASETYPE is the same but with its numerics stripped 161 # and RELEASETYPE is the same but with its numerics stripped
141 # we can work on better sorting EXTRAVERSION. 162 # we can work on better sorting EXTRAVERSION.
142 # first of all, we add the release 163 # first of all, we add the release
143 EXTRAVERSION="${RELEASE}" 164 EXTRAVERSION="${RELEASE}"
165 debug-print "0 EXTRAVERSION:${EXTRAVERSION}"
144 [[ -n ${KV_EXTRA} ]] && EXTRAVERSION=".${KV_EXTRA}${EXTRAVERSION}" 166 [[ -n ${KV_EXTRA} ]] && EXTRAVERSION=".${KV_EXTRA}${EXTRAVERSION}"
145 167
168 debug-print "1 EXTRAVERSION:${EXTRAVERSION}"
169 if [[ -n "${K_NOUSEPR}" ]]; then
170 # Don't add anything based on PR to EXTRAVERSION
171 debug-print "1.0 EXTRAVERSION:${EXTRAVERSION}"
146 if [[ -n ${K_PREPATCHED} ]]; then 172 elif [[ -n ${K_PREPATCHED} ]]; then
173 debug-print "1.1 EXTRAVERSION:${EXTRAVERSION}"
147 EXTRAVERSION="${EXTRAVERSION}-${PN/-*}${PR/r}" 174 EXTRAVERSION="${EXTRAVERSION}-${PN/-*}${PR/r}"
148 elif [[ "${ETYPE}" = "sources" ]]; then 175 elif [[ "${ETYPE}" = "sources" ]]; then
176 debug-print "1.2 EXTRAVERSION:${EXTRAVERSION}"
149 # For some sources we want to use the PV in the extra version 177 # For some sources we want to use the PV in the extra version
150 # This is because upstream releases with a completely different 178 # This is because upstream releases with a completely different
151 # versioning scheme. 179 # versioning scheme.
152 case ${PN/-*} in 180 case ${PN/-*} in
153 wolk) K_USEPV=1;; 181 wolk) K_USEPV=1;;
154 vserver) K_USEPV=1;; 182 vserver) K_USEPV=1;;
155 esac 183 esac
156 184
157 [[ -z ${K_NOUSENAME} ]] && EXTRAVERSION="${EXTRAVERSION}-${PN/-*}" 185 [[ -z "${K_NOUSENAME}" ]] && EXTRAVERSION="${EXTRAVERSION}-${PN/-*}"
158 [[ -n ${K_USEPV} ]] && EXTRAVERSION="${EXTRAVERSION}-${PV//_/-}" 186 [[ -n "${K_USEPV}" ]] && EXTRAVERSION="${EXTRAVERSION}-${PV//_/-}"
159 [[ -n ${PR//r0} ]] && EXTRAVERSION="${EXTRAVERSION}-${PR}" 187 [[ -n "${PR//r0}" ]] && EXTRAVERSION="${EXTRAVERSION}-${PR}"
160 fi 188 fi
189 debug-print "2 EXTRAVERSION:${EXTRAVERSION}"
161 190
162 # The only messing around which should actually effect this is for KV_EXTRA 191 # The only messing around which should actually effect this is for KV_EXTRA
163 # since this has to limit OKV to MAJ.MIN.PAT and strip EXTRA off else 192 # since this has to limit OKV to MAJ.MIN.PAT and strip EXTRA off else
164 # KV_FULL evaluates to MAJ.MIN.PAT.EXT.EXT after EXTRAVERSION 193 # KV_FULL evaluates to MAJ.MIN.PAT.EXT.EXT after EXTRAVERSION
165 if [[ -n ${KV_EXTRA} ]]; then 194 if [[ -n ${KV_EXTRA} ]]; then
201 KERNEL_URI="mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/snapshots/patch-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${RELEASE}.bz2 230 KERNEL_URI="mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/snapshots/patch-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${RELEASE}.bz2
202 mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/testing/patch-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${RELEASE/-git*}.bz2 231 mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/testing/patch-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${RELEASE/-git*}.bz2
203 mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/linux-${OKV}.tar.bz2" 232 mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/linux-${OKV}.tar.bz2"
204 UNIPATCH_LIST_DEFAULT="${DISTDIR}/patch-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${RELEASE/-git*}.bz2 ${DISTDIR}/patch-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${RELEASE}.bz2" 233 UNIPATCH_LIST_DEFAULT="${DISTDIR}/patch-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${RELEASE/-git*}.bz2 ${DISTDIR}/patch-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${RELEASE}.bz2"
205 fi 234 fi
235
236 debug-print-kernel2-variables
206 237
207 handle_genpatches 238 handle_genpatches
208} 239}
209 240
210kernel_is() { 241kernel_is() {
324 355
325unpack_2_6() { 356unpack_2_6() {
326 env_setup_xmakeopts 357 env_setup_xmakeopts
327 358
328 cd "${S}" 359 cd "${S}"
360
361 # since KBUILD_OUTPUT should only be used on the active kernel
362 # sources, we should unset it here.
363 [[ -n "${KBUILD_OUTPUT}" ]] && unset KBUILD_OUTPUT
364
329 # this file is required for other things to build properly, so we 365 # this file is required for other things to build properly, so we
330 # autogenerate it ... touch .config to keep version.h build from 366 # autogenerate it ... touch .config to keep version.h build from
331 # spitting out an annoying warning 367 # spitting out an annoying warning
332 make -s mrproper ${xmakeopts} || die "make mrproper failed"
333 touch .config 368 touch .config
334 make -s include/linux/version.h ${xmakeopts} || die "make include/linux/version.h failed" 369 make -s include/linux/version.h ${xmakeopts} || die "make include/linux/version.h failed"
370 make -s mrproper ${xmakeopts} || die "make mrproper failed"
335 rm -f .config 371 rm -f .config
336} 372}
337 373
338universal_unpack() { 374universal_unpack() {
339 cd ${WORKDIR} 375 cd ${WORKDIR}
417 fi 453 fi
418} 454}
419 455
420compile_manpages() { 456compile_manpages() {
421 einfo "Making manpages ..." 457 einfo "Making manpages ..."
422 env -u ARCH make mandocs 458 env -u ARCH -u KBUILD_OUTPUT make mandocs
423} 459}
424 460
425# install functions 461# install functions
426#============================================================== 462#==============================================================
427install_universal() { 463install_universal() {
951 987
952# common functions 988# common functions
953#============================================================== 989#==============================================================
954kernel-2_src_unpack() { 990kernel-2_src_unpack() {
955 universal_unpack 991 universal_unpack
992 debug-print "Doing unipatch"
956 993
957 [[ -n ${UNIPATCH_LIST} || -n ${UNIPATCH_LIST_DEFAULT} || -n ${UNIPATCH_LIST_GENPATCHES} ]] && \ 994 [[ -n ${UNIPATCH_LIST} || -n ${UNIPATCH_LIST_DEFAULT} || -n ${UNIPATCH_LIST_GENPATCHES} ]] && \
958 unipatch "${UNIPATCH_LIST_DEFAULT} ${UNIPATCH_LIST_GENPATCHES} ${UNIPATCH_LIST}" 995 unipatch "${UNIPATCH_LIST_DEFAULT} ${UNIPATCH_LIST_GENPATCHES} ${UNIPATCH_LIST}"
996
997 debug-print "Doing premake"
959 998
960 # allow ebuilds to massage the source tree after patching but before 999 # allow ebuilds to massage the source tree after patching but before
961 # we run misc `make` functions below 1000 # we run misc `make` functions below
962 [[ $(type -t kernel-2_hook_premake) == "function" ]] && kernel-2_hook_premake 1001 [[ $(type -t kernel-2_hook_premake) == "function" ]] && kernel-2_hook_premake
1002
1003 debug-print "Doing unpack_set_extraversion"
963 1004
964 [[ -z ${K_NOSETEXTRAVERSION} ]] && unpack_set_extraversion 1005 [[ -z ${K_NOSETEXTRAVERSION} ]] && unpack_set_extraversion
965 unpack_fix_docbook 1006 unpack_fix_docbook
966 unpack_fix_install_path 1007 unpack_fix_install_path
967 1008

Legend:
Removed from v.1.159  
changed lines
  Added in v.1.163

  ViewVC Help
Powered by ViewVC 1.1.20