commit 0e55d6985a3a01eb42c294a58b17363fcef356b1
Author: Sérgio M. Basto <sergio(a)serjux.com>
Date: Tue Sep 4 05:36:37 2018 +0100
Fixes for kernel 4.18
VirtualBox-kmod.spec | 9 ++++++---
kernel-4.18.patch | 26 ++++++++++++++++++++++++++
2 files changed, 32 insertions(+), 3 deletions(-)
---
diff --git a/VirtualBox-kmod.spec b/VirtualBox-kmod.spec
index 425b1c4..9d1c149 100644
--- a/VirtualBox-kmod.spec
+++ b/VirtualBox-kmod.spec
@@ -41,7 +41,7 @@
Name: VirtualBox-kmod
Version: 5.2.18
#Release: 1%%{?prerel:.%%{prerel}}%%{?dist}
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Kernel module for VirtualBox
Group: System Environment/Kernel
@@ -51,7 +51,7 @@ URL:
http://www.virtualbox.org/wiki/VirtualBox
Source1: VirtualBox-kmod-excludekernel-filter.txt
Source2:
https://github.com/jwrdegoede/vboxsf/archive/master.zip
-#Patch1: fixes_for_4.15.v2.patch
+Patch1: kernel-4.18.patch
%global AkmodsBuildRequires %{_bindir}/kmodtool, VirtualBox-kmodsrc >=
%{version}%{vboxreltag}, xz, time
BuildRequires: %{AkmodsBuildRequires}
@@ -75,7 +75,7 @@ Kernel module for VirtualBox
%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
+%patch1 -p2 -b .kernel_4.18
%if %{with newvboxsf}
rm -rf vboxsf/
unzip %{SOURCE2}
@@ -140,6 +140,9 @@ DIRS=$(ls %{name}-%{version} |wc -l)
%changelog
+* Tue Sep 04 2018 Sérgio Basto <sergio(a)serjux.com> - 5.2.18-2
+- Fixes for kernel 4.18
+
* Mon Aug 27 2018 Sérgio Basto <sergio(a)serjux.com> - 5.2.18-1
- Update to 5.2.18
diff --git a/kernel-4.18.patch b/kernel-4.18.patch
new file mode 100644
index 0000000..0fba836
--- /dev/null
+++ b/kernel-4.18.patch
@@ -0,0 +1,26 @@
+--- ./VirtualBox-kmod-5.2.18/vboxsf/utils.c.orig 2018-09-04 05:22:27.815143183 +0100
++++ ./VirtualBox-kmod-5.2.18/vboxsf/utils.c 2018-09-04 05:23:00.318486258 +0100
+@@ -50,7 +50,11 @@ static void sf_timespec_from_ftime(RTTIM
+ RTTimeSpecSetNano(ts, t);
+ }
+ #else /* >= 2.6.0 */
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 18, 0)
+ static void sf_ftime_from_timespec(struct timespec *tv, RTTIMESPEC *ts)
++#else
++static void sf_ftime_from_timespec(struct timespec64 *tv, RTTIMESPEC *ts)
++#endif
+ {
+ int64_t t = RTTimeSpecGetNano(ts);
+ int64_t nsec;
+@@ -60,7 +64,11 @@ static void sf_ftime_from_timespec(struc
+ tv->tv_nsec = nsec;
+ }
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 18, 0)
+ static void sf_timespec_from_ftime(RTTIMESPEC *ts, struct timespec *tv)
++#else
++static void sf_timespec_from_ftime(RTTIMESPEC *ts, struct timespec64 *tv)
++#endif
+ {
+ int64_t t = (int64_t)tv->tv_nsec + (int64_t)tv->tv_sec * 1000000000;
+ RTTimeSpecSetNano(ts, t);