All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] linux: provide symlink dtc->linux-dtc is there is no dtc yet
@ 2016-01-08 11:30 Thomas De Schampheleire
  2016-01-09  0:52 ` Arnout Vandecappelle
  2016-05-31 20:50 ` Thomas Petazzoni
  0 siblings, 2 replies; 6+ messages in thread
From: Thomas De Schampheleire @ 2016-01-08 11:30 UTC (permalink / raw)
  To: buildroot

From: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>

Commit ab74e09eb4e28dab8bed8d783c5f0464d39a32e7 renamed the dtc host tool
provided by linux to linux-dtc to avoid clashes with the dtc host tool
provided by host-dtc.

However, external scripting may well rely on the existence of a device tree
compiler as $(HOST_DIR)/usr/bin/dtc, regardless of its source. Changing
these external scripts to use linux-dtc means that the scripts need to be
aware of the buildroot release they are working with, which is not very
nice.

Add a symlink dtc->linux-dtc when no $(HOST_DIR)/usr/bin/dtc is present.
When host-dtc is not enabled, the end result will be dtc and
linux-dtc representing the same thing.
When host-dtc is enabled, either it is build before linux and no symlink
is created at any time, or it is build after linux, and the 'install'
command in host-dtc will overwrite the symlink with a proper dtc. In both
cases, the end result will be dtc and linux-dtc representing a different
thing.

Cc: Peter Korsgaard <peter@korsgaard.com>
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
---
 linux/linux.mk | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/linux/linux.mk b/linux/linux.mk
index 045294b..f5c629c 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -339,6 +339,9 @@ 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)/usr/bin/linux-dtc ;	\
+		if [ ! -e $(HOST_DIR)/usr/bin/dtc ]; then	\
+			ln -sf linux-dtc $(HOST_DIR)/usr/bin/dtc ;	\
+		fi	\
 	fi
 endef
 
-- 
1.9.5

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

end of thread, other threads:[~2016-06-01 14:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-08 11:30 [Buildroot] [PATCH] linux: provide symlink dtc->linux-dtc is there is no dtc yet Thomas De Schampheleire
2016-01-09  0:52 ` Arnout Vandecappelle
2016-01-11  9:07   ` Thomas De Schampheleire
2016-05-31 20:50 ` Thomas Petazzoni
2016-06-01 14:41   ` Arnout Vandecappelle
2016-06-01 14:49     ` Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.