# 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" 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: ## Main CK performance patch (O(1)B,PE,LL,CKVM,RL2,VH,ST,DT123) MAIN_PATCH="linux-${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 (global) XFS_PATCH="1060_XFS_0305311351_${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) SP_PATCH="1011_SP_0306102217_${KV}.diff.bz2" # CPU Frequency scaling for supported laptops: # USE=freqscal (local) CFS_PATCH="1100_CFS_0305311539_${KV}.patch.bz2" # Grsec 1.9.9h (depends on 1010 and 1060): # USE=grsec (local) GRS_PATCH="1161_GRS1.9.9h_0306081216_${KV}.patch.bz2" ### Create the SRC_URI from USE flags. CK_URL="http://members.optusnet.com.au/ckolivas/kernel" SRC_URI="http://www.kernel.org/pub/linux/kernel/v2.4/linux-${OKV}.tar.bz2 \ ${CK_URL}/${MAIN_PATCH} \ supermount? ( ${CK_URL}/${SM_PATCH} ) \ xfs? ( ${CK_URL}/${XFS_PATCH} ) \ grsec? ( ${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} ) \ grsec? ( ${CK_URL}/${GRS_PATCH} ) " KEYWORDS="~x86 -ppc" SLOT="${KV}" src_unpack() { # Symlink optional patches, taking the dependencies into account. [ -n "`use supermount`" ] && ( ln -s ${DISTDIR}/${SM_PATCH} || die ) [ -n "`use xfs`" -o -n "`use grsec`" ] && ( 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 bootsplah`" ] && ( ln -s ${DISTDIR}/${BS_PATCH} || die ) [ -n "`use swapprefetch`" ] && ( ln -s ${DISTDIR}/${SP_PATCH} || die ) [ -n "`use freqscal`" ] && ( ln -s ${DISTDIR}/${CFS_PATCH} || die ) [ -n "`use grsec`" ] && ( ln -s ${DISTDIR}/${GRS_PATCH} || die ) # Unpack the vanilla sources unpack linux-${OKV}.tar.bz2 # Apply the main patch einfo "Apply patch ${MAIN_PATCH}" bzcat ${DISTDIR}/${MAIN_PATCH} | patch -p0 || die "Patching with ${MAIN_PATCH} failed." # 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 }