commit 21e64b92ddc14506269e58abe5cea56adb54c633
Author: Sérgio M. Basto <sergio(a)serjux.com>
Date: Sun Jun 2 08:49:56 2019 +0100
Fixes for kernel 5.2
VirtualBox-kmod.spec | 16 +++++++++---
kernel-5.patch | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++
new-kernel-5.2.patch | 63 +++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 148 insertions(+), 3 deletions(-)
---
diff --git a/VirtualBox-kmod.spec b/VirtualBox-kmod.spec
index ea70b16..abed544 100644
--- a/VirtualBox-kmod.spec
+++ b/VirtualBox-kmod.spec
@@ -45,7 +45,7 @@
Name: VirtualBox-kmod
Version: 6.0.8
-Release: 1%{?dist}
+Release: 2%{?dist}
#Release: 1%%{?prerel:.%%{prerel}}%%{?dist}
Summary: Kernel module for VirtualBox
@@ -55,6 +55,8 @@ URL:
http://www.virtualbox.org/wiki/VirtualBox
# This filters out the XEN kernel, since we don't run on XEN
Source1: excludekernel-filter.txt
Source2:
https://github.com/jwrdegoede/vboxsf/archive/%{shortcommit1}.zip
+Patch1: new-kernel-5.2.patch
+Patch2: kernel-5.patch
%global AkmodsBuildRequires %{_bindir}/kmodtool, VirtualBox-kmodsrc >=
%{version}%{vboxreltag}, xz, time
@@ -79,11 +81,16 @@ Kernel module for VirtualBox
%setup -T -c
tar --use-compress-program xz -xf
%{_datadir}/%{name}-%{version}/%{name}-%{version}.tar.xz
pushd %{name}-%{version}
+
+%patch2 -p1
+
%if %{with newvboxsf}
rm -rf vboxsf/
unzip %{SOURCE2}
mv vboxsf-%{commit1}/ vboxsf/
%endif
+
+%patch1 -p1
popd
# error out if there was something wrong with kmodtool
@@ -105,7 +112,7 @@ done
for kernel_version in %{?kernel_versions}; do
for module in vboxdrv %{!?with_newvboxsf:vboxguest}; do
- make VBOX_USE_INSERT_PAGE=1 %{?_smp_mflags}
KERN_DIR="${kernel_version##*___}" -C "${kernel_version##*___}"
SUBDIRS="${PWD}/_kmod_build_${kernel_version%%___*}/${module}" modules
+ make VBOX_USE_INSERT_PAGE=1 %{?_smp_mflags}
KERN_DIR="${kernel_version##*___}" -C "${kernel_version##*___}"
M="${PWD}/_kmod_build_${kernel_version%%___*}/${module}" modules
done
# copy vboxdrv (for host) module symbols which are used by vboxnetflt and vboxnetadp
km's:
cp _kmod_build_${kernel_version%%___*}/{vboxdrv/Module.symvers,vboxnetadp}
@@ -115,7 +122,7 @@ for kernel_version in %{?kernel_versions}; do
cp _kmod_build_${kernel_version%%___*}/{vboxguest/Module.symvers,vboxsf}
%endif
for module in vbox{netadp,netflt,sf%{?with_vboxvideo:,video},pci}; do
- make VBOX_USE_INSERT_PAGE=1 %{?_smp_mflags}
KERN_DIR="${kernel_version##*___}" -C "${kernel_version##*___}"
SUBDIRS="${PWD}/_kmod_build_${kernel_version%%___*}/${module}" modules
+ make VBOX_USE_INSERT_PAGE=1 %{?_smp_mflags}
KERN_DIR="${kernel_version##*___}" -C "${kernel_version##*___}"
M="${PWD}/_kmod_build_${kernel_version%%___*}/${module}" modules
done
done
@@ -143,6 +150,9 @@ DIRS=$(ls %{name}-%{version} |wc -l)
%changelog
+* Fri May 31 2019 Sérgio Basto <sergio(a)serjux.com> - 6.0.8-2
+- Fixes for kernel 5.2
+
* Wed May 15 2019 Sérgio Basto <sergio(a)serjux.com> - 6.0.8-1
- Update to 6.0.8
diff --git a/kernel-5.patch b/kernel-5.patch
new file mode 100644
index 0000000..1950911
--- /dev/null
+++ b/kernel-5.patch
@@ -0,0 +1,72 @@
+diff -rup VirtualBox-kmod-6.0.8/vboxdrv/Makefile-header.gmk
VirtualBox-kmod-6.0.8.new/vboxdrv/Makefile-header.gmk
+--- VirtualBox-kmod-6.0.8/vboxdrv/Makefile-header.gmk 2019-05-13 14:33:15.000000000
+0100
++++ VirtualBox-kmod-6.0.8.new/vboxdrv/Makefile-header.gmk 2019-05-31 03:03:55.997181820
+0100
+@@ -127,7 +127,7 @@ ifeq ($(KERNELRELEASE),)
+ VBOX_KERN_GROKS_EXTMOD :=
+ endif
+ VBOX_KERN_GROKS_SUBDIRS :=
+- ifeq ($(shell if grep '"[432]\.' $(KERN_DIR)/include/linux/version.h >
/dev/null 2>&1; then echo yes; fi),yes)
++ ifeq ($(shell if grep '"[5432]\.' $(KERN_DIR)/include/linux/version.h
> /dev/null 2>&1; then echo yes; fi),yes)
+ VBOX_KERN_GROKS_SUBDIRS := yes
+ endif
+ endif
+diff -rup VirtualBox-kmod-6.0.8/vboxguest/Makefile-header.gmk
VirtualBox-kmod-6.0.8.new/vboxguest/Makefile-header.gmk
+--- VirtualBox-kmod-6.0.8/vboxguest/Makefile-header.gmk 2019-05-13 14:33:15.000000000
+0100
++++ VirtualBox-kmod-6.0.8.new/vboxguest/Makefile-header.gmk 2019-05-31 03:03:55.997181820
+0100
+@@ -127,7 +127,7 @@ ifeq ($(KERNELRELEASE),)
+ VBOX_KERN_GROKS_EXTMOD :=
+ endif
+ VBOX_KERN_GROKS_SUBDIRS :=
+- ifeq ($(shell if grep '"[432]\.' $(KERN_DIR)/include/linux/version.h >
/dev/null 2>&1; then echo yes; fi),yes)
++ ifeq ($(shell if grep '"[5432]\.' $(KERN_DIR)/include/linux/version.h
> /dev/null 2>&1; then echo yes; fi),yes)
+ VBOX_KERN_GROKS_SUBDIRS := yes
+ endif
+ endif
+diff -rup VirtualBox-kmod-6.0.8/vboxnetadp/Makefile-header.gmk
VirtualBox-kmod-6.0.8.new/vboxnetadp/Makefile-header.gmk
+--- VirtualBox-kmod-6.0.8/vboxnetadp/Makefile-header.gmk 2019-05-13 14:33:15.000000000
+0100
++++ VirtualBox-kmod-6.0.8.new/vboxnetadp/Makefile-header.gmk 2019-05-31
03:03:55.997181820 +0100
+@@ -127,7 +127,7 @@ ifeq ($(KERNELRELEASE),)
+ VBOX_KERN_GROKS_EXTMOD :=
+ endif
+ VBOX_KERN_GROKS_SUBDIRS :=
+- ifeq ($(shell if grep '"[432]\.' $(KERN_DIR)/include/linux/version.h >
/dev/null 2>&1; then echo yes; fi),yes)
++ ifeq ($(shell if grep '"[5432]\.' $(KERN_DIR)/include/linux/version.h
> /dev/null 2>&1; then echo yes; fi),yes)
+ VBOX_KERN_GROKS_SUBDIRS := yes
+ endif
+ endif
+diff -rup VirtualBox-kmod-6.0.8/vboxnetflt/Makefile-header.gmk
VirtualBox-kmod-6.0.8.new/vboxnetflt/Makefile-header.gmk
+--- VirtualBox-kmod-6.0.8/vboxnetflt/Makefile-header.gmk 2019-05-13 14:33:15.000000000
+0100
++++ VirtualBox-kmod-6.0.8.new/vboxnetflt/Makefile-header.gmk 2019-05-31
03:03:55.997181820 +0100
+@@ -127,7 +127,7 @@ ifeq ($(KERNELRELEASE),)
+ VBOX_KERN_GROKS_EXTMOD :=
+ endif
+ VBOX_KERN_GROKS_SUBDIRS :=
+- ifeq ($(shell if grep '"[432]\.' $(KERN_DIR)/include/linux/version.h >
/dev/null 2>&1; then echo yes; fi),yes)
++ ifeq ($(shell if grep '"[5432]\.' $(KERN_DIR)/include/linux/version.h
> /dev/null 2>&1; then echo yes; fi),yes)
+ VBOX_KERN_GROKS_SUBDIRS := yes
+ endif
+ endif
+diff -rup VirtualBox-kmod-6.0.8/vboxpci/Makefile-header.gmk
VirtualBox-kmod-6.0.8.new/vboxpci/Makefile-header.gmk
+--- VirtualBox-kmod-6.0.8/vboxpci/Makefile-header.gmk 2019-05-13 14:33:15.000000000
+0100
++++ VirtualBox-kmod-6.0.8.new/vboxpci/Makefile-header.gmk 2019-05-31 03:03:55.997181820
+0100
+@@ -127,7 +127,7 @@ ifeq ($(KERNELRELEASE),)
+ VBOX_KERN_GROKS_EXTMOD :=
+ endif
+ VBOX_KERN_GROKS_SUBDIRS :=
+- ifeq ($(shell if grep '"[432]\.' $(KERN_DIR)/include/linux/version.h >
/dev/null 2>&1; then echo yes; fi),yes)
++ ifeq ($(shell if grep '"[5432]\.' $(KERN_DIR)/include/linux/version.h
> /dev/null 2>&1; then echo yes; fi),yes)
+ VBOX_KERN_GROKS_SUBDIRS := yes
+ endif
+ endif
+diff -rup VirtualBox-kmod-6.0.8/vboxsf/Makefile-header.gmk
VirtualBox-kmod-6.0.8.new/vboxsf/Makefile-header.gmk
+--- VirtualBox-kmod-6.0.8/vboxsf/Makefile-header.gmk 2019-05-13 14:33:15.000000000 +0100
++++ VirtualBox-kmod-6.0.8.new/vboxsf/Makefile-header.gmk 2019-05-31 03:03:55.997181820
+0100
+@@ -127,7 +127,7 @@ ifeq ($(KERNELRELEASE),)
+ VBOX_KERN_GROKS_EXTMOD :=
+ endif
+ VBOX_KERN_GROKS_SUBDIRS :=
+- ifeq ($(shell if grep '"[432]\.' $(KERN_DIR)/include/linux/version.h >
/dev/null 2>&1; then echo yes; fi),yes)
++ ifeq ($(shell if grep '"[5432]\.' $(KERN_DIR)/include/linux/version.h
> /dev/null 2>&1; then echo yes; fi),yes)
+ VBOX_KERN_GROKS_SUBDIRS := yes
+ endif
+ endif
diff --git a/new-kernel-5.2.patch b/new-kernel-5.2.patch
new file mode 100644
index 0000000..97f92f3
--- /dev/null
+++ b/new-kernel-5.2.patch
@@ -0,0 +1,63 @@
+Description: cherry-pick commit
https://github.com/torvalds/linux/commit/c8613fc6293b0f8c1d303c991338d085... from
kernel to vbox codebase
+Author: Gianfranco Costamagna <locutusofborg(a)debian.org>
+
+Forwarded: irc
+Last-Update: 2019-05-22
+
+--- ./vboxvideo/vbox_fb.c
++++ ./vboxvideo/vbox_fb.c
+@@ -312,14 +312,18 @@
+ if (IS_ERR(info))
+ return -PTR_ERR(info);
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0)
+ info->par = fbdev;
++#endif
+
+ fbdev->size = size;
+
+ fb = &fbdev->afb.base;
+ fbdev->helper.fb = fb;
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0)
+ strcpy(info->fix.id, "vboxdrmfb");
++#endif
+
+ /*
+ * The last flag forces a mode set on VT switches even if the kernel
+@@ -334,14 +338,20 @@
+ */
+ info->apertures->ranges[0].base = pci_resource_start(dev->pdev, 0);
+ info->apertures->ranges[0].size = pci_resource_len(dev->pdev, 0);
+-
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 2, 0)
++ drm_fb_helper_fill_info(info, helper, sizes);
++#else
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) || defined(RHEL_75)
+ drm_fb_helper_fill_fix(info, fb->pitches[0], fb->format->depth);
+ #else
+ drm_fb_helper_fill_fix(info, fb->pitches[0], fb->depth);
+ #endif
++#endif
++
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0)
+ drm_fb_helper_fill_var(info, &fbdev->helper, sizes->fb_width,
+ sizes->fb_height);
++#endif
+
+ info->screen_base = bo->kmap.virtual;
+ info->screen_size = size;
+--- ./vboxvideo/vbox_ttm.c
++++ ./vboxvideo/vbox_ttm.c
+@@ -307,7 +307,10 @@
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0) || defined(RHEL_71)
+ dev->anon_inode->i_mapping,
+ #endif
+- DRM_FILE_PAGE_OFFSET, true);
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0)
++ DRM_FILE_PAGE_OFFSET,
++#endif
++ true);
+ if (ret) {
+ DRM_ERROR("Error initialising bo driver; %d\n", ret);
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0)