Handle target path located under target/linux/feeds/
Prasun Maiti
prasunmaiti87 at gmail.com
Mon May 30 22:23:33 PDT 2022
When we are installing targets to target/linux/feeds,
BOARD is not located under target/linux/
So, we need to handle this scenario taking proper target path
Signed-off-by: Prasun Maiti <prasunmaiti87 at gmail.com>
---
config/Config-images.in | 1 +
include/target.mk | 3 +++
package/kernel/linux/Makefile | 4 ++--
target/linux/Makefile | 2 +-
4 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/config/Config-images.in b/config/Config-images.in
index dcd7575..832e672 100644
--- a/config/Config-images.in
+++ b/config/Config-images.in
@@ -286,6 +286,7 @@ menu "Target Images"
comment "Image Options"
source "target/linux/*/image/Config.in"
+ source "target/linux/feeds/*/image/Config.in"
config TARGET_KERNEL_PARTSIZE
int "Kernel partition size (in MiB)"
diff --git a/include/target.mk b/include/target.mk
index f595de6..8917f71 100644
--- a/include/target.mk
+++ b/include/target.mk
@@ -70,6 +70,9 @@ endif
target_conf=$(subst .,_,$(subst -,_,$(subst /,_,$(1))))
ifeq ($(DUMP),)
PLATFORM_DIR:=$(TOPDIR)/target/linux/$(BOARD)
+ ifeq ("$(wildcard $(PLATFORM_DIR))", "")
+ PLATFORM_DIR:=$(TOPDIR)/target/linux/feeds/$(BOARD)
+ endif
SUBTARGET:=$(strip $(foreach subdir,$(patsubst $(PLATFORM_DIR)/%/target.mk,%,$(wildcard $(PLATFORM_DIR)/*/target.mk)),$(if $(CONFIG_TARGET_$(call target_conf,$(BOARD)_$(subdir))),$(subdir))))
else
PLATFORM_DIR:=${CURDIR}
diff --git a/package/kernel/linux/Makefile b/package/kernel/linux/Makefile
index 9fa68d7..0cb2911 100644
--- a/package/kernel/linux/Makefile
+++ b/package/kernel/linux/Makefile
@@ -12,7 +12,7 @@ PKG_NAME:=kernel
PKG_FLAGS:=hold
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/packages
-SCAN_DEPS=modules/*.mk $(TOPDIR)/target/linux/*/modules.mk $(TOPDIR)/include/netfilter.mk
+SCAN_DEPS=modules/*.mk $(patsubst %/$(BOARD),%,$(PLATFORM_DIR))/*/modules.mk $(TOPDIR)/include/netfilter.mk
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=
@@ -63,4 +63,4 @@ endef
$(eval $(if $(DUMP),,$(call BuildPackage,kernel)))
include $(sort $(wildcard ./modules/*.mk))
--include $(TOPDIR)/target/linux/*/modules.mk
+-include $(patsubst %/$(BOARD),%,$(PLATFORM_DIR))/*/modules.mk
diff --git a/target/linux/Makefile b/target/linux/Makefile
index a939d42..a6ea788 100644
--- a/target/linux/Makefile
+++ b/target/linux/Makefile
@@ -8,4 +8,4 @@ include $(INCLUDE_DIR)/target.mk
export TARGET_BUILD=1
prereq clean download prepare compile install oldconfig menuconfig nconfig xconfig update refresh: FORCE
- @+$(NO_TRACE_MAKE) -C $(BOARD) $@
+ @+$(NO_TRACE_MAKE) -C $(PLATFORM_DIR) $@
--
2.17.1
More information about the openwrt-devel
mailing list