From: Julien Boibessot <julien.boibessot@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] Add UBI image generation support.
Date: Tue, 21 Dec 2010 10:09:31 +0100 [thread overview]
Message-ID: <4D106ECB.5060605@free.fr> (raw)
In-Reply-To: <1292922317-29202-1-git-send-email-julien.boibessot@free.fr>
sorry but the patch comment doesn't want to go inside the mail (my fault)...
Here it is:
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 a ?crit :
> 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"
> +
>
prev parent reply other threads:[~2010-12-21 9:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-21 9:05 [Buildroot] [PATCH] Add UBI image generation support julien.boibessot at free.fr
2010-12-21 9:09 ` Julien Boibessot [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D106ECB.5060605@free.fr \
--to=julien.boibessot@free.fr \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.