commit 3f662b4632c7cba414a39990c607ec4cb1113637
Author: Leigh Scott <leigh123linux(a)googlemail.com>
Date: Sun Apr 7 10:57:56 2019 +0100
Patch for 5.0 kernel
ndiswrapper-5.0-kernel.patch | 48 ++++++++++++++++++++++++++++++++++++++++++++
ndiswrapper-kmod.spec | 7 ++++++-
2 files changed, 54 insertions(+), 1 deletion(-)
---
diff --git a/ndiswrapper-5.0-kernel.patch b/ndiswrapper-5.0-kernel.patch
new file mode 100644
index 0000000..916210a
--- /dev/null
+++ b/ndiswrapper-5.0-kernel.patch
@@ -0,0 +1,48 @@
+From: Julian Andres Klode <jak(a)debian.org>
+Date: Fri, 25 Jan 2019 21:04:17 +0100
+Subject: kernel 5.0: Replace do_gettimeofday() with ktime_get_real()
+
+do_gettimeofday() was removed in kernel 5.0, a direct replacement
+seems to be ktime_get_real() and friends. ktime_get_real() seems
+to be a nice replacement, and even makes the code easier.
+
+Bug-Ubuntu:
https://bugs.launchpad.net/bugs/1813063
+---
+ driver/ntoskernel.c | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+diff --git a/driver/ntoskernel.c b/driver/ntoskernel.c
+index 156c688..a99490b 100644
+--- a/driver/ntoskernel.c
++++ b/driver/ntoskernel.c
+@@ -2498,7 +2498,11 @@ struct worker_init_struct {
+
+ int ntoskernel_init(void)
+ {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,0,0)
+ struct timeval now;
++#else
++ ktime_t now;
++#endif
+
+ spin_lock_init(&dispatcher_lock);
+ spin_lock_init(&ntoskernel_lock);
+@@ -2518,11 +2522,18 @@ int ntoskernel_init(void)
+ INIT_WORK(&ntos_work, ntos_work_worker);
+ wrap_timer_slist.next = NULL;
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,0,0)
+ do_gettimeofday(&now);
+ wrap_ticks_to_boot = TICKS_1601_TO_1970;
+ wrap_ticks_to_boot += (u64)now.tv_sec * TICKSPERSEC;
+ wrap_ticks_to_boot += now.tv_usec * 10;
+ wrap_ticks_to_boot -= jiffies * TICKSPERJIFFY;
++#else
++ now = ktime_get_real();
++ wrap_ticks_to_boot = TICKS_1601_TO_1970;
++ wrap_ticks_to_boot += ktime_to_us(now) * 10;
++ wrap_ticks_to_boot -= jiffies * TICKSPERJIFFY;
++#endif
+ TRACE2("%llu", wrap_ticks_to_boot);
+
+ cpu_count = num_online_cpus();
diff --git a/ndiswrapper-kmod.spec b/ndiswrapper-kmod.spec
index 7bdb3d3..9ac03ae 100644
--- a/ndiswrapper-kmod.spec
+++ b/ndiswrapper-kmod.spec
@@ -13,7 +13,7 @@
Summary: Ndiswrapper kernel module
Name: ndiswrapper-kmod
Version: 1.61
-Release: 9%{?pre}%{?dist}
+Release: 10%{?pre}%{?dist}
License: GPLv2
URL:
http://ndiswrapper.sourceforge.net
Source0:
http://downloads.sf.net/ndiswrapper/ndiswrapper-%{version}%{?pre}.tar.gz
@@ -22,6 +22,7 @@ Patch0: ndiswrapper-kmod-nomodinfo.patch
Patch1: ndiswrapper-4.11-kernel.patch
Patch2: ndiswrapper-4.13-kernel.patch
Patch3: ndiswrapper-4.15-kernel.patch
+Patch4: ndiswrapper-5.0-kernel.patch
# needed for plague to make sure it builds for i586 and i686
ExclusiveArch: i686 x86_64
@@ -55,6 +56,7 @@ kmodtool --target %{_target_cpu} --repo rpmfusion --kmodname %{name}
--filterfi
%patch1 -p1 -b .orig
%patch2 -p2 -b .orig
%patch3 -p1 -b .orig
+%patch4 -p1 -b .orig
)
sed -i 's|/sbin/depmod -a|/bin/true|'
ndiswrapper-%{version}%{?pre}/driver/Makefile
for kernel_version in %{?kernel_versions} ; do
@@ -77,6 +79,9 @@ done
%changelog
+* Sun Apr 07 2019 Leigh Scott <leigh123linux(a)googlemail.com> - 1.61-10
+- Patch for 5.0 kernel
+
* Mon Mar 04 2019 RPM Fusion Release Engineering <leigh123linux(a)gmail.com> -
1.61-9
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild