/[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.226
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.226 2010/04/26 06:44:38 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
243 245
244 handle_genpatches 246 handle_genpatches
245} 247}
246 248
247kernel_is() { 249kernel_is() {
250 # ALL of these should be set before we can safely continue this function.
251 # some of the sources have in the past had only one set.
252 local v n=0
253 for v in OKV KV_{MAJOR,MINOR,PATCH} ; do [[ -z ${!v} ]] && n=1 ; done
248 [[ -z ${OKV} ]] && detect_version 254 [[ $n -eq 1 ]] && detect_version
255 unset v n
256
257 # Now we can continue
249 local operator test value x=0 y=0 z=0 258 local operator test value x=0 y=0 z=0
250 259
251 case ${1} in 260 case ${1} in
252 lt) operator="-lt"; shift;; 261 lt) operator="-lt"; shift;;
253 gt) operator="-gt"; shift;; 262 gt) operator="-gt"; shift;;
288if [[ ${ETYPE} == sources ]]; then 297if [[ ${ETYPE} == sources ]]; then
289 DEPEND="!build? ( sys-apps/sed 298 DEPEND="!build? ( sys-apps/sed
290 >=sys-devel/binutils-2.11.90.0.31 )" 299 >=sys-devel/binutils-2.11.90.0.31 )"
291 RDEPEND="!build? ( >=sys-libs/ncurses-5.2 300 RDEPEND="!build? ( >=sys-libs/ncurses-5.2
292 sys-devel/make )" 301 sys-devel/make )"
293 PDEPEND="virtual/dev-manager" 302 PDEPEND="!build? ( virtual/dev-manager )"
294 303
295 PROVIDE="virtual/linux-sources" 304 PROVIDE="virtual/linux-sources"
296 kernel_is gt 2 4 && PROVIDE="${PROVIDE} virtual/alsa" 305 kernel_is gt 2 4 && PROVIDE="${PROVIDE} virtual/alsa"
297 306
298 SLOT="${PVR}" 307 SLOT="${PVR}"
375 || die "make include/linux/version.h failed" 384 || die "make include/linux/version.h failed"
376 rm -f .config >/dev/null 385 rm -f .config >/dev/null
377} 386}
378 387
379universal_unpack() { 388universal_unpack() {
380 cd ${WORKDIR} 389 cd "${WORKDIR}"
381 unpack linux-${OKV}.tar.bz2 390 unpack linux-${OKV}.tar.bz2
382 if [[ -d "linux" ]]; then 391 if [[ -d "linux" ]]; then
383 mv linux linux-${KV_FULL} \ 392 mv linux linux-${KV_FULL} \
384 || die "Unable to move source tree to ${KV_FULL}." 393 || die "Unable to move source tree to ${KV_FULL}."
385 elif [[ "${OKV}" != "${KV_FULL}" ]]; then 394 elif [[ "${OKV}" != "${KV_FULL}" ]]; then
489 498
490# install functions 499# install functions
491#============================================================== 500#==============================================================
492install_universal() { 501install_universal() {
493 #fix silly permissions in tarball 502 #fix silly permissions in tarball
494 cd ${WORKDIR} 503 cd "${WORKDIR}"
495 chown -R root:0 * >& /dev/null 504 chown -R root:0 * >& /dev/null
496 chmod -R a+r-w+X,u+w * 505 chmod -R a+r-w+X,u+w *
497 cd ${OLDPWD} 506 cd ${OLDPWD}
498} 507}
499 508
544 [[ ! -e ${D}/${ddir}/asm/arch ]] && ln -sf arch-ebsa285 "${D}"/${ddir}/asm/arch 553 [[ ! -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 554 [[ ! -e ${D}/${ddir}/asm/proc ]] && ln -sf proc-armv "${D}"/${ddir}/asm/proc
546 ;; 555 ;;
547 powerpc) 556 powerpc)
548 dodir ${ddir}/asm 557 dodir ${ddir}/asm
549 cp -pPR "${S}"/include/asm/* ${D}/${ddir}/asm 558 cp -pPR "${S}"/include/asm/* "${D}"/${ddir}/asm
550 if [[ -e "${S}"/include/asm-ppc ]] ; then 559 if [[ -e "${S}"/include/asm-ppc ]] ; then
551 dodir ${ddir}/asm-ppc 560 dodir ${ddir}/asm-ppc
552 cp -pPR "${S}"/include/asm-ppc/* ${D}/${ddir}/asm-ppc 561 cp -pPR "${S}"/include/asm-ppc/* "${D}"/${ddir}/asm-ppc
553 fi 562 fi
554 ;; 563 ;;
555 *) 564 *)
556 dodir ${ddir}/asm 565 dodir ${ddir}/asm
557 cp -pPR "${S}"/include/asm/* ${D}/${ddir}/asm 566 cp -pPR "${S}"/include/asm/* "${D}"/${ddir}/asm
558 ;; 567 ;;
559 esac 568 esac
560 if [[ -n ${multi_dirs} ]] ; then 569 if [[ -n ${multi_dirs} ]] ; then
561 local d ml_inc="" 570 local d ml_inc=""
562 for d in ${multi_dirs} ; do 571 for d in ${multi_dirs} ; do
563 dodir ${ddir}/asm-${d} 572 dodir ${ddir}/asm-${d}
564 cp -pPR "${S}"/include/asm-${d}/* ${D}/${ddir}/asm-${d}/ || die "cp asm-${d} failed" 573 cp -pPR "${S}"/include/asm-${d}/* "${D}"/${ddir}/asm-${d}/ || die "cp asm-${d} failed"
565 574
566 ml_inc="${ml_inc} ${multi_defs%% *}:${ddir}/asm-${d}" 575 ml_inc="${ml_inc} ${multi_defs%% *}:${ddir}/asm-${d}"
567 multi_defs=${multi_defs#* } 576 multi_defs=${multi_defs#* }
568 done 577 done
569 create_ml_includes ${ddir}/asm ${ml_inc} 578 create_ml_includes ${ddir}/asm ${ml_inc}
570 fi 579 fi
571 580
572 if kernel_is 2 6; then 581 if kernel_is 2 6; then
573 dodir ${ddir}/asm-generic 582 dodir ${ddir}/asm-generic
574 cp -pPR "${S}"/include/asm-generic/* ${D}/${ddir}/asm-generic 583 cp -pPR "${S}"/include/asm-generic/* "${D}"/${ddir}/asm-generic
575 fi 584 fi
576 585
577 # clean up 586 # clean up
578 find "${D}" -name '*.orig' -exec rm -f {} \; 587 find "${D}" -name '*.orig' -exec rm -f {} \;
579 588
603 [[ -f ${FILESDIR}/../ChangeLog ]] && \ 612 [[ -f ${FILESDIR}/../ChangeLog ]] && \
604 echo "Please check the ebuild ChangeLog for more details." \ 613 echo "Please check the ebuild ChangeLog for more details." \
605 > "${S}"/patches.txt 614 > "${S}"/patches.txt
606 fi 615 fi
607 616
608 mv ${WORKDIR}/linux* ${D}/usr/src 617 mv ${WORKDIR}/linux* "${D}"/usr/src
609} 618}
610 619
611# pkg_preinst functions 620# pkg_preinst functions
612#============================================================== 621#==============================================================
613preinst_headers() { 622preinst_headers() {
632 641
633 # if the link doesnt exist, lets create it 642 # if the link doesnt exist, lets create it
634 [[ ! -h ${ROOT}usr/src/linux ]] && MAKELINK=1 643 [[ ! -h ${ROOT}usr/src/linux ]] && MAKELINK=1
635 644
636 if [[ ${MAKELINK} == 1 ]]; then 645 if [[ ${MAKELINK} == 1 ]]; then
637 cd ${ROOT}usr/src 646 cd "${ROOT}"usr/src
638 ln -sf linux-${KV_FULL} linux 647 ln -sf linux-${KV_FULL} linux
639 cd ${OLDPWD} 648 cd ${OLDPWD}
640 fi 649 fi
641 650
642 # Don't forget to make directory for sysfs 651 # Don't forget to make directory for sysfs
886 # sit in KPATCH_DIR's. This is handled properly in the unipatch rewrite, 895 # 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. 896 # which is why I'm not taking too much time over this.
888 local tmp 897 local tmp
889 for i in ${UNIPATCH_DOCS}; do 898 for i in ${UNIPATCH_DOCS}; do
890 tmp="${tmp} ${i//*\/}" 899 tmp="${tmp} ${i//*\/}"
891 cp -f ${i} ${T}/ 900 cp -f ${i} "${T}"/
892 done 901 done
893 UNIPATCH_DOCS="${tmp}" 902 UNIPATCH_DOCS="${tmp}"
894 903
895 # clean up KPATCH_DIR's - fixes bug #53610 904 # clean up KPATCH_DIR's - fixes bug #53610
896 for x in ${KPATCH_DIR}; do rm -Rf ${x}; done 905 for x in ${KPATCH_DIR}; do rm -Rf ${x}; done
1041 debug-print "Doing premake" 1050 debug-print "Doing premake"
1042 1051
1043 # allow ebuilds to massage the source tree after patching but before 1052 # allow ebuilds to massage the source tree after patching but before
1044 # we run misc `make` functions below 1053 # we run misc `make` functions below
1045 [[ $(type -t kernel-2_hook_premake) == "function" ]] && kernel-2_hook_premake 1054 [[ $(type -t kernel-2_hook_premake) == "function" ]] && kernel-2_hook_premake
1055
1056 debug-print "Doing epatch_user"
1057 epatch_user
1046 1058
1047 debug-print "Doing unpack_set_extraversion" 1059 debug-print "Doing unpack_set_extraversion"
1048 1060
1049 [[ -z ${K_NOSETEXTRAVERSION} ]] && unpack_set_extraversion 1061 [[ -z ${K_NOSETEXTRAVERSION} ]] && unpack_set_extraversion
1050 unpack_fix_install_path 1062 unpack_fix_install_path

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

  ViewVC Help
Powered by ViewVC 1.1.20