| # |
| # Copyright 2022 Google LLC |
| # |
| # This program is free software; you can redistribute it and/or |
| # modify it under the terms of the GNU General Public License |
| # version 2 as published by the Free Software Foundation. |
| # |
| # This program is distributed in the hope that it will be useful, |
| # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| # GNU General Public License for more details. |
| # |
| EAPI="7" |
| |
| inherit cos-linux-mod |
| |
| DESCRIPTION="XEMU is a fast emulation device for Linux. It provides the ability to create and manipulate address spaces, and switch execution into those address spaces." |
| HOMEPAGE="https://github.com/google/gvisor" |
| XEMU_TAR_FILE=xemu-${PV}.tar.gz |
| SRC_URI="gs://chromeos-localmirror/distfiles/${XEMU_TAR_FILE} -> ${P}.tar.gz" |
| |
| LICENSE="GPL-2" |
| SLOT="0" |
| KEYWORDS="*" |
| IUSE="" |
| |
| S="${WORKDIR}" |
| |
| # modulename(libdir:srcdir:objdir) |
| MODULE_NAMES="xemu(kernel/drivers/xemu:${S}:${S})" |
| |
| src_compile() { |
| cros_allow_gnu_build_tools |
| LIBELF="$("${CBUILD}-pkg-config" libelf --libs 2> /dev/null || echo -lelf)" |
| BUILD_PARAMS="HOST_LIBELF_LIBS=${LIBELF} CONFIG_XEMU=m KDIR=${KBUILD_OUTPUT}" |
| BUILD_TARGETS="default" |
| cos-linux-mod_src_compile |
| } |
| |
| src_install() { |
| cos-linux-mod_src_install |
| insinto /etc/modules-load.d |
| #doins "${FILESDIR}"/xemu.conf |
| } |