1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
4 # XXX: the tarball here is just the kernel modules split out of the binary
5 # package that comes from virtualbox-bin
9 inherit eutils linux-mod user
11 MY_P=vbox-kernel-module-src-${PV}
12 DESCRIPTION="Kernel Modules for Virtualbox"
13 HOMEPAGE="http://www.virtualbox.org/"
14 SRC_URI="https://dev.gentoo.org/~polynomial-c/virtualbox/${MY_P}.tar.xz"
21 RDEPEND="!=app-emulation/virtualbox-9999"
26 BUILD_TARGET_ARCH="${ARCH}"
27 MODULE_NAMES="vboxdrv(misc:${S}) vboxnetflt(misc:${S}) vboxnetadp(misc:${S}) vboxpci(misc:${S})"
32 CONFIG_CHECK="!TRIM_UNUSED_KSYMS"
33 ERROR_TRIM_UNUSED_KSYMS="The kernel option CONFIG_TRIM_UNUSED_KSYMS removed kernel symbols that are needed by ${PN} to load correctly."
37 BUILD_PARAMS="KERN_DIR=${KV_DIR} O=${KV_OUT_DIR} V=1 KBUILD_VERBOSE=1"
41 if kernel_is -ge 2 6 33 ; then
42 # evil patch for new kernels - header moved
43 grep -lR linux/autoconf.h * | xargs sed -i -e 's:<linux/autoconf.h>:<generated/autoconf.h>:'
46 if use pax_kernel && kernel_is -ge 3 0 0 ; then
47 epatch "${FILESDIR}"/${PN}-4.1.4-pax-const.patch
50 if kernel_is -ge 4 14 0 ; then
51 epatch "${FILESDIR}"/${PN}-5.1.30-udp.patch
59 insinto /usr/lib/modules-load.d/
60 doins "${FILESDIR}"/virtualbox.conf
64 linux-mod_pkg_postinst
65 elog "If you are using sys-apps/openrc, please add \"vboxdrv\", \"vboxnetflt\","
66 elog "\"vboxnetadp\" and \"vboxpci\" to:"
67 elog " /etc/conf.d/modules"