Fixes for Kernel >= 4.14 | libcdio-1.0.0
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
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.10-ALIGN-backport.patch 384 SHA256 f5116b4974777336a723fce3c0614381d87ccfadb172b0ea606a87a0bad3310e SHA512 2557f8dbec2771ee1c9dd6d8c2e3d96b514da19e23d2d8e8b485191dbd5b5faa77fd28ab2d6d17b8da39017f19ca139eada2120d1da12c0b28f44f92812132b6 WHIRLPOOL 94ca5abe44d3130f367077c23d55b114b9b77d41d56db12c846cd97e5e426733310a2b96acd2a1d712c3b0fa73215e1f0133ad58b4de5297055698bc9f507661
|
||||
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-modules-linux-4.12_1_of_2.patch 2748 SHA256 5d8559d3ed17e5280affb69720af328045d8858e4f513da7c92f23f206ac349b SHA512 21a3a287dddc76219e8786b4951dfe810d515b9df5b75537ad0bf97f1899250124892d6a9ed167065af68af3f0df29f81e5000a73ccd2f7e3baebb375b100b76 WHIRLPOOL 5047474bb56c80a3d35e3323b3ca89886d6427403028e163595fcc1624f5d2fea4f3e8fdfc7ae5fc51ed2f82093e648e4fdb0952f0331aa6d55f62def970b3fc
|
||||
AUX virtualbox-modules-linux-4.12_2_of_2.patch 3254 SHA256 9396f821927924c859d85b6ea0a7a69dd4abc51d101cb3df6abca34cfd7007c9 SHA512 ff31c0d7075f680838202d133604b9ddd8ae36bee3c0ac2c2580e5839ebd427eea6184ed260492fe6d32791e659938d57d44fdb7b8f211ce91a9472d15d35449 WHIRLPOOL ef5b71d84249b05e38593ed9a18bf3c031b25e59f03bfceb810d449cfabd4f828210153fe4413590d93e3c39e21da54ab0fb71303ef3914493623d26c47d7f62
|
||||
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.ebuild 1821 SHA256 c757fceef11df23acc1b1be36c0bcbd317f25dce3c69d9d614da8b68e2d1ebb3 SHA512 5c033c92a411cfd2324c7b1da9a3d9ff13914b4140e0adea047109b4461a2986c1bd6989931e02c38e314de71e52ed3075753626a7ab766724c37f2cad845c8c WHIRLPOOL 521d87b405bba898458e3ef5e30ad32d8ce94629416aed409f698c65781315d60741363002cd80078484c8f4cf0f9473880dcd36b3f2b9481c6c20646915d297
|
||||
MISC metadata.xml 502 SHA256 0d9c3daad11ea6f866d7600d188621b46992e253faaff2041c2d05206daac239 SHA512 399c87acfd980b7dc29b42d7eeeead868bc8e9efc085f23aa97507d9da6f4af272e747172c4d5d6c1dfe15dc125193a72a5d6ca47ec82615345e239ff26246e4 WHIRLPOOL 080399fd9fb91197af76e134ef7081c8f6fe04ddf00b09c206bd8b3f45a3e558235ce63e25917602e2bba95a974e5f6818f1e7b9e596a4e37cc961c271671b3d
|
||||
@@ -0,0 +1,29 @@
|
||||
#!/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
|
||||
@@ -0,0 +1,48 @@
|
||||
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"
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
Index: trunk/src/VBox/HostDrivers/Support/SUPDrvInternal.h
|
||||
===================================================================
|
||||
--- a/vboxdrv/SUPDrvInternal.h
|
||||
+++ b/vboxdrv/SUPDrvInternal.h
|
||||
@@ -65,7 +65,4 @@
|
||||
# include <linux/modversions.h>
|
||||
# endif
|
||||
-# endif
|
||||
-# if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 0)
|
||||
-# undef ALIGN
|
||||
# endif
|
||||
# ifndef KBUILD_STR
|
||||
@@ -0,0 +1,35 @@
|
||||
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);
|
||||
@@ -0,0 +1,35 @@
|
||||
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;
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
diff -ru3 vbox-kernel-module-src-5.1.22.old/vboxdrv/include/iprt/string.h vbox-kernel-module-src-5.1.22/vboxdrv/include/iprt/string.h
|
||||
--- vbox-kernel-module-src-5.1.22.old/vboxdrv/include/iprt/string.h 2017-04-05 16:52:55.000000000 +0300
|
||||
+++ vbox-kernel-module-src-5.1.22/vboxdrv/include/iprt/string.h 2017-07-05 01:25:52.712343705 +0300
|
||||
@@ -32,11 +32,7 @@
|
||||
#include <iprt/stdarg.h>
|
||||
#include <iprt/err.h> /* for VINF_SUCCESS */
|
||||
#if defined(RT_OS_LINUX) && defined(__KERNEL__)
|
||||
- RT_C_DECLS_BEGIN
|
||||
-# define new newhack /* string.h: strreplace */
|
||||
# include <linux/string.h>
|
||||
-# undef new
|
||||
- RT_C_DECLS_END
|
||||
|
||||
#elif defined(IN_XF86_MODULE) && !defined(NO_ANSIC)
|
||||
RT_C_DECLS_BEGIN
|
||||
diff -ru3 vbox-kernel-module-src-5.1.22.old/vboxnetadp/include/iprt/string.h vbox-kernel-module-src-5.1.22/vboxnetadp/include/iprt/string.h
|
||||
--- vbox-kernel-module-src-5.1.22.old/vboxnetadp/include/iprt/string.h 2017-04-05 16:52:55.000000000 +0300
|
||||
+++ vbox-kernel-module-src-5.1.22/vboxnetadp/include/iprt/string.h 2017-07-05 01:25:52.712343705 +0300
|
||||
@@ -32,11 +32,7 @@
|
||||
#include <iprt/stdarg.h>
|
||||
#include <iprt/err.h> /* for VINF_SUCCESS */
|
||||
#if defined(RT_OS_LINUX) && defined(__KERNEL__)
|
||||
- RT_C_DECLS_BEGIN
|
||||
-# define new newhack /* string.h: strreplace */
|
||||
# include <linux/string.h>
|
||||
-# undef new
|
||||
- RT_C_DECLS_END
|
||||
|
||||
#elif defined(IN_XF86_MODULE) && !defined(NO_ANSIC)
|
||||
RT_C_DECLS_BEGIN
|
||||
diff -ru3 vbox-kernel-module-src-5.1.22.old/vboxnetflt/include/iprt/string.h vbox-kernel-module-src-5.1.22/vboxnetflt/include/iprt/string.h
|
||||
--- vbox-kernel-module-src-5.1.22.old/vboxnetflt/include/iprt/string.h 2017-04-05 16:52:55.000000000 +0300
|
||||
+++ vbox-kernel-module-src-5.1.22/vboxnetflt/include/iprt/string.h 2017-07-05 01:25:52.712343705 +0300
|
||||
@@ -32,11 +32,7 @@
|
||||
#include <iprt/stdarg.h>
|
||||
#include <iprt/err.h> /* for VINF_SUCCESS */
|
||||
#if defined(RT_OS_LINUX) && defined(__KERNEL__)
|
||||
- RT_C_DECLS_BEGIN
|
||||
-# define new newhack /* string.h: strreplace */
|
||||
# include <linux/string.h>
|
||||
-# undef new
|
||||
- RT_C_DECLS_END
|
||||
|
||||
#elif defined(IN_XF86_MODULE) && !defined(NO_ANSIC)
|
||||
RT_C_DECLS_BEGIN
|
||||
diff -ru3 vbox-kernel-module-src-5.1.22.old/vboxpci/include/iprt/string.h vbox-kernel-module-src-5.1.22/vboxpci/include/iprt/string.h
|
||||
--- vbox-kernel-module-src-5.1.22.old/vboxpci/include/iprt/string.h 2017-04-05 16:52:55.000000000 +0300
|
||||
+++ vbox-kernel-module-src-5.1.22/vboxpci/include/iprt/string.h 2017-07-05 01:25:52.712343705 +0300
|
||||
@@ -32,11 +32,7 @@
|
||||
#include <iprt/stdarg.h>
|
||||
#include <iprt/err.h> /* for VINF_SUCCESS */
|
||||
#if defined(RT_OS_LINUX) && defined(__KERNEL__)
|
||||
- RT_C_DECLS_BEGIN
|
||||
-# define new newhack /* string.h: strreplace */
|
||||
# include <linux/string.h>
|
||||
-# undef new
|
||||
- RT_C_DECLS_END
|
||||
|
||||
#elif defined(IN_XF86_MODULE) && !defined(NO_ANSIC)
|
||||
RT_C_DECLS_BEGIN
|
||||
@@ -0,0 +1,93 @@
|
||||
diff -ruN vboxhost.orig/vboxdrv/linux/SUPDrv-linux.c vboxhost/vboxdrv/linux/SUPDrv-linux.c
|
||||
--- vboxhost.orig/vboxdrv/linux/SUPDrv-linux.c 2016-08-22 00:00:00.000000000 +0200
|
||||
+++ vboxhost/vboxdrv/linux/SUPDrv-linux.c 2017-05-31 19:00:22.887324690 +0200
|
||||
@@ -1397,7 +1397,7 @@
|
||||
SUPR0DECL(uint32_t) SUPR0GetKernelFeatures(void)
|
||||
{
|
||||
uint32_t fFlags = 0;
|
||||
-#ifdef CONFIG_PAX_KERNEXEC
|
||||
+#if defined(CONFIG_PAX_KERNEXEC) || LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
|
||||
fFlags |= SUPKERNELFEATURES_GDT_READ_ONLY;
|
||||
#endif
|
||||
#if defined(VBOX_STRICT) || defined(VBOX_WITH_EFLAGS_AC_SET_IN_VBOXDRV)
|
||||
diff -ruN vboxhost.orig/vboxdrv/r0drv/linux/alloc-r0drv-linux.c vboxhost/vboxdrv/r0drv/linux/alloc-r0drv-linux.c
|
||||
--- vboxhost.orig/vboxdrv/r0drv/linux/alloc-r0drv-linux.c 2016-08-22 00:00:00.000000000 +0200
|
||||
+++ vboxhost/vboxdrv/r0drv/linux/alloc-r0drv-linux.c 2017-05-31 19:03:32.465413475 +0200
|
||||
@@ -35,7 +35,10 @@
|
||||
#include <iprt/assert.h>
|
||||
#include <iprt/err.h>
|
||||
#include "r0drv/alloc-r0drv.h"
|
||||
-
|
||||
+#include <linux/kmemleak.h>
|
||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
|
||||
+#include <asm/set_memory.h>
|
||||
+#endif
|
||||
|
||||
#if (defined(RT_ARCH_AMD64) || defined(DOXYGEN_RUNNING)) && !defined(RTMEMALLOC_EXEC_HEAP)
|
||||
# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 23)
|
||||
diff -ruN vboxhost.orig/vboxdrv/r0drv/linux/memobj-r0drv-linux.c vboxhost/vboxdrv/r0drv/linux/memobj-r0drv-linux.c
|
||||
--- vboxhost.orig/vboxdrv/r0drv/linux/memobj-r0drv-linux.c 2017-02-02 16:54:00.000000000 +0100
|
||||
+++ vboxhost/vboxdrv/r0drv/linux/memobj-r0drv-linux.c 2017-05-31 19:23:05.187059423 +0200
|
||||
@@ -899,6 +899,9 @@
|
||||
unsigned long pfn;
|
||||
struct page *pPage;
|
||||
pte_t *pEntry;
|
||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
|
||||
+ p4d_t p4d;
|
||||
+#endif
|
||||
union
|
||||
{
|
||||
pgd_t Global;
|
||||
@@ -917,9 +920,18 @@
|
||||
u.Global = *pgd_offset(current->active_mm, ulAddr);
|
||||
if (RT_UNLIKELY(pgd_none(u.Global)))
|
||||
return NULL;
|
||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
|
||||
+ p4d = *p4d_offset(&u.Global, ulAddr);
|
||||
+ if (RT_UNLIKELY(p4d_none(p4d) || p4d_large(p4d) || !p4d_present(p4d)))
|
||||
+ return NULL;
|
||||
+#endif
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11)
|
||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
|
||||
+ u.Upper = *pud_offset(&p4d, ulAddr);
|
||||
+#else
|
||||
u.Upper = *pud_offset(&u.Global, ulAddr);
|
||||
+#endif
|
||||
if (RT_UNLIKELY(pud_none(u.Upper)))
|
||||
return NULL;
|
||||
# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)
|
||||
@@ -1463,13 +1475,23 @@
|
||||
{
|
||||
int rc = -ENOMEM;
|
||||
pgd_t *pgd;
|
||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
|
||||
+ p4d_t *p4d;
|
||||
+#endif
|
||||
|
||||
spin_lock(&mm->page_table_lock);
|
||||
|
||||
pgd = pgd_offset(mm, ulAddr);
|
||||
if (!pgd_none(*pgd) && !pgd_bad(*pgd))
|
||||
{
|
||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
|
||||
+ p4d = p4d_offset(*pgd, ulAddr);
|
||||
+ if (p4d_none(*p4d))
|
||||
+ goto exit;
|
||||
+ pmd_t *pmd = pmd_offset(p4d, ulAddr);
|
||||
+#else
|
||||
pmd_t *pmd = pmd_offset(pgd, ulAddr);
|
||||
+#endif
|
||||
if (!pmd_none(*pmd))
|
||||
{
|
||||
pte_t *ptep = pte_offset_map(pmd, ulAddr);
|
||||
@@ -1487,6 +1509,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
|
||||
+exit:
|
||||
+#endif
|
||||
spin_unlock(&mm->page_table_lock);
|
||||
return rc;
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
vboxnetflt
|
||||
vboxnetadp
|
||||
vboxdrv
|
||||
vboxpci
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
<maintainer type="person">
|
||||
<email>polynomial-c@gentoo.org</email>
|
||||
<name>Lars Wendler</name>
|
||||
</maintainer>
|
||||
<maintainer type="person">
|
||||
<email>masterzorag@gmail.com</email>
|
||||
<description>Proxy maintainer. CC him on bugs</description>
|
||||
</maintainer>
|
||||
<use>
|
||||
<flag name="pax_kernel">Apply patch needed for pax enabled kernels</flag>
|
||||
</use>
|
||||
</pkgmetadata>
|
||||
@@ -0,0 +1,69 @@
|
||||
# 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
|
||||
|
||||
if kernel_is -ge 4 14 0 ; then
|
||||
epatch "${FILESDIR}"/virtualbox-modules-5.1.28-udp.patch
|
||||
epatch "${FILESDIR}"/virtualbox-modules-5.1.30-timer-setup.patch
|
||||
fi
|
||||
|
||||
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"
|
||||
}
|
||||
Reference in New Issue
Block a user