/[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.50 Revision 1.51
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/kernel-2.eclass,v 1.50 2004/11/25 23:39:34 johnm Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/kernel-2.eclass,v 1.51 2004/11/26 01:47:42 johnm Exp $
4 4
5# kernel.eclass rewrite for a clean base regarding the 2.6 series of kernel 5# kernel.eclass rewrite for a clean base regarding the 2.6 series of kernel
6# with back-compatibility for 2.4 6# with back-compatibility for 2.4
7# 7#
8# Author: John Mylchreest <johnm@gentoo.org> 8# Author: John Mylchreest <johnm@gentoo.org>
61SLOT="${KV}" 61SLOT="${KV}"
62 62
63# Grab kernel version from KV 63# Grab kernel version from KV
64KV_MAJOR=$(echo ${KV} | cut -d. -f1) 64KV_MAJOR=$(echo ${KV} | cut -d. -f1)
65KV_MINOR=$(echo ${KV} | cut -d. -f2) 65KV_MINOR=$(echo ${KV} | cut -d. -f2)
66KV_PATCH=$(echo ${KV} | cut -d. -f3) 66KV_PATCH=$(echo ${KV} | cut -d. -f3-)
67KV_PATCH=${KV_PATCH/[-_]*/} 67KV_PATCH=${KV_PATCH/[-_]*/}
68 68
69# set LINUX_HOSTCFLAGS if not already set 69# set LINUX_HOSTCFLAGS if not already set
70[ -z "$LINUX_HOSTCFLAGS" ] && LINUX_HOSTCFLAGS="-Wall -Wstrict-prototypes -Os -fomit-frame-pointer -I${S}/include" 70[ -z "$LINUX_HOSTCFLAGS" ] && LINUX_HOSTCFLAGS="-Wall -Wstrict-prototypes -Os -fomit-frame-pointer -I${S}/include"
71 71
324 324
325 echo 325 echo
326 fi 326 fi
327 327
328 # Show policy version, if this kernel has SELinux... 328 # Show policy version, if this kernel has SELinux...
329 local secfile
329 local secfile="${ROOT}usr/src/linux-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}/security/selinux/include/security.h" 330 secfile="${ROOT}usr/src/linux-${KV}/security/selinux/include/security.h"
330 if use selinux && [ -f "$secfile" ] 331 if use selinux && [ -f "$secfile" ]
331 then 332 then
332 local polver=$(awk '/POLICYDB_VERSION /{print $3}' $secfile) 333 local polver=$(awk '/POLICYDB_VERSION /{print $3}' $secfile)
333 einfo "The SELinux policy version of this kernel is $polver." 334 einfo "The SELinux policy version of this kernel is $polver."
334 echo 335 echo
352 einfo "Kernel headers are usually only used when recompiling glibc." 353 einfo "Kernel headers are usually only used when recompiling glibc."
353 einfo "Following the installation of newer headers it is advised that" 354 einfo "Following the installation of newer headers it is advised that"
354 einfo "you re-merge glibc as follows:" 355 einfo "you re-merge glibc as follows:"
355 einfo "# emerge glibc" 356 einfo "# emerge glibc"
356 einfo "Failure to do so will cause glibc to not make use of newer" 357 einfo "Failure to do so will cause glibc to not make use of newer"
357 einfo "features present in the updated kernelheaders." 358 einfo "features present in the updated kernel headers."
358 echo 359 echo
359} 360}
360 361
361# pkg_setup functions 362# pkg_setup functions
362#============================================================== 363#==============================================================
572 # this function will detect and set 573 # this function will detect and set
573 # OKV: Original Kernel Version (2.6.0/2.6.0-test11) 574 # OKV: Original Kernel Version (2.6.0/2.6.0-test11)
574 # KV: Kernel Version (2.6.0-gentoo/2.6.0-test11-gentoo-r1) 575 # KV: Kernel Version (2.6.0-gentoo/2.6.0-test11-gentoo-r1)
575 # EXTRAVERSION: The additional version appended to OKV (-gentoo/-gentoo-r1) 576 # EXTRAVERSION: The additional version appended to OKV (-gentoo/-gentoo-r1)
576 577
578 [ -n "${DETECTED}" ] && return
579
577 if [ -z "${OKV}" ] 580 if [ -z "${OKV}" ];
578 then 581 then
579 OKV=${PV/_beta/-test} 582 OKV=${PV/_beta/-test}
580 OKV=${OKV/_rc/-rc} 583 OKV=${OKV/_rc/-rc}
581 OKV=${OKV/_pre*/} 584 OKV=${OKV/_pre*/}
582 OKV=${OKV/-r*/} 585 OKV=${OKV/-r*/}
583 fi 586 fi
584 587
585 KV_MAJOR=$(echo ${OKV} | cut -d. -f1) 588 KV_MAJOR=$(echo ${OKV} | cut -d. -f1)
586 KV_MINOR=$(echo ${OKV} | cut -d. -f2) 589 KV_MINOR=$(echo ${OKV} | cut -d. -f2)
587 KV_PATCH=$(echo ${OKV} | cut -d. -f3) 590 KV_PATCH=$(echo ${OKV} | cut -d. -f3-)
588 KV_PATCH=${KV_PATCH/[-_]*/} 591 KV_PATCH=${KV_PATCH/[-_]*/}
589 592
590 KERNEL_URI="mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/linux-${OKV}.tar.bz2" 593 KERNEL_URI="mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/linux-${OKV}.tar.bz2"
591 594
592 RELEASE=${PV/${OKV}/} 595 RELEASE=${PV/${OKV}/}
597 RELEASE=${RELEASE/_pre/-pre} 600 RELEASE=${RELEASE/_pre/-pre}
598 else 601 else
599 RELEASE=${RELEASE/_pre/-bk} 602 RELEASE=${RELEASE/_pre/-bk}
600 fi 603 fi
601 RELEASETYPE=${RELEASE//[0-9]/} 604 RELEASETYPE=${RELEASE//[0-9]/}
602
603 EXTRAVERSION="${RELEASE}" 605 EXTRAVERSION="${RELEASE}"
604 606
605 if [ -n "${K_PREPATCHED}" ] 607 if [ -n "${K_PREPATCHED}" ]
606 then 608 then
607 EXTRAVERSION="${EXTRAVERSION}-${PN/-*/}${PR/r/}" 609 EXTRAVERSION="${EXTRAVERSION}-${PN/-*/}${PR/r/}"
608 else 610 else
609 [ -z "${K_NOUSENAME}" ] && EXTRAVERSION="${EXTRAVERSION}-${PN/-*/}" 611 [ -z "${K_NOUSENAME}" ] && EXTRAVERSION="${EXTRAVERSION}-${PN/-*/}"
610 [ "${PN/-*/}" == "wolk" ] && EXTRAVERSION="-${PN/-*/}-${PV}" 612 [ "${PN/-*/}" == "wolk" ] && EXTRAVERSION="-${PN/-*/}-${PV}"
611 [ "${PR}" != "r0" ] && EXTRAVERSION="${EXTRAVERSION}-${PR}" 613 [ "${PR}" != "r0" ] && EXTRAVERSION="${EXTRAVERSION}-${PR}"
612 fi 614 fi
613
614 KV=${OKV}${EXTRAVERSION}
615 615
616 # -rcXX-bkXX pulls are *IMPOSSIBLE* to support within the 616 # -rcXX-bkXX pulls are *IMPOSSIBLE* to support within the
617 # portage naming convention these cannot be supported, but the code here can 617 # portage naming convention these cannot be supported, but the code here can
618 # handle it up until this point and theoretically thereafter. 618 # handle it up until this point and theoretically thereafter.
619 619
646 UNIPATCH_LIST_DEFAULT="${DISTDIR}/patch-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${RELEASE}.bz2" 646 UNIPATCH_LIST_DEFAULT="${DISTDIR}/patch-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${RELEASE}.bz2"
647 KV=${PV/[-_]*/}${EXTRAVERSION} 647 KV=${PV/[-_]*/}${EXTRAVERSION}
648 fi 648 fi
649 649
650 S=${WORKDIR}/linux-${KV} 650 S=${WORKDIR}/linux-${KV}
651 DETECTED="yes"
651} 652}
652 653
653detect_arch() { 654detect_arch() {
654 # This function sets ARCH_URI and ARCH_PATCH 655 # This function sets ARCH_URI and ARCH_PATCH
655 # with the neccessary info for the arch sepecific compatibility 656 # with the neccessary info for the arch sepecific compatibility

Legend:
Removed from v.1.50  
changed lines
  Added in v.1.51

  ViewVC Help
Powered by ViewVC 1.1.20