Skip to contentSkip to conversation

linux: install dtc (device tree compiler) as host tool if selected

PATCH Superseded Thomas De Schampheleire 1 participant 2 messages Apr 6, 2012 – May 4, 2012

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 linux: install dtc (device tree compiler) as host tool if selected

Having dtc as a host tool can be useful for users that have a custom boot scenario where the device tree is not embedded in the kernel.

---
v2: remove old parameters to GENTARGETS call, sorry.
v3: rename Config.in.host and depend on Linux (comments Arnout)
v4: no need for a separate package, just put the logic in linux.mk
(suggestion of Alexandre Pereira da Silva, thanks!)

 linux/linux.mk |  10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
linux/linux.mk +10 -0
@@ -183,6 +183,15 @@ define LINUX_INSTALL_KERNEL_IMAGE_TO_TAR
 endef
 endif
 
+
+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/dtc ;	\
+	fi
+endef
+
+
 define LINUX_INSTALL_IMAGES_CMDS
 	cp $(LINUX_IMAGE_PATH) $(BINARIES_DIR)
 endef
@@ -197,6 +206,7 @@ define LINUX_INSTALL_TARGET_CMDS
 		rm -f $(TARGET_DIR)/lib/modules/$(LINUX_VERSION_PROBED)/build ;		\
 		rm -f $(TARGET_DIR)/lib/modules/$(LINUX_VERSION_PROBED)/source ;	\
 	fi
+	$(LINUX_INSTALL_HOST_TOOLS)
 endef
 
 include linux/linux-ext-*.mk
#1 lore raw

PATCH v4 1/1 linux: install dtc (device tree compiler) as host tool if selected

Quoted 40 lines · Thomas De Schampheleire

Having dtc as a host tool can be useful for users that have a custom boot scenario where the device tree is not embedded in the kernel.

---
v2: remove old parameters to GENTARGETS call, sorry.
v3: rename Config.in.host and depend on Linux (comments Arnout)
v4: no need for a separate package, just put the logic in linux.mk ? ?(suggestion of Alexandre Pereira da Silva, thanks!)

?linux/linux.mk | ?10 ++++++++++
?1 files changed, 10 insertions(+), 0 deletions(-)

linux/linux.mk +0 -0
@@ -183,6 +183,15 @@ define LINUX_INSTALL_KERNEL_IMAGE_TO_TAR

?endef
?endif

linux/linux.mk +9 -0
+
+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/dtc ; ? \
+ ? ? ? fi
+endef
+
+

?define LINUX_INSTALL_IMAGES_CMDS
? ? ? ?cp $(LINUX_IMAGE_PATH) $(BINARIES_DIR)
?endef

linux/linux.mk +0 -0
@@ -197,6 +206,7 @@ define LINUX_INSTALL_TARGET_CMDS
 ? ? ? ? ? ? ? ?rm -f $(TARGET_DIR)/lib/modules/$(LINUX_VERSION_PROBED)/build ; ? ? ? ? \
 ? ? ? ? ? ? ? ?rm -f $(TARGET_DIR)/lib/modules/$(LINUX_VERSION_PROBED)/source ; ? ? ? ?\

? ? ? ?fi
+ ? ? ? $(LINUX_INSTALL_HOST_TOOLS)
?endef

Quoted 1 line

?include linux/linux-ext-*.mk

bump