/[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.221 Revision 1.225
1# Copyright 1999-2009 Gentoo Foundation 1# Copyright 1999-2009 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.221 2009/10/20 19:17:59 zmedico Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/kernel-2.eclass,v 1.225 2010/04/01 21:12:20 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# Original author: John Mylchreest <johnm@gentoo.org> 8# Original author: John Mylchreest <johnm@gentoo.org>
72if [[ ${CTARGET} == ${CHOST} && ${CATEGORY/cross-} != ${CATEGORY} ]]; then 72if [[ ${CTARGET} == ${CHOST} && ${CATEGORY/cross-} != ${CATEGORY} ]]; then
73 export CTARGET=${CATEGORY/cross-} 73 export CTARGET=${CATEGORY/cross-}
74fi 74fi
75 75
76HOMEPAGE="http://www.kernel.org/ http://www.gentoo.org/ ${HOMEPAGE}" 76HOMEPAGE="http://www.kernel.org/ http://www.gentoo.org/ ${HOMEPAGE}"
77# Reflect that kernels contain firmware blobs unless otherwise stripped
78[[ -z ${LICENSE} ]] && \
77LICENSE="GPL-2" 79 LICENSE="GPL-2 freedist"
78 80
79# No need to run scanelf/strip on kernel sources/headers (bug #134453). 81# No need to run scanelf/strip on kernel sources/headers (bug #134453).
80RESTRICT="binchecks strip" 82RESTRICT="binchecks strip"
81 83
82# set LINUX_HOSTCFLAGS if not already set 84# set LINUX_HOSTCFLAGS if not already set
288if [[ ${ETYPE} == sources ]]; then 290if [[ ${ETYPE} == sources ]]; then
289 DEPEND="!build? ( sys-apps/sed 291 DEPEND="!build? ( sys-apps/sed
290 >=sys-devel/binutils-2.11.90.0.31 )" 292 >=sys-devel/binutils-2.11.90.0.31 )"
291 RDEPEND="!build? ( >=sys-libs/ncurses-5.2 293 RDEPEND="!build? ( >=sys-libs/ncurses-5.2
292 sys-devel/make )" 294 sys-devel/make )"
293 PDEPEND="virtual/dev-manager" 295 PDEPEND="!build? ( virtual/dev-manager )"
294 296
295 PROVIDE="virtual/linux-sources" 297 PROVIDE="virtual/linux-sources"
296 kernel_is gt 2 4 && PROVIDE="${PROVIDE} virtual/alsa" 298 kernel_is gt 2 4 && PROVIDE="${PROVIDE} virtual/alsa"
297 299
298 SLOT="${PVR}" 300 SLOT="${PVR}"
375 || die "make include/linux/version.h failed" 377 || die "make include/linux/version.h failed"
376 rm -f .config >/dev/null 378 rm -f .config >/dev/null
377} 379}
378 380
379universal_unpack() { 381universal_unpack() {
380 cd ${WORKDIR} 382 cd "${WORKDIR}"
381 unpack linux-${OKV}.tar.bz2 383 unpack linux-${OKV}.tar.bz2
382 if [[ -d "linux" ]]; then 384 if [[ -d "linux" ]]; then
383 mv linux linux-${KV_FULL} \ 385 mv linux linux-${KV_FULL} \
384 || die "Unable to move source tree to ${KV_FULL}." 386 || die "Unable to move source tree to ${KV_FULL}."
385 elif [[ "${OKV}" != "${KV_FULL}" ]]; then 387 elif [[ "${OKV}" != "${KV_FULL}" ]]; then
489 491
490# install functions 492# install functions
491#============================================================== 493#==============================================================
492install_universal() { 494install_universal() {
493 #fix silly permissions in tarball 495 #fix silly permissions in tarball
494 cd ${WORKDIR} 496 cd "${WORKDIR}"
495 chown -R root:0 * >& /dev/null 497 chown -R root:0 * >& /dev/null
496 chmod -R a+r-w+X,u+w * 498 chmod -R a+r-w+X,u+w *
497 cd ${OLDPWD} 499 cd ${OLDPWD}
498} 500}
499 501
544 [[ ! -e ${D}/${ddir}/asm/arch ]] && ln -sf arch-ebsa285 "${D}"/${ddir}/asm/arch 546 [[ ! -e ${D}/${ddir}/asm/arch ]] && ln -sf arch-ebsa285 "${D}"/${ddir}/asm/arch
545 [[ ! -e ${D}/${ddir}/asm/proc ]] && ln -sf proc-armv "${D}"/${ddir}/asm/proc 547 [[ ! -e ${D}/${ddir}/asm/proc ]] && ln -sf proc-armv "${D}"/${ddir}/asm/proc
546 ;; 548 ;;
547 powerpc) 549 powerpc)
548 dodir ${ddir}/asm 550 dodir ${ddir}/asm
549 cp -pPR "${S}"/include/asm/* ${D}/${ddir}/asm 551 cp -pPR "${S}"/include/asm/* "${D}"/${ddir}/asm
550 if [[ -e "${S}"/include/asm-ppc ]] ; then 552 if [[ -e "${S}"/include/asm-ppc ]] ; then
551 dodir ${ddir}/asm-ppc 553 dodir ${ddir}/asm-ppc
552 cp -pPR "${S}"/include/asm-ppc/* ${D}/${ddir}/asm-ppc 554 cp -pPR "${S}"/include/asm-ppc/* "${D}"/${ddir}/asm-ppc
553 fi 555 fi
554 ;; 556 ;;
555 *) 557 *)
556 dodir ${ddir}/asm 558 dodir ${ddir}/asm
557 cp -pPR "${S}"/include/asm/* ${D}/${ddir}/asm 559 cp -pPR "${S}"/include/asm/* "${D}"/${ddir}/asm
558 ;; 560 ;;
559 esac 561 esac
560 if [[ -n ${multi_dirs} ]] ; then 562 if [[ -n ${multi_dirs} ]] ; then
561 local d ml_inc="" 563 local d ml_inc=""
562 for d in ${multi_dirs} ; do 564 for d in ${multi_dirs} ; do
563 dodir ${ddir}/asm-${d} 565 dodir ${ddir}/asm-${d}
564 cp -pPR "${S}"/include/asm-${d}/* ${D}/${ddir}/asm-${d}/ || die "cp asm-${d} failed" 566 cp -pPR "${S}"/include/asm-${d}/* "${D}"/${ddir}/asm-${d}/ || die "cp asm-${d} failed"
565 567
566 ml_inc="${ml_inc} ${multi_defs%% *}:${ddir}/asm-${d}" 568 ml_inc="${ml_inc} ${multi_defs%% *}:${ddir}/asm-${d}"
567 multi_defs=${multi_defs#* } 569 multi_defs=${multi_defs#* }
568 done 570 done
569 create_ml_includes ${ddir}/asm ${ml_inc} 571 create_ml_includes ${ddir}/asm ${ml_inc}
570 fi 572 fi
571 573
572 if kernel_is 2 6; then 574 if kernel_is 2 6; then
573 dodir ${ddir}/asm-generic 575 dodir ${ddir}/asm-generic
574 cp -pPR "${S}"/include/asm-generic/* ${D}/${ddir}/asm-generic 576 cp -pPR "${S}"/include/asm-generic/* "${D}"/${ddir}/asm-generic
575 fi 577 fi
576 578
577 # clean up 579 # clean up
578 find "${D}" -name '*.orig' -exec rm -f {} \; 580 find "${D}" -name '*.orig' -exec rm -f {} \;
579 581
603 [[ -f ${FILESDIR}/../ChangeLog ]] && \ 605 [[ -f ${FILESDIR}/../ChangeLog ]] && \
604 echo "Please check the ebuild ChangeLog for more details." \ 606 echo "Please check the ebuild ChangeLog for more details." \
605 > "${S}"/patches.txt 607 > "${S}"/patches.txt
606 fi 608 fi
607 609
608 mv ${WORKDIR}/linux* ${D}/usr/src 610 mv ${WORKDIR}/linux* "${D}"/usr/src
609} 611}
610 612
611# pkg_preinst functions 613# pkg_preinst functions
612#============================================================== 614#==============================================================
613preinst_headers() { 615preinst_headers() {
632 634
633 # if the link doesnt exist, lets create it 635 # if the link doesnt exist, lets create it
634 [[ ! -h ${ROOT}usr/src/linux ]] && MAKELINK=1 636 [[ ! -h ${ROOT}usr/src/linux ]] && MAKELINK=1
635 637
636 if [[ ${MAKELINK} == 1 ]]; then 638 if [[ ${MAKELINK} == 1 ]]; then
637 cd ${ROOT}usr/src 639 cd "${ROOT}"usr/src
638 ln -sf linux-${KV_FULL} linux 640 ln -sf linux-${KV_FULL} linux
639 cd ${OLDPWD} 641 cd ${OLDPWD}
640 fi 642 fi
641 643
642 # Don't forget to make directory for sysfs 644 # Don't forget to make directory for sysfs
886 # sit in KPATCH_DIR's. This is handled properly in the unipatch rewrite, 888 # sit in KPATCH_DIR's. This is handled properly in the unipatch rewrite,
887 # which is why I'm not taking too much time over this. 889 # which is why I'm not taking too much time over this.
888 local tmp 890 local tmp
889 for i in ${UNIPATCH_DOCS}; do 891 for i in ${UNIPATCH_DOCS}; do
890 tmp="${tmp} ${i//*\/}" 892 tmp="${tmp} ${i//*\/}"
891 cp -f ${i} ${T}/ 893 cp -f ${i} "${T}"/
892 done 894 done
893 UNIPATCH_DOCS="${tmp}" 895 UNIPATCH_DOCS="${tmp}"
894 896
895 # clean up KPATCH_DIR's - fixes bug #53610 897 # clean up KPATCH_DIR's - fixes bug #53610
896 for x in ${KPATCH_DIR}; do rm -Rf ${x}; done 898 for x in ${KPATCH_DIR}; do rm -Rf ${x}; done
1041 debug-print "Doing premake" 1043 debug-print "Doing premake"
1042 1044
1043 # allow ebuilds to massage the source tree after patching but before 1045 # allow ebuilds to massage the source tree after patching but before
1044 # we run misc `make` functions below 1046 # we run misc `make` functions below
1045 [[ $(type -t kernel-2_hook_premake) == "function" ]] && kernel-2_hook_premake 1047 [[ $(type -t kernel-2_hook_premake) == "function" ]] && kernel-2_hook_premake
1048
1049 debug-print "Doing epatch_user"
1050 epatch_user
1046 1051
1047 debug-print "Doing unpack_set_extraversion" 1052 debug-print "Doing unpack_set_extraversion"
1048 1053
1049 [[ -z ${K_NOSETEXTRAVERSION} ]] && unpack_set_extraversion 1054 [[ -z ${K_NOSETEXTRAVERSION} ]] && unpack_set_extraversion
1050 unpack_fix_install_path 1055 unpack_fix_install_path

Legend:
Removed from v.1.221  
changed lines
  Added in v.1.225

  ViewVC Help
Powered by ViewVC 1.1.20