Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2 1/1] linux: Make dtc install step more reliable
@ 2018-11-13 15:50 Andreas Naumann
  2018-11-23 21:29 ` Thomas Petazzoni
  2018-11-26 17:48 ` Peter Korsgaard
  0 siblings, 2 replies; 6+ messages in thread
From: Andreas Naumann @ 2018-11-13 15:50 UTC (permalink / raw)
  To: buildroot

Checking for the existence of the dtc binary built by the
non-dependent dtc package may cause instable behaviour when giving more
freedom on the order of how the packages are built (parallelization).

In addidion, when moving to per-package host/target method, the check
would always trigger in the isolated host, leading to linux-dtc always
being installed as dtc.
This in turn may lead to undesired overwriting of the real host-dtc binary
when finally assembling the global host dir.

Thus rework the linux-dtc install condition to be defined by configuration
rather than compile time order.

Signed-off-by: Andreas Naumann <anaumann@ultratronik.de>
---
Changes v1 -> v2: 
  - simplified by direct usage of make conditional almost as suggested by
    Arnout (test revealed that an additinal comma was needed for correct logic)
---
 linux/linux.mk | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/linux/linux.mk b/linux/linux.mk
index f2bca17328..66e11d2ab4 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -465,9 +465,7 @@ define LINUX_INSTALL_HOST_TOOLS
 	# Installing dtc (device tree compiler) as host tool, if selected
 	if grep -q "CONFIG_DTC=y" $(@D)/.config; then \
 		$(INSTALL) -D -m 0755 $(@D)/scripts/dtc/dtc $(HOST_DIR)/bin/linux-dtc ; \
-		if [ ! -e $(HOST_DIR)/bin/dtc ]; then \
-			ln -sf linux-dtc $(HOST_DIR)/bin/dtc ; \
-		fi \
+		$(if $(BR2_PACKAGE_HOST_DTC),,ln -sf linux-dtc $(HOST_DIR)/bin/dtc;) \
 	fi
 endef
 
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-11-26 17:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-13 15:50 [Buildroot] [PATCH v2 1/1] linux: Make dtc install step more reliable Andreas Naumann
2018-11-23 21:29 ` Thomas Petazzoni
2018-11-26  7:50   ` Andreas Naumann
2018-11-26  7:58     ` Thomas Petazzoni
2018-11-26  8:14       ` Andreas Naumann
2018-11-26 17:48 ` Peter Korsgaard

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