Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] fs/romfs: add U-Boot image support
@ 2015-06-08 16:49 Hoang Tran
  2015-06-08 20:28 ` Arnout Vandecappelle
  2015-06-14 21:29 ` Thomas Petazzoni
  0 siblings, 2 replies; 6+ messages in thread
From: Hoang Tran @ 2015-06-08 16:49 UTC (permalink / raw)
  To: buildroot

Adds U-Boot image support for romfs root filesystems. This allows you to
use the bootm command in U-Boot to load the rootfs.

Signed-off-by: Hoang Tran <hoang.tran@vnoss.org>
---
 fs/romfs/Config.in | 13 +++++++++++++
 fs/romfs/romfs.mk  | 10 +++++++++-
 2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/fs/romfs/Config.in b/fs/romfs/Config.in
index 84944a0..34faf2d 100644
--- a/fs/romfs/Config.in
+++ b/fs/romfs/Config.in
@@ -2,3 +2,16 @@ config BR2_TARGET_ROOTFS_ROMFS
 	bool "romfs root filesystem"
 	help
 	  Build a romfs image of the root filesystem.
+
+if BR2_TARGET_ROOTFS_ROMFS
+
+config BR2_TARGET_ROOTFS_ROMFS_UIMAGE
+	bool "u-boot image of romfs root filesystem"
+	select BR2_PACKAGE_HOST_UBOOT_TOOLS
+	help
+	  Add a u-boot header to the romfs root filesystem. This allows
+	  the u-boot image to be loaded with the bootm command in U-Boot.
+
+	  The u-boot image will be called rootfs.romfs.uboot
+
+endif
diff --git a/fs/romfs/romfs.mk b/fs/romfs/romfs.mk
index e0ac65f..9fa5005 100644
--- a/fs/romfs/romfs.mk
+++ b/fs/romfs/romfs.mk
@@ -12,4 +12,12 @@ define ROOTFS_ROMFS_CMD
 	$(HOST_DIR)/usr/bin/genromfs -d $(TARGET_DIR) -f $@
 endef
 
-$(eval $(call ROOTFS_TARGET,romfs))
\ No newline at end of file
+$(BINARIES_DIR)/rootfs.romfs.uboot: $(BINARIES_DIR)/rootfs.romfs host-uboot-tools
+	$(MKIMAGE) -A $(MKIMAGE_ARCH) -T ramdisk -O linux \
+		-C none -d $<$(ROOTFS_ROMFS_COMPRESS_EXT) $@
+
+ifeq ($(BR2_TARGET_ROOTFS_ROMFS_UIMAGE),y)
+ROOTFS_ROMFS_POST_TARGETS += $(BINARIES_DIR)/rootfs.romfs.uboot
+endif
+
+$(eval $(call ROOTFS_TARGET,romfs))
-- 
2.3.5

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

end of thread, other threads:[~2015-06-15 14:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-08 16:49 [Buildroot] [PATCH 1/1] fs/romfs: add U-Boot image support Hoang Tran
2015-06-08 20:28 ` Arnout Vandecappelle
2015-06-14 21:29 ` Thomas Petazzoni
2015-06-15 14:46   ` Hoang Tran
2015-06-15 14:51     ` Thomas Petazzoni
2015-06-15 14:59       ` Hoang Tran

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