kmod-dma-buf: fix build with external kernel
authorStijn Tintel <[email protected]>
Wed, 12 Dec 2018 20:00:44 +0000 (22:00 +0200)
committerJo-Philipp Wich <[email protected]>
Tue, 18 Dec 2018 16:48:26 +0000 (17:48 +0100)
In hack/904-debloat_dma_buf.patch, DMA_SHARED_BUFFER is changed from
bool to tristate. As this patch is not applied to external kernel
sources, build fails if kmod-dma-buf is enabled. Fix this by only
including the module file if CONFIG_EXTERNAL_KERNEL_TREE and
CONFIG_KERNEL_GIT_CLONE_URI are not enabled.

Signed-off-by: Stijn Tintel <[email protected]>
(backported from bcb859235328c9de0a2e0966785f5ca61419290c)

package/kernel/linux/modules/other.mk

index 32694593979d70a6ce9f14b7b1941377303ef9e1..958e818da14b02345168934b81537ef8da8e819a 100644 (file)
@@ -129,7 +129,11 @@ define KernelPackage/dma-buf
   TITLE:=DMA shared buffer support
   HIDDEN:=1
   KCONFIG:=CONFIG_DMA_SHARED_BUFFER
-  FILES:=$(LINUX_DIR)/drivers/dma-buf/dma-shared-buffer.ko
+  ifeq ($(strip $(CONFIG_EXTERNAL_KERNEL_TREE)),"")
+    ifeq ($(strip $(CONFIG_KERNEL_GIT_CLONE_URI)),"")
+      FILES:=$(LINUX_DIR)/drivers/dma-buf/dma-shared-buffer.ko
+    endif
+  endif
   AUTOLOAD:=$(call AutoLoad,20,dma-shared-buffer)
 endef
 $(eval $(call KernelPackage,dma-buf))