mirror of
https://github.com/dynup/kpatch
synced 2024-12-22 05:10:01 +00:00
075c4745f0
When building against a different kernel from the one that is currently running, install the kernel module to a directory based on the version of the target kernel rather than the currently running kernel. Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
29 lines
643 B
Makefile
29 lines
643 B
Makefile
include ../Makefile.inc
|
|
KPATCH_BUILD ?= /lib/modules/$(shell uname -r)/build
|
|
KERNELRELEASE := $(lastword $(subst /, , $(dir $(KPATCH_BUILD))))
|
|
|
|
all: clean
|
|
ifeq ($(BUILDMOD),yes)
|
|
$(MAKE) -C core
|
|
endif
|
|
|
|
install:
|
|
ifeq ($(BUILDMOD),yes)
|
|
$(INSTALL) -d $(MODULESDIR)/$(KERNELRELEASE)
|
|
$(INSTALL) -m 644 core/kpatch.ko $(MODULESDIR)/$(KERNELRELEASE)
|
|
$(INSTALL) -m 644 core/Module.symvers $(MODULESDIR)/$(KERNELRELEASE)
|
|
endif
|
|
$(INSTALL) -d $(DATADIR)/patch
|
|
$(INSTALL) -m 644 patch/* $(DATADIR)/patch
|
|
|
|
uninstall:
|
|
ifeq ($(BUILDMOD),yes)
|
|
$(RM) -R $(MODULESDIR)
|
|
endif
|
|
$(RM) -R $(DATADIR)
|
|
|
|
clean:
|
|
ifeq ($(BUILDMOD),yes)
|
|
$(MAKE) -C core clean
|
|
endif
|