# Copyright 1999-2003 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # $Header: #IUSE="build supermount xfs acpi nforce2 bootsplash swapprefetch freqscal grsec aavm rmap pcmcia" IUSE="build supermount xfs acpi nforce2 bootsplash swapprefetch freqscal rmap aavm pcmcia" ETYPE="sources" inherit kernel || die # OKV=original kernel version, KV=patched kernel version. OKV="2.4.21" KV="2.4.21-ck${PR/r/}" S=${WORKDIR}/linux-${KV} EXTRAVERSION="-ck${PR/r/}" DESCRIPTION="Full sources for the Con Kolivas's high performance kernel and its optional features" HOMEPAGE="http://members.optusnet.com.au/ckolivas/kernel" ### Below is a list of all the available patches: ## Performance enhancements (installed by default): # Base ck contains the batch O(1) scheduler, preemptible, low latency: # (this version is BASE_PATCH="1000_O1_PE_LL_0306190109_${OKV}.patch.bz2" # Con Colivas autoregulation vm hacks: # (will be dropped if "aavm" or "rmap" is in USE) CKVM_PATCH="1010_CKVM_0306130018_${KV}.patch.bz2" # Read Latency2: RL2="1020_RL2_0305310042_${KV}.patch.bz2" # Desktop Tuning 1: DT1_PATCH="1021_DT1_030531616_${KV}.patch.bz2" # Variable HZ setting: # USE!=pcmcia (global) VH_PATCH="1030_VH_0305310045_${KV}.patch.bz2" # Desktop Tuning 2: # USE!=pcmcia (global) DT2_PATCH="1031_DT2_0305310048_${KV}.patch.bz2" # Scheduler Tunables: ST_PATCH="1040_ST_030619_${KV}.patch.bz2" ## Extra features: # Supermount-NG v1.2.7: # USE=supermount (local) SM_PATCH="1050_SM1.2.7_0305310109_${KV}.patch.bz2" # XFS file system: # USE=xfs (local, but already used in gentoo-sources) XFS_PATCH="1060_XFS1.3.0pre2_0306172109_${KV}.patch.bz2" # ACPI 20030522: # USE=acpi (global - should use "acpi4linux"?) ACPI_PATCH="1070_ACPI_0305311044_${KV}.patch.bz2" # Nvidia Nforce2 update: # USE=nforce2 (local) NF2_PATCH="1080_NF2_0305311048_${KV}.patch.bz2" # Bootsplash: # USE=bootsplash (local) BS_PATCH="1090_BS_0306020027_${KV}.patch.bz2" ## Misc other patches: # Swap prefetching: # USE=swapprefetch (local) and USE!=rmap (local) SP_PATCH="1011_SP_0306102217_${KV}.diff.bz2" # CPU Frequency scaling for supported laptops: # USE=freqscal (local) CFS_PATCH="1100_CFS_0306161356_${KV}.patch.bz2" # Grsec 1.9.9h (depends on 1010 and 1060): # USE=grsec (local) -- not available yet -- #GRS_PATCH="1161_GRS1.9.9h_0306081216_${KV}.patch.bz2" ## Alternative VMs: # AAVM: # USE=aavm (local) AAVM_PATCH="1010_AAVM_030619_${KV}.patch.bz2" # Rmap: # USE=rmap (local) RMAP_PATCH="1010_rmap15j_0306172008_${KV}.patch.bz2" ### Create the SRC_URI from USE flags. CK_URL="http://members.optusnet.com.au/ckolivas/kernel" TGL_URL="http://tdegreni.free.fr/gentoo" SRC_URI="http://www.kernel.org/pub/linux/kernel/v2.4/linux-${OKV}.tar.bz2 \ ${CK_URL}/${BASE_PATCH} \ ${CK_URL}/${CKVM_PATCH} \ ${CK_URL}/${RL2} \ ${CK_URL}/${DT1_PATCH} \ ${CK_URL}/${VH_PATCH} \ ${CK_URL}/${DT2_PATCH} \ ${TGL_URL}/${ST_PATCH} \ supermount? ( ${CK_URL}/${SM_PATCH} ) \ xfs? ( ${CK_URL}/${XFS_PATCH} ) \ acpi? ( ${CK_URL}/${ACPI_PATCH} ) \ nforce2? ( ${CK_URL}/${NF2_PATCH} ) \ bootsplash? ( ${CK_URL}/${BS_PATCH} ) \ swapprefetch? ( ${CK_URL}/${SP_PATCH} ) \ freqscal? ( ${CK_URL}/${CFS_PATCH} ) \ rmap? ( ${CK_URL}/${RMAP_PATCH} ) \ aavm? ( ${TGL_URL}/${AAVM_PATCH} )" #GRSEC grsec? ( ${CK_URL}/${XFS_PATCH} ) #GRSEC grsec? ( ${CK_URL}/${GRS_PATCH} ) KEYWORDS="~x86 -ppc" SLOT="${KV}" src_unpack() { # Check for conflicts without obvious default choice: [ -n "`use rmap`" -a -n "`use xfs`" ] && \ die "Sorry, XFS and Rmap patches currently conflict." #GRSEC [ -n "`use rmap`" -a -n "`use grsec`" ] && \ #GRSEC die "Sorry, Grsecurity needs XFS, which currently conflict with Rmap patch." [ -n "`use rmap`" -a -n "`use aavm`" ] && \ die "You'll have to choose between AAVM and Rmap." # Warnings about missing patches: [ -n "`use grsec`" ] && ewarn "Sorry, Grsecurity patch is not available yet." # Symlink the main separate patches: for PATCH in ${BASE_PATCH} ${CKVM_PATCH} ${RL2} ${DT1_PATCH} ${ST_PATCH} do ln -s ${DISTDIR}/${PATCH} || die done if [ -n "`use pcmcia`" ]; then ewarn "PCMCIA is in use: \"Variable HZ setting\" and \"Desktop Tuning 2\" disabled." else ( ln -s ${DISTDIR}/${VH_PATCH} || die ) ( ln -s ${DISTDIR}/${DT2_PATCH} || die ) fi # Symlink optional patches: [ -n "`use supermount`" ] && ( ln -s ${DISTDIR}/${SM_PATCH} || die ) #GRSEC [ -n "`use xfs`" -o -n "`use grsec`" ] && ( ln -s ${DISTDIR}/${XFS_PATCH} || die ) [ -n "`use xfs`" ] && ( ln -s ${DISTDIR}/${XFS_PATCH} || die ) [ -n "`use acpi`" ] && ( ln -s ${DISTDIR}/${ACPI_PATCH} || die ) [ -n "`use nforce2`" ] && ( ln -s ${DISTDIR}/${NF2_PATCH} || die ) [ -n "`use bootsplash`" ] && ( ln -s ${DISTDIR}/${BS_PATCH} || die ) [ -n "`use swapprefetch`" ] && \ if [ -n "`use rmap`" -o -n "`use aavm`" ]; then ewarn "A non-CKVM is in use: \"Swap prefetching\" disabled." else ( ln -s ${DISTDIR}/${SP_PATCH} || die ) fi [ -n "`use freqscal`" ] && ( ln -s ${DISTDIR}/${CFS_PATCH} || die ) #GRSEC [ -n "`use grsec`" ] && ( ln -s ${DISTDIR}/${GRS_PATCH} || die ) [ -n "`use rmap`" ] && ( ln -s ${DISTDIR}/${RMAP_PATCH} && rm -f ${CKVM_PATCH} || die ) [ -n "`use aavm`" ] && ( ln -s ${DISTDIR}/${AAVM_PATCH} && rm -f ${CKVM_PATCH} || die ) # Unpack the vanilla sources unpack linux-${OKV}.tar.bz2 # Apply the extra symlinked patches. (-p1) cd linux-${OKV} for PATCH in ../1* do einfo "Apply patch ${PATCH/\.\.\//}" bzcat ${PATCH} | patch -p1 || die "Patching with ${PATCH/\.\.\//} failed." done cd .. # Rename the kernel mv linux-${OKV} linux-${KV} || die # Do the usual cleanups cd linux-${KV} kernel_universal_unpack }