[Buildroot] [PATCH] Add support for Flattened Image Trees

Yegor Yefremov yegorslists at googlemail.com
Mon Sep 1 20:53:04 UTC 2014


This patch provides an option to specify a FIT source
file (*.its), that will usually be stored in a board directory,
and the resulting blob file name (*.itb).

Signed-off-by: Yegor Yefremov <yegorslists at googlemail.com>
---
 linux/Config.in | 21 +++++++++++++++++++++
 linux/linux.mk  | 12 ++++++++++++
 2 files changed, 33 insertions(+)

diff --git a/linux/Config.in b/linux/Config.in
index 611dcf2..6f28bc0 100644
--- a/linux/Config.in
+++ b/linux/Config.in
@@ -332,6 +332,27 @@ config BR2_LINUX_KERNEL_CUSTOM_DTS_PATH
 
 endif
 
+config BR2_LINUX_KERNEL_FIT_SUPPORT
+	bool "Flattened Image Tree support"
+	help
+	  Compile a flattened image tree source into a lattened
+	  image tree blob. Select the its file to compile in the
+	  options below.
+
+if BR2_LINUX_KERNEL_FIT_SUPPORT
+
+config BR2_LINUX_KERNEL_FIT_PATH
+	string "Flattened Image Tree Source file path"
+	help
+	  Path to the image tree tree source files.
+
+config BR2_LINUX_KERNEL_FIT_BLOB_NAME
+	string "Flattened Image Tree blob file name"
+	help
+	  File name for the resulting FIT blob.
+
+endif
+
 config BR2_LINUX_KERNEL_INSTALL_TARGET
 	bool "Install kernel image to /boot in target"
 	depends on !BR2_TARGET_ROOTFS_INITRAMFS
diff --git a/linux/linux.mk b/linux/linux.mk
index 2fb7437..6f1031d 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -260,6 +260,16 @@ LINUX_APPEND_DTB += $(sep) MKIMAGE_ARGS=`$(MKIMAGE) -l $(LINUX_IMAGE_PATH) |\
 endif
 endif
 
+ifeq ($(BR2_LINUX_KERNEL_FIT_SUPPORT),y)
+define LINUX_BUILD_ITB
+	cp $(BR2_LINUX_KERNEL_FIT_PATH) $(BINARIES_DIR)
+	mkimage -f $(BINARIES_DIR)/`basename $(BR2_LINUX_KERNEL_FIT_PATH)` $(BINARIES_DIR)/$(BR2_LINUX_KERNEL_FIT_BLOB_NAME)
+endef
+define LINUX_INSTALL_ITB_TARGET
+	cp $(BINARIES_DIR)/$(BR2_LINUX_KERNEL_FIT_BLOB_NAME) $(TARGET_DIR)/boot/
+endef
+endif
+
 # Compilation. We make sure the kernel gets rebuilt when the
 # configuration has changed.
 define LINUX_BUILD_CMDS
@@ -271,6 +281,7 @@ define LINUX_BUILD_CMDS
 	fi
 	$(LINUX_BUILD_DTB)
 	$(LINUX_APPEND_DTB)
+	$(LINUX_BUILD_ITB)
 endef
 
 
@@ -278,6 +289,7 @@ ifeq ($(BR2_LINUX_KERNEL_INSTALL_TARGET),y)
 define LINUX_INSTALL_KERNEL_IMAGE_TO_TARGET
 	install -m 0644 -D $(LINUX_IMAGE_PATH) $(TARGET_DIR)/boot/$(LINUX_IMAGE_NAME)
 	$(LINUX_INSTALL_DTB_TARGET)
+	$(LINUX_INSTALL_ITB_TARGET)
 endef
 endif
 
-- 
1.8.3.2



More information about the buildroot mailing list