Signed-off-by: Samuel Martin <[email protected]>
---
 backport/Makefile | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/backport/Makefile b/backport/Makefile
index 3ff74d9..e9256e4 100644
--- a/backport/Makefile
+++ b/backport/Makefile
@@ -12,10 +12,18 @@ KMODDIR ?= updates
 ifneq ($(origin KROOT), undefined)
 KMODPATH_ARG := "INSTALL_MOD_PATH=$(KROOT)"
 else
-KLIB := /lib/modules/$(shell uname -r)/
 KROOT := /
 KMODPATH_ARG :=
 endif
+
+ifneq ($(origin KLIB_BUILD), undefined)
+KVERSION := $(shell $(MAKE) -C $(KLIB_BUILD) $(if $(ARCH),ARCH=$(ARCH)) \
+       --no-print-directory -s kernelrelease)
+else
+KVERSION := $(shell uname -r)
+endif
+
+KLIB := $(KROOT)/lib/modules/$(KVERSION)
 KLIB_BUILD ?= $(KLIB)/build/
 KERNEL_CONFIG := $(KLIB_BUILD)/.config
 KERNEL_MAKEFILE := $(KLIB_BUILD)/Makefile
-- 
1.9.2

--
To unsubscribe from this list: send the line "unsubscribe backports" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to