[Buildroot] yaffs2 file system

Will Wagner will_wagner at carallon.com
Tue Apr 15 08:52:28 UTC 2014


On 15/04/2014 09:32, Rohit Kumar wrote:
> Hello,
>
> i want to create yaffs2 file system with buildroot.
> i see that buildroot doesnt have this option. so i have created standard
> uncompressed image.
> is there a way to convert it to yaffs2 FS?
> any help is appreciated.

Hi Rohit,

I have a couple of patches (attached) that add yaffs2 support for 
buildroot, that I have never got round to pushing upstream. They are 
based on buildroot_2013.05.

Regards
Will

-- 
------------------------------------------------------------------------
Will Wagner                                     will_wagner at carallon.com
Development Manager                      Office Tel: +44 (0)20 7471 9224
Carallon Ltd, Studio G20, Shepherds Building, Rockley Rd, London W14 0DA
------------------------------------------------------------------------
-------------- next part --------------
>From e0db1768f6b73593f4b9138cb844afe2a5c8be99 Mon Sep 17 00:00:00 2001
From: Will Wagner <will_wagner at carallon.com>
Date: Mon, 15 Jul 2013 12:11:24 +0100
Subject: [PATCH 2/2] new filesystem: yaffs

Signed-off-by: Will Wagner <willw at carallon.com>
---
 fs/Config.in       |    1 +
 fs/yaffs/Config.in |   12 ++++++++++++
 fs/yaffs/yaffs.mk  |   19 +++++++++++++++++++
 3 files changed, 32 insertions(+), 0 deletions(-)
 create mode 100644 fs/yaffs/Config.in
 create mode 100644 fs/yaffs/yaffs.mk

diff --git a/fs/Config.in b/fs/Config.in
index da4c5ff..89b1298 100644
--- a/fs/Config.in
+++ b/fs/Config.in
@@ -11,5 +11,6 @@ source "fs/romfs/Config.in"
 source "fs/squashfs/Config.in"
 source "fs/tar/Config.in"
 source "fs/ubifs/Config.in"
+source "fs/yaffs/Config.in"
 
 endmenu
diff --git a/fs/yaffs/Config.in b/fs/yaffs/Config.in
new file mode 100644
index 0000000..e9d4f93
--- /dev/null
+++ b/fs/yaffs/Config.in
@@ -0,0 +1,12 @@
+config BR2_TARGET_ROOTFS_YAFFS
+	bool "yaffs root filesystem"
+	help
+	  Build a yaffs root filesystem
+
+config BR2_TARGET_ROOTFS_YAFFS_PATH
+	string "path within target to create fs from"
+	depends on BR2_TARGET_ROOTFS_YAFFS
+	default ""
+	help
+	  If you want to create the yaffs image from only
+	  part of the target directory, specify the path here
\ No newline at end of file
diff --git a/fs/yaffs/yaffs.mk b/fs/yaffs/yaffs.mk
new file mode 100644
index 0000000..7aad26f
--- /dev/null
+++ b/fs/yaffs/yaffs.mk
@@ -0,0 +1,19 @@
+#############################################################
+#
+# Build the yaffs root filesystem image
+#
+#############################################################
+
+ifneq ($(BR2_TARGET_ROOTFS_YAFFS_PATH),"")
+ROOTFS_YAFFS_TARGET=$(TARGET_DIR)/$(BR2_TARGET_ROOTFS_YAFFS_PATH)
+else
+ROOTFS_YAFFS_TARGET=$(TARGET_DIR)
+endif
+
+define ROOTFS_YAFFS_CMD
+ $(HOST_DIR)/usr/bin/mkyaffs2 --all-root $(ROOTFS_YAFFS_TARGET) $@
+endef
+
+ROOTFS_YAFFS_DEPENDENCIES = host-yaffs2utils
+
+$(eval $(call ROOTFS_TARGET,yaffs))
-- 
1.7.2.5


-------------- next part --------------
>From dc647d3837e42c11794cd27840fb9ddf623daa7a Mon Sep 17 00:00:00 2001
From: Will Wagner <will_wagner at carallon.com>
Date: Mon, 15 Jul 2013 12:09:07 +0100
Subject: [PATCH 1/2] new package: yaffs2utils

Signed-off-by: Will Wagner <willw at carallon.com>
---
 package/Config.in                  |    1 +
 package/yaffs2utils/Config.in      |    4 ++++
 package/yaffs2utils/yaffs2utils.mk |   31 +++++++++++++++++++++++++++++++
 3 files changed, 36 insertions(+), 0 deletions(-)
 create mode 100644 package/yaffs2utils/Config.in
 create mode 100644 package/yaffs2utils/yaffs2utils.mk

diff --git a/package/Config.in b/package/Config.in
index 3110dc5..ed5ef08 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -211,6 +211,7 @@ source "package/squashfs3/Config.in"
 source "package/sshfs/Config.in"
 source "package/unionfs/Config.in"
 source "package/xfsprogs/Config.in"
+source "package/yaffs2utils/Config.in"
 endmenu
 
 menu "Hardware handling"
diff --git a/package/yaffs2utils/Config.in b/package/yaffs2utils/Config.in
new file mode 100644
index 0000000..9c35e91
--- /dev/null
+++ b/package/yaffs2utils/Config.in
@@ -0,0 +1,4 @@
+config BR2_PACKAGE_YAFFS2UTILS
+       bool "yaffs2utils"
+       help
+         Tools to make and extract yaffs2 filesystem image.
diff --git a/package/yaffs2utils/yaffs2utils.mk b/package/yaffs2utils/yaffs2utils.mk
new file mode 100644
index 0000000..a22fc2a
--- /dev/null
+++ b/package/yaffs2utils/yaffs2utils.mk
@@ -0,0 +1,31 @@
+#############################################################
+#
+# yaffs
+#
+#############################################################
+
+YAFFS2UTILS_SOURCE = latest.tar.gz
+YAFFS2UTILS_SITE = http://yaffs2utils.googlecode.com/files
+
+define YAFFS2UTILS_BUILD_CMDS
+ $(TARGET_MAKE_ENV) $(MAKE) CC="$(TARGET_CC)" -C $(@D)
+endef
+
+define YAFFS2UTILS_INSTALL_TARGET_CMDS
+  install -D -m 755 $(@D)/mkyaffs2 $(TARGET_DIR)/usr/bin/mkyaffs2
+  install -D -m 755 $(@D)/unyaffs2 $(TARGET_DIR)/usr/bin/unyaffs2
+  install -D -m 755 $(@D)/unspare2 $(TARGET_DIR)/usr/bin/unspare2
+endef
+
+define HOST_YAFFS2UTILS_BUILD_CMDS
+ $(MAKE) -C $(@D)
+endef
+
+define HOST_YAFFS2UTILS_INSTALL_CMDS
+  install -D -m 755 $(@D)/mkyaffs2 $(HOST_DIR)/usr/bin/mkyaffs2
+  install -D -m 755 $(@D)/unyaffs2 $(HOST_DIR)/usr/bin/unyaffs2
+  install -D -m 755 $(@D)/unspare2 $(HOST_DIR)/usr/bin/unspare2
+endef
+
+$(eval $(generic-package))
+$(eval $(host-generic-package))
-- 
1.7.2.5




More information about the buildroot mailing list