commit 9e509eaddb14831da29e8ce519e262e82a9cce45
Author: Sérgio M. Basto <sergio(a)serjux.com>
Date: Thu Jan 18 19:16:54 2018 +0000
Fixes for kernel 4.15
VirtualBox-kmod.spec | 9 ++++-
fixes_for_4.15.v2.patch | 103 ++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 111 insertions(+), 1 deletion(-)
---
diff --git a/VirtualBox-kmod.spec b/VirtualBox-kmod.spec
index 3f1288b..158ab6f 100644
--- a/VirtualBox-kmod.spec
+++ b/VirtualBox-kmod.spec
@@ -29,7 +29,7 @@
Name: VirtualBox-kmod
Version: 5.2.6
#Release: 1%%{?prerel:.%%{prerel}}%%{?dist}
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Kernel module for VirtualBox
Group: System Environment/Kernel
@@ -37,6 +37,7 @@ License: GPLv2 or CDDL
URL:
http://www.virtualbox.org/wiki/VirtualBox
# This filters out the XEN kernel, since we don't run on XEN
Source1: VirtualBox-kmod-excludekernel-filter.txt
+Patch1: fixes_for_4.15.v2.patch
%global AkmodsBuildRequires %{_bindir}/kmodtool, VirtualBox-kmodsrc >=
%{version}%{vboxreltag}, xz, time
BuildRequires: %{AkmodsBuildRequires}
@@ -59,6 +60,9 @@ Kernel module for VirtualBox
%prep
%setup -T -c
tar --use-compress-program xz -xf
%{_datadir}/%{name}-%{version}/%{name}-%{version}.tar.xz
+pushd %{name}-%{version}
+%patch1 -p2 -b .kernel_4.15
+popd
# error out if there was something wrong with kmodtool
%{?kmodtool_check}
@@ -107,6 +111,9 @@ DIRS=$(ls %{name}-%{version} |wc -l)
%changelog
+* Thu Jan 18 2018 Sérgio Basto <sergio(a)serjux.com> - 5.2.6-2
+- Fixes for kernel 4.15
+
* Wed Jan 17 2018 Sérgio Basto <sergio(a)serjux.com> - 5.2.6-1
- Update VBox to 5.2.6
diff --git a/fixes_for_4.15.v2.patch b/fixes_for_4.15.v2.patch
new file mode 100644
index 0000000..33b8cba
--- /dev/null
+++ b/fixes_for_4.15.v2.patch
@@ -0,0 +1,103 @@
+diff -rupwBb
VirtualBox-kmodsrc-5.2.6-1.fc28.x86_64/VirtualBox-kmod-5.2.6/vboxguest/VBoxGuest-linux.c
VBoxGuestAdditions_5.2.7-120349/src/vboxguest-5.2.7/vboxguest/VBoxGuest-linux.c
+---
VirtualBox-kmodsrc-5.2.6-1.fc28.x86_64/VirtualBox-kmod-5.2.6/vboxguest/VBoxGuest-linux.c 2018-01-15
14:49:51.000000000 +0000
++++
VBoxGuestAdditions_5.2.7-120349/src/vboxguest-5.2.7/vboxguest/VBoxGuest-linux.c 2018-01-18
11:31:11.000000000 +0000
+@@ -39,6 +39,12 @@
+ # define VBOXGUEST_WITH_INPUT_DRIVER
+ #endif
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
++# define CONST_4_15 const
++#else
++# define CONST_4_15
++#endif
++
+ #include "VBoxGuestInternal.h"
+ #ifdef VBOXGUEST_WITH_INPUT_DRIVER
+ # include <linux/input.h>
+@@ -1058,7 +1064,7 @@ void VGDrvNativeISRMousePollEvent(PVBOXG
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
+
+ /** log and dbg_log parameter setter. */
+-static int vgdrvLinuxParamLogGrpSet(const char *pszValue, struct kernel_param *pParam)
++static int vgdrvLinuxParamLogGrpSet(const char *pszValue, CONST_4_15 struct kernel_param
*pParam)
+ {
+ if (g_fLoggerCreated)
+ {
+@@ -1073,7 +1079,7 @@ static int vgdrvLinuxParamLogGrpSet(cons
+ }
+
+ /** log and dbg_log parameter getter. */
+-static int vgdrvLinuxParamLogGrpGet(char *pszBuf, struct kernel_param *pParam)
++static int vgdrvLinuxParamLogGrpGet(char *pszBuf, CONST_4_15 struct kernel_param
*pParam)
+ {
+ PRTLOGGER pLogger = pParam->name[0] == 'd' ? RTLogDefaultInstance() :
RTLogRelGetDefaultInstance();
+ *pszBuf = '\0';
+@@ -1084,7 +1090,7 @@ static int vgdrvLinuxParamLogGrpGet(char
+
+
+ /** log and dbg_log_flags parameter setter. */
+-static int vgdrvLinuxParamLogFlagsSet(const char *pszValue, struct kernel_param
*pParam)
++static int vgdrvLinuxParamLogFlagsSet(const char *pszValue, CONST_4_15 struct
kernel_param *pParam)
+ {
+ if (g_fLoggerCreated)
+ {
+@@ -1098,7 +1104,7 @@ static int vgdrvLinuxParamLogFlagsSet(co
+ }
+
+ /** log and dbg_log_flags parameter getter. */
+-static int vgdrvLinuxParamLogFlagsGet(char *pszBuf, struct kernel_param *pParam)
++static int vgdrvLinuxParamLogFlagsGet(char *pszBuf, CONST_4_15 struct kernel_param
*pParam)
+ {
+ PRTLOGGER pLogger = pParam->name[0] == 'd' ? RTLogDefaultInstance() :
RTLogRelGetDefaultInstance();
+ *pszBuf = '\0';
+@@ -1109,7 +1115,7 @@ static int vgdrvLinuxParamLogFlagsGet(ch
+
+
+ /** log and dbg_log_dest parameter setter. */
+-static int vgdrvLinuxParamLogDstSet(const char *pszValue, struct kernel_param *pParam)
++static int vgdrvLinuxParamLogDstSet(const char *pszValue, CONST_4_15 struct kernel_param
*pParam)
+ {
+ if (g_fLoggerCreated)
+ {
+@@ -1123,7 +1129,7 @@ static int vgdrvLinuxParamLogDstSet(cons
+ }
+
+ /** log and dbg_log_dest parameter getter. */
+-static int vgdrvLinuxParamLogDstGet(char *pszBuf, struct kernel_param *pParam)
++static int vgdrvLinuxParamLogDstGet(char *pszBuf, CONST_4_15 struct kernel_param
*pParam)
+ {
+ PRTLOGGER pLogger = pParam->name[0] == 'd' ? RTLogDefaultInstance() :
RTLogRelGetDefaultInstance();
+ *pszBuf = '\0';
+@@ -1134,7 +1140,7 @@ static int vgdrvLinuxParamLogDstGet(char
+
+
+ /** r3_log_to_host parameter setter. */
+-static int vgdrvLinuxParamR3LogToHostSet(const char *pszValue, struct kernel_param
*pParam)
++static int vgdrvLinuxParamR3LogToHostSet(const char *pszValue, CONST_4_15 struct
kernel_param *pParam)
+ {
+ if ( pszValue == NULL
+ || *pszValue == '\0'
+@@ -1152,7 +1158,7 @@ static int vgdrvLinuxParamR3LogToHostSet
+ }
+
+ /** r3_log_to_host parameter getter. */
+-static int vgdrvLinuxParamR3LogToHostGet(char *pszBuf, struct kernel_param *pParam)
++static int vgdrvLinuxParamR3LogToHostGet(char *pszBuf, CONST_4_15 struct kernel_param
*pParam)
+ {
+ strcpy(pszBuf, g_DevExt.fLoggingEnabled ? "enabled" :
"disabled");
+ return strlen(pszBuf);
+diff -rupwBb
VirtualBox-kmodsrc-5.2.6-1.fc28.x86_64/VirtualBox-kmod-5.2.6/vboxvideo/vbox_mode.c
VBoxGuestAdditions_5.2.7-120349/src/vboxguest-5.2.7/vboxvideo/vbox_mode.c
+---
VirtualBox-kmodsrc-5.2.6-1.fc28.x86_64/VirtualBox-kmod-5.2.6/vboxvideo/vbox_mode.c 2018-01-17
02:48:28.000000000 +0000
++++ VBoxGuestAdditions_5.2.7-120349/src/vboxguest-5.2.7/vboxvideo/vbox_mode.c 2018-01-18
11:31:11.000000000 +0000
+@@ -396,7 +397,11 @@ static struct drm_encoder *vbox_best_sin
+
+ /* pick the encoder ids */
+ if (enc_id)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
++ return drm_encoder_find(connector->dev, NULL, enc_id);
++#else
+ return drm_encoder_find(connector->dev, enc_id);
++#endif
+
+ return NULL;
+ }