/[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.179
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.179 2006/06/10 16:19:54 swegener 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'
70fi 71fi
71 72
72HOMEPAGE="http://www.kernel.org/ http://www.gentoo.org/" 73HOMEPAGE="http://www.kernel.org/ http://www.gentoo.org/"
73LICENSE="GPL-2" 74LICENSE="GPL-2"
74 75
76# No need to run scanelf/strip on kernel sources/headers (bug #134453).
77RESTRICT="binchecks strip"
78
75# set LINUX_HOSTCFLAGS if not already set 79# set LINUX_HOSTCFLAGS if not already set
76[[ -z ${LINUX_HOSTCFLAGS} ]] && \ 80[[ -z ${LINUX_HOSTCFLAGS} ]] && \
77 LINUX_HOSTCFLAGS="-Wall -Wstrict-prototypes -Os -fomit-frame-pointer -I${S}/include" 81 LINUX_HOSTCFLAGS="-Wall -Wstrict-prototypes -Os -fomit-frame-pointer -I${S}/include"
82
83# debugging functions
84#==============================================================
85# this function exists only to help debug kernel-2.eclass
86# if you are adding new functionality in, put a call to it
87# at the start of src_unpack, or during SRC_URI/dep generation.
88debug-print-kernel2-variables() {
89 debug-print "PVR: ${PVR}"
90 debug-print "CKV: ${CKV}"
91 debug-print "OKV: ${OKV}"
92 debug-print "KV: ${KV}"
93 debug-print "KV_FULL: ${KV_FULL}"
94 debug-print "RELEASETYPE: ${RELEASETYPE}"
95 debug-print "RELEASE: ${RELEASE}"
96 debug-print "UNIPATCH_LIST_DEFAULT: ${UNIPATCH_LIST_DEFAULT} "
97 debug-print "UNIPATCH_LIST_GENPATCHES: ${UNIPATCH_LIST_GENPATCHES} "
98 debug-print "UNIPATCH_LIST: ${UNIPATCH_LIST}"
99 debug-print "S: ${S}"
100 debug-print "KERNEL_URI: ${KERNEL_URI}"
101}
78 102
79#Eclass functions only from here onwards ... 103#Eclass functions only from here onwards ...
80#============================================================== 104#==============================================================
81handle_genpatches() { 105handle_genpatches() {
82 local tarball 106 local tarball
139 # Now we know that RELEASE is the -rc/-git 163 # Now we know that RELEASE is the -rc/-git
140 # and RELEASETYPE is the same but with its numerics stripped 164 # and RELEASETYPE is the same but with its numerics stripped
141 # we can work on better sorting EXTRAVERSION. 165 # we can work on better sorting EXTRAVERSION.
142 # first of all, we add the release 166 # first of all, we add the release
143 EXTRAVERSION="${RELEASE}" 167 EXTRAVERSION="${RELEASE}"
168 debug-print "0 EXTRAVERSION:${EXTRAVERSION}"
144 [[ -n ${KV_EXTRA} ]] && EXTRAVERSION=".${KV_EXTRA}${EXTRAVERSION}" 169 [[ -n ${KV_EXTRA} ]] && EXTRAVERSION=".${KV_EXTRA}${EXTRAVERSION}"
145 170
171 debug-print "1 EXTRAVERSION:${EXTRAVERSION}"
172 if [[ -n "${K_NOUSEPR}" ]]; then
173 # Don't add anything based on PR to EXTRAVERSION
174 debug-print "1.0 EXTRAVERSION:${EXTRAVERSION}"
146 if [[ -n ${K_PREPATCHED} ]]; then 175 elif [[ -n ${K_PREPATCHED} ]]; then
176 debug-print "1.1 EXTRAVERSION:${EXTRAVERSION}"
147 EXTRAVERSION="${EXTRAVERSION}-${PN/-*}${PR/r}" 177 EXTRAVERSION="${EXTRAVERSION}-${PN/-*}${PR/r}"
148 elif [[ "${ETYPE}" = "sources" ]]; then 178 elif [[ "${ETYPE}" = "sources" ]]; then
179 debug-print "1.2 EXTRAVERSION:${EXTRAVERSION}"
149 # For some sources we want to use the PV in the extra version 180 # For some sources we want to use the PV in the extra version
150 # This is because upstream releases with a completely different 181 # This is because upstream releases with a completely different
151 # versioning scheme. 182 # versioning scheme.
152 case ${PN/-*} in 183 case ${PN/-*} in
153 wolk) K_USEPV=1;; 184 wolk) K_USEPV=1;;
154 vserver) K_USEPV=1;; 185 vserver) K_USEPV=1;;
155 esac 186 esac
156 187
157 [[ -z ${K_NOUSENAME} ]] && EXTRAVERSION="${EXTRAVERSION}-${PN/-*}" 188 [[ -z "${K_NOUSENAME}" ]] && EXTRAVERSION="${EXTRAVERSION}-${PN/-*}"
158 [[ -n ${K_USEPV} ]] && EXTRAVERSION="${EXTRAVERSION}-${PV//_/-}" 189 [[ -n "${K_USEPV}" ]] && EXTRAVERSION="${EXTRAVERSION}-${PV//_/-}"
159 [[ -n ${PR//r0} ]] && EXTRAVERSION="${EXTRAVERSION}-${PR}" 190 [[ -n "${PR//r0}" ]] && EXTRAVERSION="${EXTRAVERSION}-${PR}"
160 fi 191 fi
192 debug-print "2 EXTRAVERSION:${EXTRAVERSION}"
161 193
162 # The only messing around which should actually effect this is for KV_EXTRA 194 # 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 195 # 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 196 # KV_FULL evaluates to MAJ.MIN.PAT.EXT.EXT after EXTRAVERSION
165 if [[ -n ${KV_EXTRA} ]]; then 197 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 233 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 234 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" 235 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" 236 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 237 fi
238
239 debug-print-kernel2-variables
206 240
207 handle_genpatches 241 handle_genpatches
208} 242}
209 243
210kernel_is() { 244kernel_is() {
265 IUSE="symlink build doc" 299 IUSE="symlink build doc"
266elif [[ ${ETYPE} == headers ]]; then 300elif [[ ${ETYPE} == headers ]]; then
267 DESCRIPTION="Linux system headers" 301 DESCRIPTION="Linux system headers"
268 IUSE="" 302 IUSE=""
269 303
304 # Since we should NOT honour KBUILD_OUTPUT in headers
305 # lets unset it here.
306 unset KBUILD_OUTPUT
307
270 if [[ ${CTARGET} = ${CHOST} ]]; then 308 if [[ ${CTARGET} = ${CHOST} ]]; then
271 DEPEND="!virtual/os-headers" 309 DEPEND="!virtual/os-headers"
272 PROVIDE="virtual/os-headers" 310 PROVIDE="virtual/os-headers"
273 SLOT="0" 311 SLOT="0"
274 else 312 else
282# Cross-compile support functions 320# Cross-compile support functions
283#============================================================== 321#==============================================================
284kernel_header_destdir() { 322kernel_header_destdir() {
285 [[ ${CTARGET} == ${CHOST} ]] \ 323 [[ ${CTARGET} == ${CHOST} ]] \
286 && echo /usr/include \ 324 && echo /usr/include \
287 || echo /usr/${CTARGET}/include 325 || echo /usr/${CTARGET}/usr/include
288} 326}
289 327
290cross_pre_c_headers() { 328cross_pre_c_headers() {
291 [[ -z ${_E_CROSS_HEADERS_ONLY} ]] && return 1 329 has _E_CROSS_HEADERS_ONLY ${USE} && [[ ${CHOST} != ${CTARGET} ]]
292 [[ ${CHOST} == ${CTARGET} ]] && return 1
293 return 0
294} 330}
295 331
296env_setup_xmakeopts() { 332env_setup_xmakeopts() {
297 # Kernel ARCH != portage ARCH 333 # Kernel ARCH != portage ARCH
298 export KARCH=$(tc-arch-kernel) 334 export KARCH=$(tc-arch-kernel)
309} 345}
310 346
311# Unpack functions 347# Unpack functions
312#============================================================== 348#==============================================================
313unpack_2_4() { 349unpack_2_4() {
314 env_setup_xmakeopts
315
316 cd "${S}"
317 # this file is required for other things to build properly, 350 # this file is required for other things to build properly,
318 # so we autogenerate it 351 # so we autogenerate it
319 make -s mrproper ${xmakeopts} || die "make mrproper failed" 352 make -s mrproper ${xmakeopts} || die "make mrproper failed"
320 make -s symlinks ${xmakeopts} || die "make symlinks failed" 353 make -s symlinks ${xmakeopts} || die "make symlinks failed"
321 make -s include/linux/version.h ${xmakeopts} || die "make include/linux/version.h failed" 354 make -s include/linux/version.h ${xmakeopts} || die "make include/linux/version.h failed"
322 echo ">>> version.h compiled successfully." 355 echo ">>> version.h compiled successfully."
323} 356}
324 357
325unpack_2_6() { 358unpack_2_6() {
326 env_setup_xmakeopts
327
328 cd "${S}"
329 # this file is required for other things to build properly, so we 359 # this file is required for other things to build properly, so we
330 # autogenerate it ... touch .config to keep version.h build from 360 # autogenerate it ... generate a .config to keep version.h build from
331 # spitting out an annoying warning 361 # spitting out an annoying warning
332 make -s mrproper ${xmakeopts} || die "make mrproper failed" 362 make -s mrproper ${xmakeopts} 2>/dev/null \
363 || die "make mrproper failed"
364
365 # quick fix for bug #132152 which triggers when it cannot include linux
366 # headers (ie, we have not installed it yet)
367 if ! (make -s defconfig ${xmakeopts} &>/dev/null 2>&1); then
333 touch .config 368 touch .config
334 make -s include/linux/version.h ${xmakeopts} || die "make include/linux/version.h failed" 369 eerror "make defconfig failed."
335 rm -f .config 370 eerror "assuming you dont have any headers installed yet and continuing"
371 epause 5
372 fi
373
374 make -s include/linux/version.h ${xmakeopts} 2>/dev/null \
375 || die "make include/linux/version.h failed"
376 rm -f .config >/dev/null
336} 377}
337 378
338universal_unpack() { 379universal_unpack() {
339 cd ${WORKDIR} 380 cd ${WORKDIR}
340 unpack linux-${OKV}.tar.bz2 381 unpack linux-${OKV}.tar.bz2
382 if [[ -d "linux" ]]; then
383 mv linux linux-${KV_FULL} \
384 || die "Unable to move source tree to ${KV_FULL}."
341 if [[ "${OKV}" != "${KV_FULL}" ]]; then 385 elif [[ "${OKV}" != "${KV_FULL}" ]]; then
342 mv linux-${OKV} linux-${KV_FULL} \ 386 mv linux-${OKV} linux-${KV_FULL} \
343 || die "Unable to move source tree to ${KV_FULL}." 387 || die "Unable to move source tree to ${KV_FULL}."
344 fi 388 fi
345 cd "${S}" 389 cd "${S}"
346 390
376 420
377# Compile Functions 421# Compile Functions
378#============================================================== 422#==============================================================
379compile_headers() { 423compile_headers() {
380 env_setup_xmakeopts 424 env_setup_xmakeopts
381
382 # Since KBUILD_OUTPUT shouldnt be used when compiling headers, lets unset it
383 # if it exists.
384 [[ -n ${KBUILD_OUTPUT} ]] && unset KBUILD_OUTPUT
385 425
386 # if we couldnt obtain HOSTCFLAGS from the Makefile, 426 # if we couldnt obtain HOSTCFLAGS from the Makefile,
387 # then set it to something sane 427 # then set it to something sane
388 local HOSTCFLAGS=$(getfilevar HOSTCFLAGS "${S}"/Makefile) 428 local HOSTCFLAGS=$(getfilevar HOSTCFLAGS "${S}"/Makefile)
389 HOSTCFLAGS=${HOSTCFLAGS:--Wall -Wstrict-prototypes -O2 -fomit-frame-pointer} 429 HOSTCFLAGS=${HOSTCFLAGS:--Wall -Wstrict-prototypes -O2 -fomit-frame-pointer}
409 # to force an include path with $S. 449 # to force an include path with $S.
410 HOSTCFLAGS="${HOSTCFLAGS} -I${S}/include/" 450 HOSTCFLAGS="${HOSTCFLAGS} -I${S}/include/"
411 ln -sf asm-${KARCH} "${S}"/include/asm 451 ln -sf asm-${KARCH} "${S}"/include/asm
412 cross_pre_c_headers && return 0 452 cross_pre_c_headers && return 0
413 453
414 make ${K_DEFCONFIG} HOSTCFLAGS="${HOSTCFLAGS}" ${xmakeopts} || die "defconfig failed" 454 make ${K_DEFCONFIG} HOSTCFLAGS="${HOSTCFLAGS}" ${xmakeopts} || die "defconfig failed (${K_DEFCONFIG})"
455 if compile_headers_tweak_config ; then
456 yes "" | make oldconfig HOSTCFLAGS="${HOSTCFLAGS}" ${xmakeopts} || die "2nd oldconfig failed"
457 fi
415 make prepare HOSTCFLAGS="${HOSTCFLAGS}" ${xmakeopts} || die "prepare failed" 458 make prepare HOSTCFLAGS="${HOSTCFLAGS}" ${xmakeopts} || die "prepare failed"
416 make prepare-all HOSTCFLAGS="${HOSTCFLAGS}" ${xmakeopts} || die "prepare failed" 459 make prepare-all HOSTCFLAGS="${HOSTCFLAGS}" ${xmakeopts} || die "prepare failed"
417 fi 460 fi
418} 461}
419 462
463compile_headers_tweak_config() {
464 # some targets can be very very picky, so let's finesse the
465 # .config based upon any info we may have
466 case ${CTARGET} in
467 sh*)
468 sed -i '/CONFIG_CPU_SH/d' .config
469 echo "CONFIG_CPU_SH${CTARGET:2:1}=y" >> .config
470 return 0;;
471 esac
472
473 # no changes, so lets do nothing
474 return 1
475}
476
420compile_manpages() { 477compile_manpages() {
421 einfo "Making manpages ..." 478 einfo "Making manpages ..."
422 env -u ARCH make mandocs 479 env -u ARCH -u KBUILD_OUTPUT make mandocs
423} 480}
424 481
425# install functions 482# install functions
426#============================================================== 483#==============================================================
427install_universal() { 484install_universal() {
428 #fix silly permissions in tarball 485 #fix silly permissions in tarball
429 cd ${WORKDIR} 486 cd ${WORKDIR}
430 chown -R root:root * 487 chown -R root:0 *
431 chmod -R a+r-w+X,u+w * 488 chmod -R a+r-w+X,u+w *
432 cd ${OLDPWD} 489 cd ${OLDPWD}
433} 490}
434 491
435install_headers() { 492install_headers() {
436 local ddir=$(kernel_header_destdir) 493 local ddir=$(kernel_header_destdir)
437 494
438 cd "${S}" 495 cd "${S}"
439 dodir ${ddir}/linux 496 dodir ${ddir}/linux
440 cp -ax "${S}"/include/linux/* ${D}/${ddir}/linux 497 cp -pPR "${S}"/include/linux/* ${D}/${ddir}/linux
441 rm -rf ${D}/${ddir}/linux/modules 498 rm -rf ${D}/${ddir}/linux/modules
442 499
443 # Handle multilib headers and crap 500 # Handle multilib headers and crap
444 local multi_dirs="" multi_defs="" 501 local multi_dirs="" multi_defs=""
445 case $(tc-arch-kernel) in 502 case $(tc-arch-kernel) in
459 multi_dirs="s390 s390x" 516 multi_dirs="s390 s390x"
460 multi_defs="!__s390x__ __s390x__" 517 multi_defs="!__s390x__ __s390x__"
461 ;; 518 ;;
462 arm) 519 arm)
463 dodir ${ddir}/asm 520 dodir ${ddir}/asm
464 cp -ax "${S}"/include/asm/* "${D}"/${ddir}/asm 521 cp -pPR "${S}"/include/asm/* "${D}"/${ddir}/asm
465 [[ ! -e ${D}/${ddir}/asm/arch ]] && ln -sf arch-ebsa285 "${D}"/${ddir}/asm/arch 522 [[ ! -e ${D}/${ddir}/asm/arch ]] && ln -sf arch-ebsa285 "${D}"/${ddir}/asm/arch
466 [[ ! -e ${D}/${ddir}/asm/proc ]] && ln -sf proc-armv "${D}"/${ddir}/asm/proc 523 [[ ! -e ${D}/${ddir}/asm/proc ]] && ln -sf proc-armv "${D}"/${ddir}/asm/proc
467 ;; 524 ;;
468 powerpc) 525 powerpc)
469 dodir ${ddir}/asm 526 dodir ${ddir}/asm
470 cp -ax "${S}"/include/asm/* ${D}/${ddir}/asm 527 cp -pPR "${S}"/include/asm/* ${D}/${ddir}/asm
471 if [[ -e "${S}"/include/asm-ppc ]] ; then 528 if [[ -e "${S}"/include/asm-ppc ]] ; then
472 dodir ${ddir}/asm-ppc 529 dodir ${ddir}/asm-ppc
473 cp -ax "${S}"/include/asm-ppc/* ${D}/${ddir}/asm-ppc 530 cp -pPR "${S}"/include/asm-ppc/* ${D}/${ddir}/asm-ppc
474 fi 531 fi
475 ;; 532 ;;
476 *) 533 *)
477 dodir ${ddir}/asm 534 dodir ${ddir}/asm
478 cp -ax "${S}"/include/asm/* ${D}/${ddir}/asm 535 cp -pPR "${S}"/include/asm/* ${D}/${ddir}/asm
479 ;; 536 ;;
480 esac 537 esac
481 if [[ -n ${multi_dirs} ]] ; then 538 if [[ -n ${multi_dirs} ]] ; then
482 local d ml_inc="" 539 local d ml_inc=""
483 for d in ${multi_dirs} ; do 540 for d in ${multi_dirs} ; do
484 dodir ${ddir}/asm-${d} 541 dodir ${ddir}/asm-${d}
485 cp -ax "${S}"/include/asm-${d}/* ${D}/${ddir}/asm-${d}/ || die "cp asm-${d} failed" 542 cp -pPR "${S}"/include/asm-${d}/* ${D}/${ddir}/asm-${d}/ || die "cp asm-${d} failed"
486 543
487 ml_inc="${ml_inc} ${multi_defs%% *}:${ddir}/asm-${d}" 544 ml_inc="${ml_inc} ${multi_defs%% *}:${ddir}/asm-${d}"
488 multi_defs=${multi_defs#* } 545 multi_defs=${multi_defs#* }
489 done 546 done
490 create_ml_includes ${ddir}/asm ${ml_inc} 547 create_ml_includes ${ddir}/asm ${ml_inc}
491 fi 548 fi
492 549
493 if kernel_is 2 6; then 550 if kernel_is 2 6; then
494 dodir ${ddir}/asm-generic 551 dodir ${ddir}/asm-generic
495 cp -ax "${S}"/include/asm-generic/* ${D}/${ddir}/asm-generic 552 cp -pPR "${S}"/include/asm-generic/* ${D}/${ddir}/asm-generic
496 fi 553 fi
497 554
498 # clean up 555 # clean up
499 find "${D}" -name '*.orig' -exec rm -f {} \; 556 find "${D}" -name '*.orig' -exec rm -f {} \;
500 557
565 622
566 # if we have USE=symlink, then force K_SYMLINK=1 623 # if we have USE=symlink, then force K_SYMLINK=1
567 use symlink && K_SYMLINK=1 624 use symlink && K_SYMLINK=1
568 625
569 # if we are to forcably symlink, delete it if it already exists first. 626 # if we are to forcably symlink, delete it if it already exists first.
570 if [[ -n ${K_SYMLINK} ]]; then 627 if [[ ${K_SYMLINK} > 0 ]]; then
571 [[ -h ${ROOT}usr/src/linux ]] && rm ${ROOT}usr/src/linux 628 [[ -h ${ROOT}usr/src/linux ]] && rm ${ROOT}usr/src/linux
572 MAKELINK=1 629 MAKELINK=1
573 fi 630 fi
574 631
575 # if the link doesnt exist, lets create it 632 # if the link doesnt exist, lets create it
951 1008
952# common functions 1009# common functions
953#============================================================== 1010#==============================================================
954kernel-2_src_unpack() { 1011kernel-2_src_unpack() {
955 universal_unpack 1012 universal_unpack
1013 debug-print "Doing unipatch"
956 1014
957 [[ -n ${UNIPATCH_LIST} || -n ${UNIPATCH_LIST_DEFAULT} || -n ${UNIPATCH_LIST_GENPATCHES} ]] && \ 1015 [[ -n ${UNIPATCH_LIST} || -n ${UNIPATCH_LIST_DEFAULT} || -n ${UNIPATCH_LIST_GENPATCHES} ]] && \
958 unipatch "${UNIPATCH_LIST_DEFAULT} ${UNIPATCH_LIST_GENPATCHES} ${UNIPATCH_LIST}" 1016 unipatch "${UNIPATCH_LIST_DEFAULT} ${UNIPATCH_LIST_GENPATCHES} ${UNIPATCH_LIST}"
1017
1018 debug-print "Doing premake"
959 1019
960 # allow ebuilds to massage the source tree after patching but before 1020 # allow ebuilds to massage the source tree after patching but before
961 # we run misc `make` functions below 1021 # we run misc `make` functions below
962 [[ $(type -t kernel-2_hook_premake) == "function" ]] && kernel-2_hook_premake 1022 [[ $(type -t kernel-2_hook_premake) == "function" ]] && kernel-2_hook_premake
963 1023
1024 debug-print "Doing unpack_set_extraversion"
1025
964 [[ -z ${K_NOSETEXTRAVERSION} ]] && unpack_set_extraversion 1026 [[ -z ${K_NOSETEXTRAVERSION} ]] && unpack_set_extraversion
965 unpack_fix_docbook 1027 unpack_fix_docbook
966 unpack_fix_install_path 1028 unpack_fix_install_path
967 1029
1030 # Setup xmakeopts and cd into sourcetree.
1031 env_setup_xmakeopts
1032 cd "${S}"
1033
1034 # We dont need a version.h for anything other than headers
1035 # at least, I should hope we dont. If this causes problems
1036 # take out the if/fi block and inform me please.
1037 # unpack_2_6 should now be 2.6.17 safe anyways
1038 if [[ ${ETYPE} == headers ]]; then
968 kernel_is 2 4 && unpack_2_4 1039 kernel_is 2 4 && unpack_2_4
969 kernel_is 2 6 && unpack_2_6 1040 kernel_is 2 6 && unpack_2_6
1041 fi
970} 1042}
971 1043
972kernel-2_src_compile() { 1044kernel-2_src_compile() {
973 cd "${S}" 1045 cd "${S}"
974 [[ ${ETYPE} == headers ]] && compile_headers 1046 [[ ${ETYPE} == headers ]] && compile_headers
990 [[ ${ETYPE} == headers ]] && postinst_headers 1062 [[ ${ETYPE} == headers ]] && postinst_headers
991 [[ ${ETYPE} == sources ]] && postinst_sources 1063 [[ ${ETYPE} == sources ]] && postinst_sources
992} 1064}
993 1065
994kernel-2_pkg_setup() { 1066kernel-2_pkg_setup() {
1067 ABI="${KERNEL_ABI}"
995 [[ ${ETYPE} == headers ]] && setup_headers 1068 [[ ${ETYPE} == headers ]] && setup_headers
996 [[ ${ETYPE} == sources ]] && echo ">>> Preparing to unpack ..." 1069 [[ ${ETYPE} == sources ]] && echo ">>> Preparing to unpack ..."
997} 1070}

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

  ViewVC Help
Powered by ViewVC 1.1.20