commit cc0cdc7b481a525ab0b5da3b129599c9f0232ba4
Author: Nicolas Chauvet <kwizart(a)gmail.com>
Date: Thu Sep 1 16:07:42 2022 +0200
Revert "This hasn't built since kernel-5.15 or earlier"
This reverts commit 0bbe2a736cc80f0122044cc11788d50c6d759ae4.
.gitignore | 1 +
dead.package | 1 -
kernel-5.8.patch | 45 ++++++++
ndiswrapper-kmod-nomodinfo.patch | 14 +++
ndiswrapper-kmod.spec | 156 ++++++++++++++++++++++++++
ndiswrapper-kmodtool-excludekernel-filterfile | 1 +
sources | 1 +
7 files changed, 218 insertions(+), 1 deletion(-)
---
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..52ae49b
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+ndiswrapper-*.tar.gz
diff --git a/kernel-5.8.patch b/kernel-5.8.patch
new file mode 100644
index 0000000..95b9f2a
--- /dev/null
+++ b/kernel-5.8.patch
@@ -0,0 +1,45 @@
+--- a/driver/loader.c 2020-05-03 13:18:33.000000000 +0100
++++ b/driver/loader.c 2020-08-31 15:43:53.379776002 +0100
+@@ -155,8 +155,12 @@ static int load_sys_files(struct wrap_dr
+ #elif defined PAGE_KERNEL_EXEC
+ pe_image->image =
+ __vmalloc(load_driver->sys_files[i].size,
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
++ GFP_KERNEL | __GFP_HIGHMEM);
++#else
+ GFP_KERNEL | __GFP_HIGHMEM,
+ PAGE_KERNEL_EXEC);
++#endif
+ #else
+ #error x86_64 should have either PAGE_KERNEL_EXECUTABLE or PAGE_KERNEL_EXEC
+ #endif
+--- a/driver/pe_linker.c 2020-05-03 13:18:33.000000000 +0100
++++ b/driver/pe_linker.c 2020-08-31 15:49:48.147882380 +0100
+@@ -417,8 +417,12 @@ static int fix_pe_image(struct pe_image
+ image = __vmalloc(image_size, GFP_KERNEL | __GFP_HIGHMEM,
+ PAGE_KERNEL_EXECUTABLE);
+ #elif defined PAGE_KERNEL_EXEC
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
++ image = __vmalloc(image_size, GFP_KERNEL | __GFP_HIGHMEM);
++#else
+ image = __vmalloc(image_size, GFP_KERNEL | __GFP_HIGHMEM,
+ PAGE_KERNEL_EXEC);
++#endif
+ #else
+ #error x86_64 should have either PAGE_KERNEL_EXECUTABLE or PAGE_KERNEL_EXEC
+ #endif
+--- a/driver/ntoskernel.c 2020-05-03 13:18:33.000000000 +0100
++++ b/driver/ntoskernel.c 2020-08-31 15:55:47.458977337 +0100
+@@ -821,8 +821,12 @@ wstdcall void *WIN_FUNC(ExAllocatePoolWi
+ addr = kmalloc(size, irql_gfp());
+ else {
+ if (irql_gfp() & GFP_ATOMIC) {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
++ addr = __vmalloc(size, GFP_ATOMIC | __GFP_HIGHMEM);
++#else
+ addr = __vmalloc(size, GFP_ATOMIC | __GFP_HIGHMEM,
+ PAGE_KERNEL);
++#endif
+ TRACE1("%p, %zu", addr, size);
+ } else {
+ addr = vmalloc(size);
diff --git a/ndiswrapper-kmod-nomodinfo.patch b/ndiswrapper-kmod-nomodinfo.patch
new file mode 100644
index 0000000..632b8b0
--- /dev/null
+++ b/ndiswrapper-kmod-nomodinfo.patch
@@ -0,0 +1,14 @@
+diff -up ndiswrapper-1.57/driver/Makefile.orig ndiswrapper-1.57/driver/Makefile
+--- ndiswrapper-1.57/driver/Makefile.orig 2012-01-11 22:04:35.103054918 +0100
++++ ndiswrapper-1.57/driver/Makefile 2012-01-11 22:06:37.880672013 +0100
+@@ -191,8 +191,8 @@ clean:
+ rm -rf .tmp_versions
+
+ install: config_check $(MODULE)
+- @/sbin/modinfo $(MODULE) | grep -q "^vermagic: *$(KVERS) " || \
+- { echo "$(MODULE)" is not for Linux $(KVERS); exit 1; }
++ #@/sbin/modinfo $(MODULE) | grep -q "^vermagic: *$(KVERS) " || \
++ # { echo "$(MODULE)" is not for Linux $(KVERS); exit 1; }
+ mkdir -p -m 755 $(DESTDIR)$(INST_DIR)
+ install -m 0644 $(MODULE) $(DESTDIR)$(INST_DIR)
+ ifndef DESTDIR
diff --git a/ndiswrapper-kmod.spec b/ndiswrapper-kmod.spec
new file mode 100644
index 0000000..887a41a
--- /dev/null
+++ b/ndiswrapper-kmod.spec
@@ -0,0 +1,156 @@
+# buildforkernels macro hint: when you build a new version or a new release
+# that contains bugfixes or other improvements then you must disable the
+# "buildforkernels newest" macro for just that build; immediately after
+# queuing that build enable the macro again for subsequent builds; that way
+# a new akmod package will only get build when a new one is actually needed
+# RHEL8 kernel doesn't have WEXT, so only build an akmod there
+# so that others kernel implementation can have ndiswrapper
+%if 0%{?fedora} || 0%{?rhel} > 7
+%global buildforkernels akmod
+%global debug_package %{nil}
+%endif
+
+#global pre rc1
+
+Summary: Ndiswrapper kernel module
+Name: ndiswrapper-kmod
+Version: 1.63
+Release: 5%{?pre}%{?dist}
+License: GPLv2
+URL:
http://ndiswrapper.sourceforge.net
+Source0:
http://downloads.sf.net/ndiswrapper/ndiswrapper-%{version}%{?pre}.tar.gz
+Source11: ndiswrapper-kmodtool-excludekernel-filterfile
+Patch0: ndiswrapper-kmod-nomodinfo.patch
+Patch1: kernel-5.8.patch
+
+# needed for plague to make sure it builds for i586 and i686
+ExclusiveArch: i686 x86_64
+
+# get the needed BuildRequires (in parts depending on what we build for)
+BuildRequires: %{_bindir}/kmodtool
+%{!?kernels:BuildRequires:
buildsys-build-rpmfusion-kerneldevpkgs-%{?buildforkernels:%{buildforkernels}}%{!?buildforkernels:current}-%{_target_cpu}
}
+# kmodtool does its magic here
+%{expand:%(kmodtool --target %{_target_cpu} --repo rpmfusion --kmodname %{name}
--filterfile %{SOURCE11} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels
"%{?kernels}"} 2>/dev/null) }
+
+%description
+The ndiswrapper project makes it possible to use WLAN-Hardware
+with Linux by means of a loadable kernel module that "wraps
+around" NDIS (Windows network driver API) drivers. These rpms contain
+just the kernel module and loader. You will also need the Windows driver
+for your card.
+
+WARNING: Fedora-Kernels use 4K size stack. Many Windows drivers
+will need at least 8K size stacks. For details read the wiki on:
+http:/ndiswrapper.sourceforge.net
+
+%prep
+# error out if there was something wrong with kmodtool
+%{?kmodtool_check}
+# print kmodtool output for debugging purposes:
+kmodtool --target %{_target_cpu} --repo rpmfusion --kmodname %{name} --filterfile
%{SOURCE11} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels
"%{?kernels}"} 2>/dev/null
+# go
+%setup -q -c -T -a 0 -n %{name}-%{version}%{?pre}
+(cd ndiswrapper-%{version}%{?pre} ;
+%patch0 -p1 -b .orig
+%patch1 -p1 -b .orig
+)
+sed -i 's|/sbin/depmod -a|/bin/true|'
ndiswrapper-%{version}%{?pre}/driver/Makefile
+for kernel_version in %{?kernel_versions} ; do
+ cp -a ndiswrapper-%{version}%{?pre} _kmod_build_${kernel_version%%___*}
+done
+
+
+%build
+for kernel_version in %{?kernel_versions} ; do
+ make V=1 %{?_smp_mflags} -C _kmod_build_${kernel_version%%___*}
KVERS="${kernel_version%%___*}" KSRC="${kernel_version##*___}"
KBUILD="${kernel_version##*___}" -C driver
+done
+
+
+%install
+for kernel_version in %{?kernel_versions} ; do
+ make -C _kmod_build_${kernel_version%%___*}/driver
KVERS="${kernel_version%%___*}" KSRC="${kernel_version##*___}"
KBUILD="${kernel_version##*___}"
INST_DIR=$RPM_BUILD_ROOT%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}
install
+ chmod 0755 $RPM_BUILD_ROOT/%{kmodinstdir_prefix}/*/%{kmodinstdir_postfix}/*
+done
+%{?akmod_install}
+
+
+%changelog
+* Sun Aug 07 2022 RPM Fusion Release Engineering <sergiomb(a)rpmfusion.org> - 1.63-5
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild and ffmpeg
+ 5.1
+
+* Wed Feb 09 2022 RPM Fusion Release Engineering <sergiomb(a)rpmfusion.org> - 1.63-4
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
+
+* Tue Aug 03 2021 RPM Fusion Release Engineering <leigh123linux(a)gmail.com> -
1.63-3
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
+
+* Wed Feb 03 2021 RPM Fusion Release Engineering <leigh123linux(a)gmail.com> -
1.63-2
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
+
+* Mon Aug 31 2020 Leigh Scott <leigh123linux(a)gmail.com> - 1.63-1
+- Update to 1.63
+- Patch for 5.8 kernel
+
+* Tue Aug 18 2020 RPM Fusion Release Engineering <leigh123linux(a)gmail.com> -
1.62-2
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
+
+* Wed Apr 22 2020 Leigh Scott <leigh123linux(a)gmail.com> - 1.62-1
+- Update to 1.62
+
+* Wed Feb 05 2020 RPM Fusion Release Engineering <leigh123linux(a)gmail.com> -
1.61-13
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
+
+* Fri Dec 20 2019 Leigh Scott <leigh123linux(a)googlemail.com> - 1.61-12
+- Patch for 5.3 and 5.4 kernel
+
+* Fri Aug 09 2019 RPM Fusion Release Engineering <leigh123linux(a)gmail.com> -
1.61-11
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
+
+* 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
+
+* Thu Dec 13 2018 Nicolas Chauvet <kwizart(a)gmail.com> - 1.61-8
+- Package clean-up
+- Drop some changelog
+
+* Fri Jul 27 2018 RPM Fusion Release Engineering <leigh123linux(a)gmail.com> -
1.61-7
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
+
+* Sun Mar 11 2018 Leigh Scott <leigh123linux(a)googlemail.com> - 1.61-6
+- Patch for 4.15 kernel
+
+* Thu Mar 01 2018 RPM Fusion Release Engineering <leigh123linux(a)googlemail.com> -
1.61-5
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
+
+* Thu Dec 14 2017 Leigh Scott <leigh123linux(a)googlemail.com> - 1.61-4
+- Patch for 4.13 kernel
+
+* Thu Aug 31 2017 RPM Fusion Release Engineering <kwizart(a)rpmfusion.org> - 1.61-3
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
+
+* Wed Jun 28 2017 Leigh Scott <leigh123linux(a)googlemail.com> - 1.61-2
+- Patch for 4.11 kernel
+
+* Tue Jun 27 2017 Nicolas Chauvet <kwizart(a)gmail.com> - 1.61-1
+- Update to 1.61
+
+* Mon Mar 20 2017 RPM Fusion Release Engineering <kwizart(a)rpmfusion.org> - 1.60-3
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
+
+* Mon Sep 19 2016 Leigh Scott <leigh123linux(a)googlemail.com> - 1.60-2
+- Patch for 4.7 kernel
+
+* Sun Jun 19 2016 Leigh Scott <leigh123linux(a)googlemail.com> - 1.60-1
+- Update to 1.60
+
+* Mon May 25 2015 Leigh Scott <leigh123linux(a)googlemail.com> - 1.59-8
+- Patch for 4.0.0 kernel
+
+* Sun May 24 2015 Nicolas Chauvet <kwizart(a)gmail.com> - 1.59-7.25
+- Rebuilt for kernel
+
+
diff --git a/ndiswrapper-kmodtool-excludekernel-filterfile
b/ndiswrapper-kmodtool-excludekernel-filterfile
new file mode 100644
index 0000000..22913e1
--- /dev/null
+++ b/ndiswrapper-kmodtool-excludekernel-filterfile
@@ -0,0 +1 @@
+xen$
diff --git a/sources b/sources
new file mode 100644
index 0000000..0b44e12
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+SHA512 (ndiswrapper-1.63.tar.gz) =
694802655d775ba55cfc0ec0b8c4d0cbdb659ead613d46f158eed79c8985393cf22ded757fff06b0e1a6e3c94bdaace7dd4cb1059d2960244e9f955f097fb7ad