mirror of https://github.com/dynup/kpatch
Makefile: determine kernel release in Makefile
Don't assume we are building for the current kernel. In addition print out a proper package necessary for building the module. Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
This commit is contained in:
parent
06ad01b784
commit
3c8f5f7bfa
|
@ -1,9 +1,10 @@
|
|||
# make rules
|
||||
KPATCH_BUILD ?= /lib/modules/$(shell uname -r)/build
|
||||
KERNELRELEASE := $(lastword $(subst /, , $(dir $(KPATCH_BUILD))))
|
||||
THISDIR := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
|
||||
|
||||
ifeq ($(wildcard $(KPATCH_BUILD)),)
|
||||
$(error $(KPATCH_BUILD) doesn\'t exist. Try installing the kernel-devel-$(shell uname -r) RPM or linux-image-$(shell uname -r)-dbg DEB.)
|
||||
$(error $(KPATCH_BUILD) doesn\'t exist. Try installing the kernel-devel-$(KERNELRELEASE) RPM or linux-headers-$(KERNELRELEASE) DEB.)
|
||||
endif
|
||||
|
||||
KPATCH_MAKE = $(MAKE) -C $(KPATCH_BUILD) M=$(THISDIR)
|
||||
|
|
Loading…
Reference in New Issue