diff --git a/make/linux-kernel.mk b/make/linux-kernel.mk index 7fd1fc85..5ab3057f 100644 --- a/make/linux-kernel.mk +++ b/make/linux-kernel.mk @@ -226,6 +226,11 @@ $(DL_DIR)/$(VMLINUZ_INITRD_SOURCE): # ----------------------------------------------------------------------------- +LINUX_KERNEL_MAKE_VARS = \ + $(KERNEL_MAKE_VARS) \ + INSTALL_MOD_PATH=$(KERNEL_MODULES_DIR) \ + INSTALL_HDR_PATH=$(KERNEL_HEADERS_DIR) + kernel.do_checkout: $(SOURCE_DIR)/$(NI_LINUX_KERNEL) $(CD) $(SOURCE_DIR)/$(NI_LINUX_KERNEL); \ git checkout $(KERNEL_BRANCH) @@ -237,7 +242,7 @@ kernel.do_prepare: | $(DEPS_DIR) $(BUILD_DIR) $(MKDIR)/$(KERNEL_OBJ) $(MKDIR)/$(KERNEL_MODULES) $(INSTALL_DATA) $(KERNEL_CONFIG) $(KERNEL_OBJ_DIR)/.config - $(MAKE) -C $(BUILD_DIR)/$(KERNEL_DIR) $(KERNEL_MAKE_VARS) silentoldconfig + $(MAKE) -C $(BUILD_DIR)/$(KERNEL_DIR) $(LINUX_KERNEL_MAKE_VARS) silentoldconfig ifeq ($(BOXMODEL),$(filter $(BOXMODEL),hd51 bre2ze4k h7 hd60 hd61 multiboxse)) $(INSTALL_DATA) $(PKG_FILES_DIR)/initramfs-subdirboot.cpio.gz $(KERNEL_OBJ_DIR) endif @@ -258,8 +263,8 @@ kernel.do_prepare_tar: $(DL_DIR)/$(KERNEL_SOURCE) $(LINUX_FIX_YYLLOC) kernel.do_compile: kernel.do_prepare - $(MAKE) -C $(BUILD_DIR)/$(KERNEL_DIR) $(KERNEL_MAKE_VARS) modules $(KERNEL_MAKE_TARGETS) - $(MAKE) -C $(BUILD_DIR)/$(KERNEL_DIR) $(KERNEL_MAKE_VARS) modules_install + $(MAKE) -C $(BUILD_DIR)/$(KERNEL_DIR) $(LINUX_KERNEL_MAKE_VARS) modules $(KERNEL_MAKE_TARGETS) + $(MAKE) -C $(BUILD_DIR)/$(KERNEL_DIR) $(LINUX_KERNEL_MAKE_VARS) modules_install ifneq ($(KERNEL_DTB),$(empty)) cat $(KERNEL_ZIMAGE) $(KERNEL_DTB) > $(KERNEL_ZIMAGE_DTB) endif @@ -372,7 +377,7 @@ vmlinuz-initrd: $(DL_DIR)/$(VMLINUZ_INITRD_SOURCE) kernel-headers: $(KERNEL_HEADERS_DIR) $(KERNEL_HEADERS_DIR): kernel.do_prepare - $(MAKE) -C $(BUILD_DIR)/$(KERNEL_DIR) $(KERNEL_MAKE_VARS) headers_install + $(MAKE) -C $(BUILD_DIR)/$(KERNEL_DIR) $(LINUX_KERNEL_MAKE_VARS) headers_install kernel-tarball: $(KERNEL_TARBALL) $(KERNEL_TARBALL): kernel.do_prepare diff --git a/package/pkg-kernel-module.mk b/package/pkg-kernel-module.mk index 423d9a68..fe60955d 100644 --- a/package/pkg-kernel-module.mk +++ b/package/pkg-kernel-module.mk @@ -7,8 +7,6 @@ KERNEL_MAKE_VARS = \ ARCH=$(TARGET_ARCH) \ CROSS_COMPILE=$(TARGET_CROSS) \ - INSTALL_MOD_PATH=$(KERNEL_MODULES_DIR) \ - INSTALL_HDR_PATH=$(KERNEL_HEADERS_DIR) \ LOCALVERSION= \ O=$(KERNEL_OBJ_DIR) @@ -17,11 +15,17 @@ KERNEL_MAKE_VARS += \ KVER=$(KERNEL_VERSION) \ KSRC=$(BUILD_DIR)/$(KERNEL_DIR) +KERNEL_MODULE_MAKE_VARS = \ + $(KERNEL_MAKE_VARS) \ + INSTALL_MOD_PATH=$(TARGET_DIR) \ + INSTALL_HDR_PATH=$(TARGET_DIR) + define KERNEL_MODULE_BUILD_CMDS_DEFAULT $(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \ $(TARGET_MAKE_ENV) $($(PKG)_MAKE_ENV) \ $($(PKG)_MAKE) $($(PKG)_MAKE_ARGS) \ - $($(PKG)_MAKE_OPTS) $(KERNEL_MAKE_VARS) + $(KERNEL_MODULE_MAKE_VARS) \ + $($(PKG)_MAKE_OPTS) endef define KERNEL_MODULE_BUILD @@ -35,7 +39,8 @@ define KERNEL_MODULE_INSTALL_CMDS_DEFAULT $(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \ $(TARGET_MAKE_ENV) $($(PKG)_MAKE_INSTALL_ENV) \ $($(PKG)_MAKE_INSTALL) $($(PKG)_MAKE_INSTALL_ARGS) \ - $($(PKG)_MAKE_INSTALL_OPTS) $(KERNEL_MAKE_VARS) + $(KERNEL_MODULE_MAKE_VARS) \ + $($(PKG)_MAKE_INSTALL_OPTS) endef define KERNEL_MODULE_INSTALL