linux: install dtc (device tree compiler) as host tool if selected
authorThomas De Schampheleire <patrickdepinguin+buildroot@gmail.com>
Tue, 15 May 2012 08:18:25 +0000 (08:18 +0000)
committerPeter Korsgaard <jacmet@sunsite.dk>
Tue, 15 May 2012 20:59:20 +0000 (22:59 +0200)
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.

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
linux/linux.mk

index 34f86236c5df4b37b1a9e5f99acdaa3058d58c5c..f165dda50c6dbedf1f344e3eff9ee9b7ef2dbde3 100644 (file)
@@ -183,6 +183,15 @@ define LINUX_INSTALL_KERNEL_IMAGE_TO_TARGET
 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