Skip to content

Commit

Permalink
kmod: Fix install path
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
rosslagerwall committed May 6, 2016
1 parent 71afb17 commit 075c474
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions kmod/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
include ../Makefile.inc
KPATCH_BUILD ?= /lib/modules/$(shell uname -r)/build
KERNELRELEASE := $(lastword $(subst /, , $(dir $(KPATCH_BUILD))))

all: clean
ifeq ($(BUILDMOD),yes)
Expand All @@ -7,9 +9,9 @@ endif

install:
ifeq ($(BUILDMOD),yes)
$(INSTALL) -d $(MODULESDIR)/$(shell uname -r)
$(INSTALL) -m 644 core/kpatch.ko $(MODULESDIR)/$(shell uname -r)
$(INSTALL) -m 644 core/Module.symvers $(MODULESDIR)/$(shell uname -r)
$(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
Expand Down

0 comments on commit 075c474

Please sign in to comment.