mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] rules/kernel.make: Add a choice to let kernel build dtbs.
@ 2021-09-08  8:36 Christian Melki
  0 siblings, 0 replies; only message in thread
From: Christian Melki @ 2021-09-08  8:36 UTC (permalink / raw)
  To: ptxdist

Instead of having Ptxdist build dtbs, let the kernel do it.
Some projects have a rather complicated set of includes and partly
out-of-tree dts structures (Nvidia?), so it is easier to let
the vendor kernel do it. This is similar to what Yocto and Buildroot can do.
The high level find might seem a bit excessive, but some vendor kernels
place built dtbs in rather strange places.
---
 platforms/kernel.in |  9 +++++++++
 rules/kernel.make   | 10 +++++++++-
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/platforms/kernel.in b/platforms/kernel.in
index ff3cc8df4..1f867e548 100644
--- a/platforms/kernel.in
+++ b/platforms/kernel.in
@@ -180,6 +180,15 @@ menuconfig KERNEL_DTB
 
 if KERNEL_DTB
 
+config KERNEL_BUILD_DTBS
+	bool "Let kernel build dtbs"
+	help
+	  Instead of letting ptxdist compile a specified DTS into a DTB,
+	  it can call upon the kernel make to compile all dtbs that are
+	  relevant for your platforms.
+	  Ptxdist will only copy the resulting dtb files that are
+	  specified in KERNEL_DTS.
+
 config KERNEL_DTS_PATH
 	string "path to source dts file"
 	default "${PTXDIST_PLATFORMCONFIG_SUBDIR}/dts:${KERNEL_DIR}/arch/${GENERIC_KERNEL_ARCH}/boot/dts"
diff --git a/rules/kernel.make b/rules/kernel.make
index 9caff6779..63d2e1c9c 100644
--- a/rules/kernel.make
+++ b/rules/kernel.make
@@ -191,7 +191,8 @@ KERNEL_MAKE_OPT		= \
 	$(call kernel/deprecated, KERNEL_MAKE_OPT) \
 	$(KERNEL_SHARED_OPT) \
 	$(KERNEL_IMAGE) \
-	$(call ptx/ifdef, PTXCONF_KERNEL_MODULES,modules)
+	$(call ptx/ifdef, PTXCONF_KERNEL_MODULES,modules) \
+	$(call ptx/ifdef, PTXCONF_KERNEL_BUILD_DTBS,dtbs)
 
 KERNEL_TOOL_PERF_OPTS	:= \
 	-C $(KERNEL_DIR)/tools/perf \
@@ -263,7 +264,14 @@ $(STATEDIR)/kernel.install:
 ifdef PTXCONF_KERNEL_MODULES_INSTALL
 	@$(call world/install, KERNEL)
 endif
+ifdef PTXCONF_KERNEL_BUILD_DTBS
+	@mkdir -p $(KERNEL_PKGDIR)/boot
+	@$(foreach dtb, $(KERNEL_DTB_FILES), \
+		echo -e "Installing $(dtb) ...\n"$(ptx/nl) \
+		find $(KERNEL_BUILD_DIR) -name $(dtb) -exec cp "{}" $(KERNEL_PKGDIR)/boot/$(dtb) \;)
+else
 	@$(call world/dtb, KERNEL)
+endif
 	@$(call touch)
 
 # ----------------------------------------------------------------------------
-- 
2.30.2


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-09-08  8:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-08  8:36 [ptxdist] [PATCH] rules/kernel.make: Add a choice to let kernel build dtbs Christian Melki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox