Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] Add UBI image generation support. UBI images are generated from UBIFS one (with ubinize tool) and are used by bootloaders (eg U-Boot) to write UBIFS images directly on bare NAND FLASH (see http://www.linux-mtd.infradead.org/faq/ubi.html)
@ 2010-12-21  8:35 julien.boibessot at free.fr
  2010-12-21  9:14 ` Thomas Petazzoni
  0 siblings, 1 reply; 2+ messages in thread
From: julien.boibessot at free.fr @ 2010-12-21  8:35 UTC (permalink / raw)
  To: buildroot

From: Julien Boibessot <julien.boibessot@armadeus.com>


Signed-off-by: Julien Boibessot <julien.boibessot@armadeus.com>
Signed-off-by: Nicolas Colombain <nicolas.colombain@armadeus.com>
---
 fs/ubi/Config.in   |   22 ++++++++++++++++++++++
 fs/ubi/ubi.mk      |   24 ++++++++++++++++++++++++
 fs/ubi/ubinize.cfg |    7 +++++++
 fs/ubifs/Config.in |    2 ++
 4 files changed, 55 insertions(+), 0 deletions(-)
 create mode 100644 fs/ubi/Config.in
 create mode 100644 fs/ubi/ubi.mk
 create mode 100644 fs/ubi/ubinize.cfg

diff --git a/fs/ubi/Config.in b/fs/ubi/Config.in
new file mode 100644
index 0000000..b4433f7
--- /dev/null
+++ b/fs/ubi/Config.in
@@ -0,0 +1,22 @@
+config BR2_TARGET_ROOTFS_UBI
+	depends on BR2_TARGET_ROOTFS_UBIFS
+	bool "generate ubi image"
+	help
+	  Build a UBI image of the UBIFS root filesystem.
+
+config BR2_TARGET_ROOTFS_UBI_PEBSIZE
+	hex "UBI physical erase block size"
+	depends on BR2_TARGET_ROOTFS_UBI
+	default 0x20000
+	help
+	  Tells ubinize that physical eraseblock size of the flash chip the UBI
+	  image is created for is 0x20000 (by default).
+
+config BR2_TARGET_ROOTFS_UBI_SUBSIZE
+	int "UBI sub-page size"
+	depends on BR2_TARGET_ROOTFS_UBI
+	default 512
+	help
+	  Tells ubinize that the flash supports sub-pages and sub-page size is
+	  512 bytes (by default).
+
diff --git a/fs/ubi/ubi.mk b/fs/ubi/ubi.mk
new file mode 100644
index 0000000..71e41c3
--- /dev/null
+++ b/fs/ubi/ubi.mk
@@ -0,0 +1,24 @@
+#############################################################
+#
+# Build the UBI root filesystem image
+#
+#############################################################
+
+UBI_UBINIZE_OPTS := -m $(BR2_TARGET_ROOTFS_UBIFS_MINIOSIZE)
+UBI_UBINIZE_OPTS += -p $(BR2_TARGET_ROOTFS_UBI_PEBSIZE)
+ifneq ($(BR2_TARGET_ROOTFS_UBI_SUBSIZE),0)
+UBI_UBINIZE_OPTS += -s $(BR2_TARGET_ROOTFS_UBI_SUBSIZE)
+endif
+
+
+ROOTFS_UBI_DEPENDENCIES = rootfs-ubifs
+
+define ROOTFS_UBI_CMD
+	cp fs/ubi/ubinize.cfg . ;\
+	echo "image=$$@fs" \
+		>> ./ubinize.cfg ;\
+	$(HOST_DIR)/usr/sbin/ubinize -o $$@ $(UBI_UBINIZE_OPTS) ubinize.cfg ;\
+	rm ubinize.cfg
+endef
+
+$(eval $(call ROOTFS_TARGET,ubi))
diff --git a/fs/ubi/ubinize.cfg b/fs/ubi/ubinize.cfg
new file mode 100644
index 0000000..6515271
--- /dev/null
+++ b/fs/ubi/ubinize.cfg
@@ -0,0 +1,7 @@
+[ubifs]
+mode=ubi
+vol_id=0
+vol_type=dynamic
+vol_name=rootfs
+vol_alignment=1
+vol_flags=autoresize
diff --git a/fs/ubifs/Config.in b/fs/ubifs/Config.in
index bcf409c..e150f9b 100644
--- a/fs/ubifs/Config.in
+++ b/fs/ubifs/Config.in
@@ -77,3 +77,5 @@ config BR2_TARGET_ROOTFS_UBIFS_LZMA
 
 endchoice
 
+source "fs/ubi/Config.in"
+
-- 
1.6.0.4

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

* [Buildroot] [PATCH] Add UBI image generation support. UBI images are generated from UBIFS one (with ubinize tool) and are used by bootloaders (eg U-Boot) to write UBIFS images directly on bare NAND FLASH (see http://www.linux-mtd.infradead.org/faq/ubi.html)
  2010-12-21  8:35 [Buildroot] [PATCH] Add UBI image generation support. UBI images are generated from UBIFS one (with ubinize tool) and are used by bootloaders (eg U-Boot) to write UBIFS images directly on bare NAND FLASH (see http://www.linux-mtd.infradead.org/faq/ubi.html) julien.boibessot at free.fr
@ 2010-12-21  9:14 ` Thomas Petazzoni
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2010-12-21  9:14 UTC (permalink / raw)
  To: buildroot

Hello,

Thanks for this feature, it is definitely much appreciated.

First issue: the log of your patch. There should be one small line,
like:

"Add UBI image generation support"

and then after one empty line, the rest of the description. Some
comments below.

> Signed-off-by: Julien Boibessot <julien.boibessot@armadeus.com>
> Signed-off-by: Nicolas Colombain <nicolas.colombain@armadeus.com>
> ---
>  fs/ubi/Config.in   |   22 ++++++++++++++++++++++
>  fs/ubi/ubi.mk      |   24 ++++++++++++++++++++++++
>  fs/ubi/ubinize.cfg |    7 +++++++
>  fs/ubifs/Config.in |    2 ++

I am not sure it should be a separate filesystem included into the
ubifs-related options. I think I'd prefer to see something inside the
UBIFS filesystem options, like:

 [ ] Embed into a UBI image

and then have the code directly in fs/ubifs/ubifs.mk do the job of
calling ubinize if needed.

Regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

end of thread, other threads:[~2010-12-21  9:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-21  8:35 [Buildroot] [PATCH] Add UBI image generation support. UBI images are generated from UBIFS one (with ubinize tool) and are used by bootloaders (eg U-Boot) to write UBIFS images directly on bare NAND FLASH (see http://www.linux-mtd.infradead.org/faq/ubi.html) julien.boibessot at free.fr
2010-12-21  9:14 ` Thomas Petazzoni

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