* [Buildroot] [PATCH] v2 Add UBI image generation support.
@ 2010-12-21 17:38 julien.boibessot at free.fr
2010-12-23 12:54 ` Thomas Petazzoni
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: julien.boibessot at free.fr @ 2010-12-21 17:38 UTC (permalink / raw)
To: buildroot
From: Julien Boibessot <julien.boibessot@armadeus.com>
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).
Changes since v1:
* change some comments/helps
* as requested by Thomas, merged fs/ubi/ in fs/ubifs/, but kept ubifs.mk and
ubi.mk separated. (I don't know if it's really worth to merge them...)
Signed-off-by: Julien Boibessot <julien.boibessot@armadeus.com>
Signed-off-by: Nicolas Colombain <nicolas.colombain@armadeus.com>
---
fs/ubifs/Config.in | 22 ++++++++++++++++++++++
fs/ubifs/ubi.mk | 23 +++++++++++++++++++++++
fs/ubifs/ubinize.cfg | 7 +++++++
3 files changed, 52 insertions(+), 0 deletions(-)
create mode 100644 fs/ubifs/ubi.mk
create mode 100644 fs/ubifs/ubinize.cfg
diff --git a/fs/ubifs/Config.in b/fs/ubifs/Config.in
index bcf409c..363960e 100644
--- a/fs/ubifs/Config.in
+++ b/fs/ubifs/Config.in
@@ -77,3 +77,25 @@ config BR2_TARGET_ROOTFS_UBIFS_LZMA
endchoice
+config BR2_TARGET_ROOTFS_UBI
+ depends on BR2_TARGET_ROOTFS_UBIFS
+ bool "Embed into an UBI image"
+ help
+ Build an ubi image from the ubifs one (with ubinize).
+
+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 that sub-page
+ size is 512 bytes (by default).
+
diff --git a/fs/ubifs/ubi.mk b/fs/ubifs/ubi.mk
new file mode 100644
index 0000000..c88e336
--- /dev/null
+++ b/fs/ubifs/ubi.mk
@@ -0,0 +1,23 @@
+#############################################################
+#
+# Embed the ubifs image into an ubi one
+#
+#############################################################
+
+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/ubifs/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/ubifs/ubinize.cfg b/fs/ubifs/ubinize.cfg
new file mode 100644
index 0000000..6515271
--- /dev/null
+++ b/fs/ubifs/ubinize.cfg
@@ -0,0 +1,7 @@
+[ubifs]
+mode=ubi
+vol_id=0
+vol_type=dynamic
+vol_name=rootfs
+vol_alignment=1
+vol_flags=autoresize
--
1.6.0.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH] v2 Add UBI image generation support.
2010-12-21 17:38 [Buildroot] [PATCH] v2 Add UBI image generation support julien.boibessot at free.fr
@ 2010-12-23 12:54 ` Thomas Petazzoni
2010-12-23 15:36 ` Bjørn Forsman
2010-12-24 10:03 ` Julien Boibessot
2010-12-25 11:18 ` Thomas Petazzoni
2011-01-11 21:41 ` Peter Korsgaard
2 siblings, 2 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2010-12-23 12:54 UTC (permalink / raw)
To: buildroot
Hello,
Thanks Julien for this UBI support, it's definitely good to have in
Buildroot. This version looks good to me, but there is an alternate
solution (patch below, merged into Julien's patch).
Peter, we need you to make a decision here, between those two
solutions, because I have no strong opinion on which one is the best. To
summarize:
* Julien's solution is to create a new root filesystem type, called
"ubi", which depends on the "ubifs" filesystem to be generated. So
at build time, the rootfs.ubifs image is first generated, and then
the rootfs.ubi image is generated from rootfs.ubifs using ubinize.
You end up with rootfs.ubifs and rootfs.ubi in $(O)/images.
* The other solution proposed below is to not add a new root
filesystem type, but rather add a post-processing step to the
rootfs.ubifs image when "Embed in UBI image" is selected. You end up
with rootfs.ubifs in $(O)/images, regardless of whether it is a
UBIFS filesystem image, or a complete UBI image.
I just implemented the second solution because it's how I would have
implemented it if I had to do it, but I don't know if it's better or
not than Julien's proposal.
Regards,
Thomas
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH] v2 Add UBI image generation support.
2010-12-23 12:54 ` Thomas Petazzoni
@ 2010-12-23 15:36 ` Bjørn Forsman
2010-12-24 10:03 ` Julien Boibessot
1 sibling, 0 replies; 6+ messages in thread
From: Bjørn Forsman @ 2010-12-23 15:36 UTC (permalink / raw)
To: buildroot
Hi,
On 23 December 2010 13:54, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Hello,
[...]
> ?* The other solution proposed below is to not add a new root
> ? filesystem type, but rather add a post-processing step to the
> ? rootfs.ubifs image when "Embed in UBI image" is selected. You end up
> ? with rootfs.ubifs in $(O)/images, regardless of whether it is a
> ? UBIFS filesystem image, or a complete UBI image.
How about using .ubi filename extension for UBI images
(and .ubifs for UBIFS) so it's easy to spot what's what?
Best regards,
Bj?rn Forsman
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH] v2 Add UBI image generation support.
2010-12-23 12:54 ` Thomas Petazzoni
2010-12-23 15:36 ` Bjørn Forsman
@ 2010-12-24 10:03 ` Julien Boibessot
1 sibling, 0 replies; 6+ messages in thread
From: Julien Boibessot @ 2010-12-24 10:03 UTC (permalink / raw)
To: buildroot
Hello,
Thomas Petazzoni a ?crit :
> * The other solution proposed below is to not add a new root
> filesystem type, but rather add a post-processing step to the
> rootfs.ubifs image when "Embed in UBI image" is selected. You end up
> with rootfs.ubifs in $(O)/images, regardless of whether it is a
> UBIFS filesystem image, or a complete UBI image.
>
I took (what I think is) the OpenEmbedded approch: generates both a
.ubifs image and a .ubi one.
We (armadeus) are most of the time using the UBI image to update our
systems from U-Boot, but I think people might be interested in having at
the same time both UBI and UBIFS images in their tftpboot directory and
know the difference by looking at the filename.
Regards,
Julien
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH] v2 Add UBI image generation support.
2010-12-21 17:38 [Buildroot] [PATCH] v2 Add UBI image generation support julien.boibessot at free.fr
2010-12-23 12:54 ` Thomas Petazzoni
@ 2010-12-25 11:18 ` Thomas Petazzoni
2011-01-11 21:41 ` Peter Korsgaard
2 siblings, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2010-12-25 11:18 UTC (permalink / raw)
To: buildroot
Hello,
On Tue, 21 Dec 2010 18:38:07 +0100
julien.boibessot at free.fr wrote:
> From: Julien Boibessot <julien.boibessot@armadeus.com>
>
> 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).
>
> Changes since v1:
> * change some comments/helps
> * as requested by Thomas, merged fs/ubi/ in fs/ubifs/, but kept ubifs.mk and
> ubi.mk separated. (I don't know if it's really worth to merge them...)
>
> Signed-off-by: Julien Boibessot <julien.boibessot@armadeus.com>
> Signed-off-by: Nicolas Colombain <nicolas.colombain@armadeus.com>
After thinking about this a bit, I think having two separate images is
better, as it is more clear for the user what the image actually is.
Therefore, I think this version from Julien should be applied, and it
gets my:
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
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] 6+ messages in thread
* [Buildroot] [PATCH] v2 Add UBI image generation support.
2010-12-21 17:38 [Buildroot] [PATCH] v2 Add UBI image generation support julien.boibessot at free.fr
2010-12-23 12:54 ` Thomas Petazzoni
2010-12-25 11:18 ` Thomas Petazzoni
@ 2011-01-11 21:41 ` Peter Korsgaard
2 siblings, 0 replies; 6+ messages in thread
From: Peter Korsgaard @ 2011-01-11 21:41 UTC (permalink / raw)
To: buildroot
>>>>> "julien" == julien boibessot <julien.boibessot@free.fr> writes:
julien> From: Julien Boibessot <julien.boibessot@armadeus.com>
julien> UBI images are generated from UBIFS one (with ubinize tool) and are used by
julien> bootloaders (eg U-Boot) to write UBIFS images directly on bare NAND FLASH
julien> (see http://www.linux-mtd.infradead.org/faq/ubi.html).
Committed, thanks!
julien> Changes since v1:
julien> * change some comments/helps
julien> * as requested by Thomas, merged fs/ubi/ in fs/ubifs/, but kept ubifs.mk and
julien> ubi.mk separated. (I don't know if it's really worth to merge them...)
These comments to reviewers (which shouldn't be part of the final commit
message) normally goes after the '---' line, so 'git am' doesn't include
them.
Same for the subject - The 'v2' should be in the [PATCH] square
brackets so it doesn't get included.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-01-11 21:41 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-21 17:38 [Buildroot] [PATCH] v2 Add UBI image generation support julien.boibessot at free.fr
2010-12-23 12:54 ` Thomas Petazzoni
2010-12-23 15:36 ` Bjørn Forsman
2010-12-24 10:03 ` Julien Boibessot
2010-12-25 11:18 ` Thomas Petazzoni
2011-01-11 21:41 ` Peter Korsgaard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox