From f92374a3e3b1952f6ee882872b7b74686ccfc940 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Tue, 8 Oct 2013 20:47:16 +0300 Subject: [PATCH 1/5] Use $KERNELRELEASE as target kernel version 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. --- Taken from git://anonscm.debian.org/collab-maint/ndiswrapper.git debian/patches/ndiswrapper-use-KERNELRELEASE.patch Signed-off-by: Andrey Utkin --- driver/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/driver/Makefile b/driver/Makefile index fd5cebf..37dda9c 100644 --- 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_UNAME ?= $(shell uname -r) +else +KVERS_UNAME ?= $(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 -- 1.8.4