# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ ETYPE="sources" inherit kernel-2 eutils detect_arch detect_version [ "${PR}" == "r0" ] && KV=${PV/_/-}-xen || KV=${PV/_/-}-xen-${PR} DESCRIPTION="Full sources for a dom0/domU Linux kernel to run under Xen" HOMEPAGE="http://www.cl.cam.ac.uk/Research/SRG/netos/xen/index.html" XEN_VERSION="3.0.4_1" MY_P="xen-${XEN_VERSION}-src" SRC_URI="${KERNEL_URI} mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/patch-${PV}.bz2 http://bits.xensource.com/oss-xen/release/${XEN_VERSION/_/-}/src.tgz/xen-${XEN_VERSION}-src.tgz" KEYWORDS="~x86 ~amd64" #RDEPEND="~app-emulation/xen-${XEN_VERSION}" S="${WORKDIR}" RESTRICT="nostrip" XEN_KV=${KV_MAJOR}.${KV_MINOR}.${KV_PATCH} src_unpack() { unpack ${A} # patch to the latest kernel first cd "${WORKDIR}"/linux-${XEN_KV} epatch "${WORKDIR}"/patch-${PV} cd "${WORKDIR}"/${MY_P} sed -e 's:relative_lndir \([^(].*\):cp -dpPR \1/* .:' \ -i linux-2.6-xen-sparse/mkbuildtree || die # No need to run oldconfig sed -e 's:$(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) oldconfig::' \ -i buildconfigs/mk.linux-2.6-xen # Move the kernel sources to pristine-linux-${PV} mv "${WORKDIR}"/linux-${XEN_KV} pristine-linux-${PV} || die touch pristine-linux-${PV}/.valid-pristine || die # debugging #echo "make LINUX_SRC_PATH=${DISTDIR} XEN_ROOT=${WORKDIR}/${MY_P} # -f buildconfigs/mk.linux-2.6-xen # linux-${PV}-xen/include/linux/autoconf.h || die" sed -e "s/2.6.16.33/2.6.16.38/" -i buildconfigs/mk.linux-2.6-xen mv patches/linux-2.6.16.33 patches/linux-2.6.16.38 || die make LINUX_SRC_PATH=${DISTDIR} XEN_ROOT=${WORKDIR}/${MY_P} \ -f buildconfigs/mk.linux-2.6-xen \ linux-${PV}-xen/include/linux/autoconf.h || die mv linux-${KV} "${WORKDIR}"/linux-${KV} || die rm -rf "${WORKDIR}/${MY_P}" || die }