[packages/VirtualBox] - build fixes for kernel 4.15 - rel 2

baggins baggins at pld-linux.org
Tue Jan 30 00:20:30 CET 2018


commit 0b35e39e6836bf410a2fbaa32f1a74ddd7e92018
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Tue Jan 30 00:19:59 2018 +0100

    - build fixes for kernel 4.15
    - rel 2

 VirtualBox.spec   |   4 ++-
 kernel-4.15.patch | 101 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 104 insertions(+), 1 deletion(-)
---
diff --git a/VirtualBox.spec b/VirtualBox.spec
index 7a7a9db..d3693ca 100644
--- a/VirtualBox.spec
+++ b/VirtualBox.spec
@@ -42,7 +42,7 @@ exit 1
 
 %define		qtver	5.6.0
 
-%define		rel		1
+%define		rel		2
 %define		pname		VirtualBox
 Summary:	VirtualBox - x86 hardware virtualizer
 Summary(pl.UTF-8):	VirtualBox - wirtualizator sprzętu x86
@@ -82,6 +82,7 @@ Patch14:	%{pname}-multipython.patch
 Patch15:	%{pname}-lightdm-1.19.2.patch
 Patch16:	%{pname}-no-vboxvideo.patch
 Patch17:	%{pname}-kerndir.patch
+Patch18:	kernel-4.15.patch
 URL:		http://www.virtualbox.org/
 %if %{with userspace}
 %ifarch %{x8664}
@@ -567,6 +568,7 @@ tar -zxf guest-modules.tar.gz -C GuestDrivers
 
 ../src/VBox/HostDrivers/linux/export_modules.sh host-modules.tar.gz --without-hardening
 tar -zxf host-modules.tar.gz -C HostDrivers
+%patch18 -p1
 cd -
 %endif
 
diff --git a/kernel-4.15.patch b/kernel-4.15.patch
new file mode 100644
index 0000000..7edd0df
--- /dev/null
+++ b/kernel-4.15.patch
@@ -0,0 +1,101 @@
+--- VirtualBox-5.2.6/GuestDrivers/vboxguest/VBoxGuest-linux.c	2018-01-15 14:49:51.000000000 +0000
++++ VirtualBox-5.2.6/GuestDrivers/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);
+--- VirtualBox-5.2.6/GuestDrivers/vboxvideo/vbox_mode.c	2018-01-17 02:48:28.000000000 +0000
++++ VirtualBox-5.2.6/GuestDrivers/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;
+ }
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/VirtualBox.git/commitdiff/0b35e39e6836bf410a2fbaa32f1a74ddd7e92018



More information about the pld-cvs-commit mailing list