diff mbox series

Handle target path located under target/linux/feeds/

Message ID 20220531052333.797-1-prasunmaiti87@gmail.com
State Not Applicable
Delegated to: Petr Štetiar
Headers show
Series Handle target path located under target/linux/feeds/ | expand

Commit Message

Prasun Maiti May 31, 2022, 5:23 a.m. UTC
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@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(-)

Comments

Hauke Mehrtens Oct. 3, 2022, 3:24 p.m. UTC | #1
On 5/31/22 07:23, Prasun Maiti wrote:
> 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

Does this change also fix your problem?
https://git.openwrt.org/3a8825ad6acbf18b2b472ace56be58868af78be7
It was also backported to 22.03:
https://git.openwrt.org/25d8b9cad6f141104a1065880efe21b8c292d8c6

If this is not solving your problem please explain in more detail in the 
commit message what problem you want to solve, for me it is not really 
clear from the commit message.

Hauke
Hauke Mehrtens Oct. 3, 2022, 5:39 p.m. UTC | #2
On 10/3/22 17:24, Hauke Mehrtens wrote:
> On 5/31/22 07:23, Prasun Maiti wrote:
>> 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
> 
> Does this change also fix your problem?
> https://git.openwrt.org/3a8825ad6acbf18b2b472ace56be58868af78be7
> It was also backported to 22.03:
> https://git.openwrt.org/25d8b9cad6f141104a1065880efe21b8c292d8c6
> 
> If this is not solving your problem please explain in more detail in the 
> commit message what problem you want to solve, for me it is not really 
> clear from the commit message.
> 
> Hauke

This commit also looks related to your problem:
https://git.openwrt.org/00094efec33f07c9dc16cce23be492430c40b3cc

Hauke
Prasun Maiti Oct. 12, 2022, 11:33 a.m. UTC | #3
Hi Felix Fietkau,

Was there any mistake from my end while sending this patch? Due to the
fact that this patch was not reviewed?
But i can see still this patch is needed -
https://patchwork.ozlabs.org/project/openwrt/patch/20221012083243.1123-1-prasunmaiti87@gmail.com/

Thanks,
Prasun

Thanks,
Prasun


On Mon, Oct 3, 2022 at 11:09 PM Hauke Mehrtens <hauke@hauke-m.de> wrote:
>
> On 10/3/22 17:24, Hauke Mehrtens wrote:
> > On 5/31/22 07:23, Prasun Maiti wrote:
> >> 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
> >
> > Does this change also fix your problem?
> > https://git.openwrt.org/3a8825ad6acbf18b2b472ace56be58868af78be7
> > It was also backported to 22.03:
> > https://git.openwrt.org/25d8b9cad6f141104a1065880efe21b8c292d8c6
> >
> > If this is not solving your problem please explain in more detail in the
> > commit message what problem you want to solve, for me it is not really
> > clear from the commit message.
> >
> > Hauke
>
> This commit also looks related to your problem:
> https://git.openwrt.org/00094efec33f07c9dc16cce23be492430c40b3cc
>
> Hauke
diff mbox series

Patch

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) $@