Bug#717445: pu: package ndiswrapper/1.57-1+deb7u1

2015-05-29 Thread Julian Andres Klode
oOn Sat, Apr 25, 2015 at 06:33:52PM +0100, Adam D. Barratt wrote:
 On Sat, 2014-12-06 at 21:22 +0100, Philipp Kern wrote:
  Control: tag -1 + moreinfo
  
  Hi,
  
  On Sun, Jan 26, 2014 at 02:57:22PM +0100, Julian Andres Klode wrote:
   I'm most likely going to ship the patch below in 1.59-2, it just drops
   the detection and hard-codes the modprobe.d/ndiswrapper.conf file, as
   the other locations are not supported anymore.
  
  if this request still applies, please provide an updated debdiff against 
  stable
  of what you want to ship. Thanks!
 
 Poke.
 
 Regards,
 
 Adam
 

Sorry for not answering. I attached a new diff. The patches had to
be backported from unstable, due to some renamed (KVERS vs KVERS_UNAME)
and moved code (declaration of $modconf), but they should work, as
they are fairly obvious patches.

I do not have any devices to really test things, though.

-- 
Julian Andres Klode  - Debian Developer, Ubuntu Member

See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.

Be friendly, do not top-post, and follow RFC 1855 Netiquette.
- If you don't I might ignore you.
diff --git a/debian/changelog b/debian/changelog
index 5654ab5..73672d0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+ndiswrapper (1.57-1+deb7u1) oldstable; urgency=medium
+
+  * Use $KERNELRELEASE as target kernel version (Closes: #693638)
+  * Add BUILT_MODULE_NAME to dkms config file (Closes: #690747)
+  * Only support modprobe.d (Closes: #724890)
+
+ -- Julian Andres Klode j...@debian.org  Fri, 29 May 2015 22:15:51 +0200
+
 ndiswrapper (1.57-1) unstable; urgency=low
 
   * Imported Upstream version 1.57
diff --git a/debian/ndiswrapper-dkms.dkms.in b/debian/ndiswrapper-dkms.dkms.in
index 1053506..8c6a6de 100644
--- a/debian/ndiswrapper-dkms.dkms.in
+++ b/debian/ndiswrapper-dkms.dkms.in
@@ -1,4 +1,5 @@
 PACKAGE_NAME=ndiswrapper
 PACKAGE_VERSION=@VERSION@
 DEST_MODULE_LOCATION[0]=/updates
+BUILT_MODULE_NAME[0]=ndiswrapper
 AUTOINSTALL=yes
diff --git a/debian/patches/Add-support-for-3.x-kernel-versions.patch b/debian/patches/Add-support-for-3.x-kernel-versions.patch
new file mode 100644
index 000..78961c1
--- /dev/null
+++ b/debian/patches/Add-support-for-3.x-kernel-versions.patch
@@ -0,0 +1,40 @@
+From 8e6e357f6c0246dbed8bea55df215a46978152ad Mon Sep 17 00:00:00 2001
+From: Julian Andres Klode j...@debian.org
+Date: Sat, 11 Jan 2014 17:15:39 +0100
+Subject: [PATCH] Hardcode /etc/modprobe.d/ndiswrapper.conf
+
+We do not support modprobe.conf anymore. The code failed to work with
+recent kernels that only export two components in the version,
+so things were broken a bit anyway.
+
+Bug-Debian: http://bugs.debian.org/724890
+---
+ utils/ndiswrapper | 18 +-
+ 1 file changed, 1 insertion(+), 17 deletions(-)
+
+--- a/utils/ndiswrapper
 b/utils/ndiswrapper
+@@ -53,22 +53,7 @@ if (@ARGV  1) {
+ 	exit(1);
+ }
+ 
+-my $modconf;
+-if (`uname -r` =~ /(\d+)\.(\d+)\.(\d+)/) {
+-if ($2  4) {
+-	if (-d /etc/modprobe.d) {
+-	$modconf = /etc/modprobe.d/ndiswrapper.conf;
+-	} else {
+-	$modconf = /etc/modprobe.conf;
+-	}
+-} else {
+-	if (-d /etc/modutils) {
+-	$modconf = /etc/modutils/ndiswrapper;
+-	} else {
+-	$modconf = /etc/modules.conf;
+-	}
+-}
+-}
++my $modconf = /etc/modprobe.d/ndiswrapper.conf;
+ 
+ my $res;
+ my $dbg_file;
diff --git a/debian/patches/ndiswrapper-use-KERNELRELEASE.patch b/debian/patches/ndiswrapper-use-KERNELRELEASE.patch
new file mode 100644
index 000..f1cb786
--- /dev/null
+++ b/debian/patches/ndiswrapper-use-KERNELRELEASE.patch
@@ -0,0 +1,22 @@
+From: Ben Hutchings b...@decadent.org.uk
+Subject: Use $KERNELRELEASE as target kernel version
+Bug-Debian: http://bugs.debian.org/693638
+
+We must not assume that the running kernel version is the target
+version!  DKMS and later Kbuild set $KERNELRELEASE to be the target
+kernel version.
+
+--- a/driver/Makefile
 b/driver/Makefile
+@@ -12,7 +12,11 @@ DISTFILES = \
+ # By default, we try to compile the modules for the currently running
+ # kernel.  But it's the first approximation, as we will re-read the
+ # version from the kernel sources.
++ifeq (,$(KERNELRELEASE))
+ KVERS ?= $(shell uname -r)
++else
++KVERS ?= $(KERNELRELEASE)
++endif
+ 
+ # KBUILD is the path to the Linux kernel build tree.  It is usually the
+ # same as the kernel source tree, except when the kernel was compiled in
diff --git a/debian/patches/series b/debian/patches/series
index 2335794..99ec0d6 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,3 @@
 ndiswrapper-harden.patch
+ndiswrapper-use-KERNELRELEASE.patch
+Add-support-for-3.x-kernel-versions.patch


Bug#717445: pu: package ndiswrapper/1.57-1+deb7u1

2015-04-25 Thread Adam D. Barratt
On Sat, 2014-12-06 at 21:22 +0100, Philipp Kern wrote:
 Control: tag -1 + moreinfo
 
 Hi,
 
 On Sun, Jan 26, 2014 at 02:57:22PM +0100, Julian Andres Klode wrote:
  I'm most likely going to ship the patch below in 1.59-2, it just drops
  the detection and hard-codes the modprobe.d/ndiswrapper.conf file, as
  the other locations are not supported anymore.
 
 if this request still applies, please provide an updated debdiff against 
 stable
 of what you want to ship. Thanks!

Poke.

Regards,

Adam


-- 
To UNSUBSCRIBE, email to debian-release-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/1429983232.18212.33.ca...@adam-barratt.org.uk



Bug#717445: pu: package ndiswrapper/1.57-1+deb7u1

2014-12-06 Thread Philipp Kern
Control: tag -1 + moreinfo

Hi,

On Sun, Jan 26, 2014 at 02:57:22PM +0100, Julian Andres Klode wrote:
 I'm most likely going to ship the patch below in 1.59-2, it just drops
 the detection and hard-codes the modprobe.d/ndiswrapper.conf file, as
 the other locations are not supported anymore.

if this request still applies, please provide an updated debdiff against stable
of what you want to ship. Thanks!

Kind regards
Philipp Kern


signature.asc
Description: Digital signature


Processed: Re: Bug#717445: pu: package ndiswrapper/1.57-1+deb7u1

2014-12-06 Thread Debian Bug Tracking System
Processing control commands:

 tag -1 + moreinfo
Bug #717445 [release.debian.org] pu: package ndiswrapper/1.57-1+deb7u1
Added tag(s) moreinfo.

-- 
717445: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=717445
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems


--
To UNSUBSCRIBE, email to debian-release-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
https://lists.debian.org/handler.s.b717445.141789734823699.transcr...@bugs.debian.org



Bug#717445: pu: package ndiswrapper/1.57-1+deb7u1

2014-01-26 Thread Julian Andres Klode
On Tue, Jan 21, 2014 at 07:08:29PM +0100, intrigeri wrote:
 Hi,
 
 Cyril Brulebois wrote (29 Sep 2013 23:07:34 GMT) :
  + my $modconf;
  + if (`uname -r` =~ /(\d+)\.(\d+)\.(\d+)/) {
  +-if ($2  4) {
  ++if (($2  4) || ($1  2)) {
 
  The regex isn't anchored (^) and wants 3 components. The third one was
  dropped a while ago, but maybe in a version higher than what this module
  supports anyway. Just thought I'd mention it…
 
 Julian, Andreas: ping? It seems to me that Cyril was asking for
 a clarification at least, and quite possibly for a (trivial) regexp
 improvement. Do you still plan to follow-up on this at some point?

I'm most likely going to ship the patch below in 1.59-2, it just drops
the detection and hard-codes the modprobe.d/ndiswrapper.conf file, as
the other locations are not supported anymore.

-- 8 --

From 8e6e357f6c0246dbed8bea55df215a46978152ad Mon Sep 17 00:00:00 2001
From: Julian Andres Klode j...@debian.org
Date: Sat, 11 Jan 2014 17:15:39 +0100
Subject: [PATCH] Hardcode /etc/modprobe.d/ndiswrapper.conf

We do not support modprobe.conf anymore. The code failed to work with
recent kernels that only export two components in the version,
so things were broken a bit anyway.

Bug-Debian: http://bugs.debian.org/724890
---
 utils/ndiswrapper | 18 +-
 1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/utils/ndiswrapper b/utils/ndiswrapper
index 1dd1736..c462934 100755
--- a/utils/ndiswrapper
+++ b/utils/ndiswrapper
@@ -35,7 +35,7 @@ my $confdir = /etc/ndiswrapper;
 my $src_dir;
 my $driver_name;
 my @source_disks_files;
-my $modconf;
+my $modconf = /etc/modprobe.d/ndiswrapper.conf;
 
 my $re_dev_id = ([[:xdigit:]]{4});
 my $re_sub_dev_conf = $re_dev_id:$re_dev_id:$re_dev_id:$re_dev_id .
@@ -970,22 +970,6 @@ if (@ARGV  1) {
exit(1);
 }
 
-if (`uname -r` =~ /(\d+)\.(\d+)\.(\d+)/) {
-if ($2  4) {
-   if (-d /etc/modprobe.d) {
-   $modconf = /etc/modprobe.d/ndiswrapper.conf;
-   } else {
-   $modconf = /etc/modprobe.conf;
-   }
-} else {
-   if (-d /etc/modutils) {
-   $modconf = /etc/modutils/ndiswrapper;
-   } else {
-   $modconf = /etc/modules.conf;
-   }
-}
-}
-
 my $res;
 my $dbg_file;
 
-- 
1.8.5.2


-- 
Julian Andres Klode  - Debian Developer, Ubuntu Member

See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.

Please do not top-post if possible.


-- 
To UNSUBSCRIBE, email to debian-release-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20140126145533.ga18...@debian.org



Bug#717445: pu: package ndiswrapper/1.57-1+deb7u1

2014-01-21 Thread intrigeri
Hi,

Cyril Brulebois wrote (29 Sep 2013 23:07:34 GMT) :
 + my $modconf;
 + if (`uname -r` =~ /(\d+)\.(\d+)\.(\d+)/) {
 +-if ($2  4) {
 ++if (($2  4) || ($1  2)) {

 The regex isn't anchored (^) and wants 3 components. The third one was
 dropped a while ago, but maybe in a version higher than what this module
 supports anyway. Just thought I'd mention it…

Julian, Andreas: ping? It seems to me that Cyril was asking for
a clarification at least, and quite possibly for a (trivial) regexp
improvement. Do you still plan to follow-up on this at some point?

Cheers,
--
  intrigeri
  | GnuPG key @ https://gaffer.ptitcanardnoir.org/intrigeri/intrigeri.asc
  | OTR fingerprint @ https://gaffer.ptitcanardnoir.org/intrigeri/otr.asc


--
To UNSUBSCRIBE, email to debian-release-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/85k3dtky1u@boum.org



Bug#717445: pu: package ndiswrapper/1.57-1+deb7u1

2013-09-29 Thread Cyril Brulebois
Control: tag -1 moreinfo

Julian Andres Klode j...@debian.org (2013-07-21):
 But it might make sense to include the patch:
 
   * Patch userland for 3.X kernels
 
 While there is no bug report for that, it fixes the ndiswrapper
 tool to use modprobe.d and modprobe.conf on 3.X kernels, instead of
 modutils/ and modules.conf.

Speaking of which, that only works for 3.x.y kernels:

 --- /dev/null
 +++ b/debian/patches/Add-support-for-3.x-kernel-versions.patch
 @@ -0,0 +1,28 @@
 +From 71ec9e8a80b74652d660232b560bbe1dfa7915ba Mon Sep 17 00:00:00 2001
 +From: Tim Gardner tim.gard...@canonical.com
 +Date: Mon, 13 Feb 2012 14:19:58 -0700
 +Subject: [PATCH] Add support for 3.x kernel versions
 +
 +As suggested by Kano on Freenode #ubuntu-kernel
 +
 +Signed-off-by: Tim Gardner tim.gard...@canonical.com
 +---
 + utils/ndiswrapper | 2 +-
 + 1 file changed, 1 insertion(+), 1 deletion(-)
 +
 +diff --git a/utils/ndiswrapper b/utils/ndiswrapper
 +index 4bb91f2..ba082a3 100755
 +--- a/utils/ndiswrapper
  b/utils/ndiswrapper
 +@@ -55,7 +55,7 @@ if (@ARGV  1) {
 + 
 + my $modconf;
 + if (`uname -r` =~ /(\d+)\.(\d+)\.(\d+)/) {
 +-if ($2  4) {
 ++if (($2  4) || ($1  2)) {

The regex isn't anchored (^) and wants 3 components. The third one was
dropped a while ago, but maybe in a version higher than what this module
supports anyway. Just thought I'd mention it…

Mraw,
KiBi.


signature.asc
Description: Digital signature


Processed: Re: Bug#717445: pu: package ndiswrapper/1.57-1+deb7u1

2013-09-29 Thread Debian Bug Tracking System
Processing control commands:

 tag -1 moreinfo
Bug #717445 [release.debian.org] pu: package ndiswrapper/1.57-1+deb7u1
Added tag(s) moreinfo.

-- 
717445: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=717445
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems


--
To UNSUBSCRIBE, email to debian-release-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/handler.s.b717445.138049605115744.transcr...@bugs.debian.org



Bug#717445: pu: package ndiswrapper/1.57-1+deb7u1

2013-07-21 Thread Julian Andres Klode
On Sun, Jul 21, 2013 at 12:26:00AM +0200, Andreas Beckmann wrote:
 Package: release.debian.org
 Severity: normal
 Tags: wheezy
 User: release.debian@packages.debian.org
 Usertags: pu
 
 Hi,
 
 there are two bugs affecting ndiswrapper-dkms that should be fixed in
 wheezy:
 * the module fails to build for a kernel that is not running (#693638)
 * dkms throws up during kernel upgrades (#690747)

The second does not make sense. It would only add support for 3.4-3.7,
as ndiswrapper 1.57 does not compile against 3.8. The only supported
of those is 3.4. Backports is already at 3.9, so it seems unlikely
that someone wants to run a 3.4 kernel with ndiswrapper. It works
with 3.2 AFAICT, and that's the reason I did not workaroud this
bug in stable.

For supporting kernels newer than 3.2, the best way seems to be
a backport of 1.58-1 (or -2, once I added a patch for 3.10 
kernels).

But it might make sense to include the patch:

  * Patch userland for 3.X kernels

While there is no bug report for that, it fixes the ndiswrapper
tool to use modprobe.d and modprobe.conf on 3.X kernels, instead of
modutils/ and modules.conf.


 
 The changes are cherry-picked from 1.58-1 and adjusted for 1.57.
 
 I can do a NMU, but I'd prefer a maintainer upload fixing this.
 @jak (Cc:ed): Shall I push my wheezy branch to the git repo?

In general, I prefer git patches against tag/1.57-1 over branches, so I can
review the individual commits. In this case, I'd like some further changes
as mentioned above, so I came up with the attached patch (committed in a
*local* branch).

Please comment.
-- 
Julian Andres Klode  - Debian Developer, Ubuntu Member

See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.
diff --git a/debian/changelog b/debian/changelog
index 5654ab5..acdab74 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+ndiswrapper (1.57-1+deb7u1) stable; urgency=low
+
+  * Use $KERNELRELEASE as target kernel version (Closes: #693638)
+  * Patch userland for 3.X kernels
+
+ -- Julian Andres Klode j...@debian.org  Sun, 21 Jul 2013 14:42:49 +0200
+
 ndiswrapper (1.57-1) unstable; urgency=low
 
   * Imported Upstream version 1.57
diff --git a/debian/patches/Add-support-for-3.x-kernel-versions.patch b/debian/patches/Add-support-for-3.x-kernel-versions.patch
new file mode 100644
index 000..1fea628
--- /dev/null
+++ b/debian/patches/Add-support-for-3.x-kernel-versions.patch
@@ -0,0 +1,28 @@
+From 71ec9e8a80b74652d660232b560bbe1dfa7915ba Mon Sep 17 00:00:00 2001
+From: Tim Gardner tim.gard...@canonical.com
+Date: Mon, 13 Feb 2012 14:19:58 -0700
+Subject: [PATCH] Add support for 3.x kernel versions
+
+As suggested by Kano on Freenode #ubuntu-kernel
+
+Signed-off-by: Tim Gardner tim.gard...@canonical.com
+---
+ utils/ndiswrapper | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/utils/ndiswrapper b/utils/ndiswrapper
+index 4bb91f2..ba082a3 100755
+--- a/utils/ndiswrapper
 b/utils/ndiswrapper
+@@ -55,7 +55,7 @@ if (@ARGV  1) {
+ 
+ my $modconf;
+ if (`uname -r` =~ /(\d+)\.(\d+)\.(\d+)/) {
+-if ($2  4) {
++if (($2  4) || ($1  2)) {
+ 	if (-d /etc/modprobe.d) {
+ 	$modconf = /etc/modprobe.d/ndiswrapper.conf;
+ 	} else {
+-- 
+1.8.3.2
+
diff --git a/debian/patches/ndiswrapper-use-KERNELRELEASE.patch b/debian/patches/ndiswrapper-use-KERNELRELEASE.patch
new file mode 100644
index 000..f1cb786
--- /dev/null
+++ b/debian/patches/ndiswrapper-use-KERNELRELEASE.patch
@@ -0,0 +1,22 @@
+From: Ben Hutchings b...@decadent.org.uk
+Subject: Use $KERNELRELEASE as target kernel version
+Bug-Debian: http://bugs.debian.org/693638
+
+We must not assume that the running kernel version is the target
+version!  DKMS and later Kbuild set $KERNELRELEASE to be the target
+kernel version.
+
+--- a/driver/Makefile
 b/driver/Makefile
+@@ -12,7 +12,11 @@ DISTFILES = \
+ # By default, we try to compile the modules for the currently running
+ # kernel.  But it's the first approximation, as we will re-read the
+ # version from the kernel sources.
++ifeq (,$(KERNELRELEASE))
+ KVERS ?= $(shell uname -r)
++else
++KVERS ?= $(KERNELRELEASE)
++endif
+ 
+ # KBUILD is the path to the Linux kernel build tree.  It is usually the
+ # same as the kernel source tree, except when the kernel was compiled in
diff --git a/debian/patches/series b/debian/patches/series
index 2335794..99ec0d6 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,3 @@
 ndiswrapper-harden.patch
+ndiswrapper-use-KERNELRELEASE.patch
+Add-support-for-3.x-kernel-versions.patch


pgp6UkJo1Y96_.pgp
Description: PGP signature


Bug#717445: pu: package ndiswrapper/1.57-1+deb7u1

2013-07-21 Thread Andreas Beckmann
On 2013-07-21 14:47, Julian Andres Klode wrote:
 On Sun, Jul 21, 2013 at 12:26:00AM +0200, Andreas Beckmann wrote:
 * dkms throws up during kernel upgrades (#690747)
 The second does not make sense. It would only add support for 3.4-3.7,
[...]
 It works
 with 3.2 AFAICT, and that's the reason I did not workaroud this
 bug in stable.
Good. I was afraid it would explode on kernel updates in stable, too.

 In general, I prefer git patches against tag/1.57-1 over branches, so I can
 review the individual commits. In this case, I'd like some further changes
 as mentioned above, so I came up with the attached patch (committed in a
 *local* branch).

That's fine. But since everything is already integrated in your patch,
there is no probably no need to resend my individual commits.

This pu request is yours now :-)


Thanks.

Andreas


-- 
To UNSUBSCRIBE, email to debian-release-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/51ebe010.7050...@debian.org



Bug#717445: pu: package ndiswrapper/1.57-1+deb7u1

2013-07-20 Thread Andreas Beckmann
Package: release.debian.org
Severity: normal
Tags: wheezy
User: release.debian@packages.debian.org
Usertags: pu

Hi,

there are two bugs affecting ndiswrapper-dkms that should be fixed in
wheezy:
* the module fails to build for a kernel that is not running (#693638)
* dkms throws up during kernel upgrades (#690747)

The changes are cherry-picked from 1.58-1 and adjusted for 1.57.

I can do a NMU, but I'd prefer a maintainer upload fixing this.
@jak (Cc:ed): Shall I push my wheezy branch to the git repo?


Andreas
diff -Nru ndiswrapper-1.57/debian/changelog ndiswrapper-1.57/debian/changelog
--- ndiswrapper-1.57/debian/changelog	2012-03-05 16:49:17.0 +0100
+++ ndiswrapper-1.57/debian/changelog	2013-07-21 00:07:16.0 +0200
@@ -1,3 +1,13 @@
+ndiswrapper (1.57-1+deb7u1) wheezy; urgency=low
+
+  * Non-maintainer upload.
+  * Cherry-pick from 1.58-1:
+- Use $KERNELRELEASE as target kernel version (Closes: #693638)
+- Add BUILT_MODULE_NAME to dkms config file (Workaround for: #690747)
+  * ndiswrapper-use-KERNELRELEASE.patch: Adjust for 1.57.
+
+ -- Andreas Beckmann a...@debian.org  Sun, 21 Jul 2013 00:06:37 +0200
+
 ndiswrapper (1.57-1) unstable; urgency=low
 
   * Imported Upstream version 1.57
diff -Nru ndiswrapper-1.57/debian/ndiswrapper-dkms.dkms.in ndiswrapper-1.57/debian/ndiswrapper-dkms.dkms.in
--- ndiswrapper-1.57/debian/ndiswrapper-dkms.dkms.in	2012-03-05 16:49:17.0 +0100
+++ ndiswrapper-1.57/debian/ndiswrapper-dkms.dkms.in	2013-07-20 23:55:18.0 +0200
@@ -1,4 +1,5 @@
 PACKAGE_NAME=ndiswrapper
 PACKAGE_VERSION=@VERSION@
 DEST_MODULE_LOCATION[0]=/updates
+BUILT_MODULE_NAME[0]=ndiswrapper
 AUTOINSTALL=yes
diff -Nru ndiswrapper-1.57/debian/patches/ndiswrapper-use-KERNELRELEASE.patch ndiswrapper-1.57/debian/patches/ndiswrapper-use-KERNELRELEASE.patch
--- ndiswrapper-1.57/debian/patches/ndiswrapper-use-KERNELRELEASE.patch	1970-01-01 01:00:00.0 +0100
+++ ndiswrapper-1.57/debian/patches/ndiswrapper-use-KERNELRELEASE.patch	2013-07-21 00:05:26.0 +0200
@@ -0,0 +1,22 @@
+From: Ben Hutchings b...@decadent.org.uk
+Subject: Use $KERNELRELEASE as target kernel version
+Bug-Debian: http://bugs.debian.org/693638
+
+We must not assume that the running kernel version is the target
+version!  DKMS and later Kbuild set $KERNELRELEASE to be the target
+kernel version.
+
+--- a/driver/Makefile
 b/driver/Makefile
+@@ -12,7 +12,11 @@
+ # By default, we try to compile the modules for the currently running
+ # kernel.  But it's the first approximation, as we will re-read the
+ # version from the kernel sources.
++ifeq (,$(KERNELRELEASE))
+ KVERS ?= $(shell uname -r)
++else
++KVERS ?= $(KERNELRELEASE)
++endif
+ 
+ # KBUILD is the path to the Linux kernel build tree.  It is usually the
+ # same as the kernel source tree, except when the kernel was compiled in
diff -Nru ndiswrapper-1.57/debian/patches/series ndiswrapper-1.57/debian/patches/series
--- ndiswrapper-1.57/debian/patches/series	2012-03-05 16:49:17.0 +0100
+++ ndiswrapper-1.57/debian/patches/series	2013-07-20 23:55:18.0 +0200
@@ -1 +1,2 @@
 ndiswrapper-harden.patch
+ndiswrapper-use-KERNELRELEASE.patch