Commit bbec77dc authored by José Mª. Fernández's avatar José Mª. Fernández
Browse files

Added patched version of virtualbox-modules which works with kernel 4.14.x

parent d3dabe1f
AUX create_vbox_modules_tarball.sh 896 SHA256 4309bbf762e05ae09a2b92a737abddb89807b5a36f587178d7ac7f6ad4d91316 SHA512 c3154a13550817c581fa142e24081edfbdbc145315d34cc4569d12ad87a518fa0bf1443c053b50fdfdea6915bda1325ad973455ee85079294b83a49fd53f4771 WHIRLPOOL 761079d4ba0124488be9cc78305eef6c6df18d232c539ff4479caf3f04ea307e043c92a5f4099c7745a4e23741ce28259e87dd79bce8cee6862ef5e0661b2497
AUX virtualbox-modules-4.1.4-pax-const.patch 2335 SHA256 d23da93fa1a3b7833766caa8329745ed7de7a5ed6ce1fecb090325fdc83e42f3 SHA512 8f5ffcd53f34e616b895013660e269e6031837411471abf69711df4fd5d745299dcb08d361eda0979dcfde7d9aafa0d24c99fcc9f3875fbf35771945f6b224a1 WHIRLPOOL b875d0747bdf3c2970d9dc84c7e4f6fac1bd37b85ba6086a981397c8b506a7af2709fa94317896650fd9ae98921d40f399e589b851eb2da2f9854eb1f443930c
AUX virtualbox-modules-5.1.28-udp.patch 1238 SHA256 69a5be1e6bf6b27d33af8dba2ef017a9da738b3e3e656577e5d39b324915c40e SHA512 79e6444b64db1da2aea727233de91ce6ff6075eb8bea1098ca8430445a50b50c036aa9e27317c568bdb6b7f22bb8fa177e97caaea1701c06a9709ee8a3133a51 WHIRLPOOL c1f143cc0beff05b3b5e6427503077203b0bd4a87eb8b0dc3369a6ee57a29d1d7ca208e7f40911332fabd4c67be2b0fa63bf74569dc9e38beff9919bc877e170
AUX virtualbox-modules-5.1.30-timer-setup.patch 1686 SHA256 9fddfaf9aa9a684332b1ab9cb05ab0d69a384300c8f8d7644510698058ed96bd SHA512 6f827fe6be4be6a5d1b96b0d745f78381b0dbbcbf6d448372a50103d1d3dc83e891af5d3996a89095b834cf86be659a6f3e863bbb12211774245a7905f6a56b7 WHIRLPOOL dcb3caab91c29646dc0a44604e2d29ff3505bc8ba888bbb403fdd66c65edcab897c6989521da4d45ab515ae0c52cd7b746061dd3b891a348ec8d7047e94a7984
AUX virtualbox.conf 38 SHA256 eb1ba5b5f8a2b795e3b050105a2f24cb5df9d392c6c4a3a9756e17f74ffeb146 SHA512 b61936fff57426d31efa6928eadb572cafe40a65d3e31a0eecb53dc784ba9d0a9e0ad5e419df74418b977f89c17873240c38e2ada95949e5252d879110d6094a WHIRLPOOL cadd73f81d8ddb545fb31ec2328103f998e5754d6f7fe63de7e72987992d49cb84c309b52e852cc221c078a39f1ec542662fc68b200478a6cec8e12881aee8bb
DIST vbox-kernel-module-src-5.1.30.tar.xz 625424 SHA256 879b1bc45b9f1a3fd929d2fd2e67dcaffe4074839f6364bf0e64618bfe2b3b2e SHA512 8e2113584e63e2ace71b708dc77428fd09167a1bded12b47312a5a8f85ef448e17f76b4300dba4c8ec99d7f8cb278cef039c6282c676e35b8f200bafb5c4770a WHIRLPOOL aa6fc3a0516514c2ca0c39ea28200559582fdd648e96084a5ca1daabfd1f478312199576ad27336eba124b443fbe122364efde2c60ca3386872cd1274333f4df
EBUILD virtualbox-modules-5.1.30-r1.ebuild 1761 SHA256 2308452bf7b274fdf4635c4733ad266516188b319a7f0ccb9c60f67ffb0c3564 SHA512 b9abb4013be1d3fa00dc6dcecef18c2f52656f0a6709c46ead1b6c1f6b6c20b273a903e114c0b22e6309b21a7f3eb787bdb770f312578182a65cf8840d7a3813 WHIRLPOOL ae21c13c94e9264fe3bee3ebc9546eff4ff65cb9eb8fe027f12fb2e085afafc067653bd253bc1196698add304c5ae675ceb06ffafd9491eeeac052fef67f09f0
#!/bin/bash
# Create a virtualbox modules tarball from a VirtualBox binary package.
# We cannot download the package by this script because of the unpredictable
# build number being in the filename.
#
# usage: create_vbox_modules_tarball.sh VirtualBox-4.1.18-78361-Linux_amd64.run
[ -f "$1" ] || exit 1
VBOX_PACKAGE="$1"
VERSION_SUFFIX=""
if [[ ${VBOX_PACKAGE} = *_BETA* ]] || [[ ${VBOX_PACKAGE} = *_RC* ]] ; then
VERSION_SUFFIX="$(echo ${VBOX_PACKAGE} | sed 's@.*VirtualBox-[[:digit:]\.]\+\(_[[:alpha:]]\+[[:digit:]]\).*@\L\1@')"
fi
VBOX_VER="$(echo ${VBOX_PACKAGE} | sed 's@.*VirtualBox-\([[:digit:]\.]\+\).*@\1@')${VERSION_SUFFIX}"
sh ${VBOX_PACKAGE} --noexec --keep --nox11 || exit 2
cd install || exit 3
tar -xaf VirtualBox.tar.bz2 || exit 4
cd src/vboxhost || exit 5
tar -cvJf ../../../vbox-kernel-module-src-${VBOX_VER}.tar.xz . || exit 6
cd ../../.. && rm install -rf
exit 0
diff -urp vboxdrv.orig/SUPDrvIDC.h vboxdrv/SUPDrvIDC.h
--- vboxdrv.orig/SUPDrvIDC.h 2011-09-06 15:53:27.852567531 +0200
+++ vboxdrv/SUPDrvIDC.h 2011-09-06 15:54:05.420565524 +0200
@@ -160,7 +160,7 @@ typedef struct SUPDRVIDCREQGETSYM
{
/** The symbol address. */
PFNRT pfnSymbol;
- } Out;
+ } __no_const Out;
} u;
} SUPDRVIDCREQGETSYM;
/** Pointer to a SUPDRV IDC get symbol request. */
diff -urp vboxnetflt.orig/include/VBox/intnet.h vboxnetflt/include/VBox/intnet.h
--- vboxnetflt.orig/include/VBox/intnet.h 2011-09-06 15:53:27.852567531 +0200
+++ vboxnetflt/include/VBox/intnet.h 2011-09-06 15:54:05.424565524 +0200
@@ -783,7 +783,7 @@ typedef struct INTNETTRUNKFACTORY
DECLR0CALLBACKMEMBER(int, pfnCreateAndConnect,(struct INTNETTRUNKFACTORY *pIfFactory, const char *pszName,
PINTNETTRUNKSWPORT pSwitchPort, uint32_t fFlags,
PINTNETTRUNKIFPORT *ppIfPort));
-} INTNETTRUNKFACTORY;
+} __no_const INTNETTRUNKFACTORY;
/** Pointer to the trunk factory. */
typedef INTNETTRUNKFACTORY *PINTNETTRUNKFACTORY;
diff -urp vboxnetflt.orig/linux/VBoxNetFlt-linux.c vboxnetflt/linux/VBoxNetFlt-linux.c
--- vboxnetflt.orig/linux/VBoxNetFlt-linux.c 2011-07-19 12:15:22.000000000 +0200
+++ vboxnetflt/linux/VBoxNetFlt-linux.c 2011-09-06 15:56:00.516559379 +0200
@@ -840,7 +840,7 @@ typedef struct ethtool_ops OVR_OPSTYPE;
# else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29) */
-typedef struct net_device_ops OVR_OPSTYPE;
+typedef net_device_ops_no_const OVR_OPSTYPE;
# define OVR_OPS netdev_ops
# define OVR_XMIT pOrgOps->ndo_start_xmit
diff -urp vboxpci.orig/include/VBox/rawpci.h vboxpci/include/VBox/rawpci.h
--- vboxpci.orig/include/VBox/rawpci.h 2011-04-18 17:01:12.000000000 +0200
+++ vboxpci/include/VBox/rawpci.h 2011-09-06 15:57:17.340555277 +0200
@@ -545,7 +545,7 @@ typedef struct RAWPCIFACTORY
DECLR0CALLBACKMEMBER(void, pfnDeinitVm,(PRAWPCIFACTORY pFactory,
PVM pVM,
PRAWPCIPERVM pPciData));
-} RAWPCIFACTORY;
+} __no_const RAWPCIFACTORY;
#define RAWPCIFACTORY_UUID_STR "ea089839-4171-476f-adfb-9e7ab1cbd0fb"
diff --git a/work/vboxnetflt/linux/VBoxNetFlt-linux.c b/work/vboxnetflt/linux/VBoxNetFlt-linux.c
index f824654..b61d82c 100644
--- work/vboxnetflt/linux/VBoxNetFlt-linux.c
+++ work/vboxnetflt/linux/VBoxNetFlt-linux.c
@@ -126,6 +126,10 @@ typedef struct VBOXNETFLTNOTIFIER *PVBOXNETFLTNOTIFIER;
# endif
#endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0)
+#define SKB_GSO_UDP 0
+#endif
+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 20, 0)
# define VBOX_HAVE_SKB_VLAN
#else
diff --git a/work/vboxpci/linux/VBoxPci-linux.c b/work/vboxpci/linux/VBoxPci-linux.c
index 2dbf47f..e361ef3 100644
--- work/vboxpci/linux/VBoxPci-linux.c
+++ work/vboxpci/linux/VBoxPci-linux.c
@@ -353,12 +353,16 @@ static void vboxPciFileClose(struct file* file)
static int vboxPciFileWrite(struct file* file, unsigned long long offset, unsigned char* data, unsigned int size)
{
int ret;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0)
+ ret = kernel_write(file, data, size, &offset);
+#else
mm_segment_t fs_save;
fs_save = get_fs();
set_fs(get_ds());
ret = vfs_write(file, data, size, &offset);
set_fs(fs_save);
+#endif
if (ret < 0)
printk(KERN_DEBUG "vboxPciFileWrite: error %d\n", ret);
\ No newline at end of file
diff --git a/work/vboxdrv/r0drv/linux/timer-r0drv-linux.c b/work/vboxdrv/r0drv/linux/timer-r0drv-linux.c
index 2bb2bfb..3b4a508 100644
--- work/vboxdrv/r0drv/linux/timer-r0drv-linux.c
+++ work/vboxdrv/r0drv/linux/timer-r0drv-linux.c
@@ -720,9 +720,9 @@ static enum hrtimer_restart rtTimerLinuxHrCallback(struct hrtimer *pHrTimer)
*
* @param ulUser Address of the sub-timer structure.
*/
-static void rtTimerLinuxStdCallback(unsigned long ulUser)
+static void rtTimerLinuxStdCallback(struct timer_list *t)
{
- PRTTIMERLNXSUBTIMER pSubTimer = (PRTTIMERLNXSUBTIMER)ulUser;
+ PRTTIMERLNXSUBTIMER pSubTimer = from_timer(pSubTimer,t,u.Std.LnxTimer);
PRTTIMER pTimer = pSubTimer->pParent;
RTTIMERLNX_LOG(("stdcallback %p\n", pTimer));
@@ -1584,6 +1584,10 @@ RTDECL(int) RTTimerCreateEx(PRTTIMER *ppTimer, uint64_t u64NanoInterval, uint32_
else
#endif
{
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0)
+ timer_setup(&pTimer->aSubTimers[iCpu].u.Std.LnxTimer,rtTimerLinuxStdCallback,TIMER_PINNED);
+#else
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
init_timer_pinned(&pTimer->aSubTimers[iCpu].u.Std.LnxTimer);
#else
@@ -1591,6 +1595,7 @@ RTDECL(int) RTTimerCreateEx(PRTTIMER *ppTimer, uint64_t u64NanoInterval, uint32_
#endif
pTimer->aSubTimers[iCpu].u.Std.LnxTimer.data = (unsigned long)&pTimer->aSubTimers[iCpu];
pTimer->aSubTimers[iCpu].u.Std.LnxTimer.function = rtTimerLinuxStdCallback;
+#endif
pTimer->aSubTimers[iCpu].u.Std.LnxTimer.expires = jiffies;
pTimer->aSubTimers[iCpu].u.Std.u64NextTS = 0;
}
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# XXX: the tarball here is just the kernel modules split out of the binary
# package that comes from virtualbox-bin
EAPI=6
inherit eutils linux-mod user
MY_P=vbox-kernel-module-src-${PV}
DESCRIPTION="Kernel Modules for Virtualbox"
HOMEPAGE="http://www.virtualbox.org/"
SRC_URI="https://dev.gentoo.org/~polynomial-c/virtualbox/${MY_P}.tar.xz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="pax_kernel"
RDEPEND="!=app-emulation/virtualbox-9999"
S=${WORKDIR}
BUILD_TARGETS="all"
BUILD_TARGET_ARCH="${ARCH}"
MODULE_NAMES="vboxdrv(misc:${S}) vboxnetflt(misc:${S}) vboxnetadp(misc:${S}) vboxpci(misc:${S})"
pkg_setup() {
enewgroup vboxusers
CONFIG_CHECK="!TRIM_UNUSED_KSYMS"
ERROR_TRIM_UNUSED_KSYMS="The kernel option CONFIG_TRIM_UNUSED_KSYMS removed kernel symbols that are needed by ${PN} to load correctly."
linux-mod_pkg_setup
BUILD_PARAMS="KERN_DIR=${KV_DIR} O=${KV_OUT_DIR} V=1 KBUILD_VERBOSE=1"
}
src_prepare() {
if kernel_is -ge 2 6 33 ; then
# evil patch for new kernels - header moved
grep -lR linux/autoconf.h * | xargs sed -i -e 's:<linux/autoconf.h>:<generated/autoconf.h>:'
fi
if use pax_kernel && kernel_is -ge 3 0 0 ; then
epatch "${FILESDIR}"/${PN}-4.1.4-pax-const.patch
fi
epatch "${FILESDIR}"/"${PN}"-5.1.28-udp.patch
epatch "${FILESDIR}"/"${PN}"-5.1.30-timer-setup.patch
default
}
src_install() {
linux-mod_src_install
insinto /usr/lib/modules-load.d/
doins "${FILESDIR}"/virtualbox.conf
}
pkg_postinst() {
linux-mod_pkg_postinst
elog "If you are using sys-apps/openrc, please add \"vboxdrv\", \"vboxnetflt\","
elog "\"vboxnetadp\" and \"vboxpci\" to:"
elog " /etc/conf.d/modules"
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment