ubinize - Man Page

a tool for generating UBI images

Synopsis

ubinize [-o filename] [-p <bytes>] [-m <bytes>] [-s <bytes>] [-O <num>] [-e <num>] [-x <num>] [-Q <num>] [-v] [-h] [-V] [--output=<filename>] [--peb-size=<bytes>] [--min-io-size=<bytes>] [--sub-page-size=<bytes>] [--vid-hdr-offset=<num>] [--erase-counter=<num>] [--ubi-ver=<num>] [--image-seq=<num>] [--verbose] [--help] [--version] ini-file

Description

An UBI image may contain one or more UBI volumes which have to be defined in the input configuration ini-file. The ini file defines all the UBI volumes - their characteristics and the contents, but it does not define the characteristics of the flash the UBI image is generated for. Instead, the flash characteristics are defined via the command-line options. Note, if not sure about some of the command-line parameters, do not specify them and let the utility use default values.

Options

-o,  --output=file

Specify output file

-p,  --peb-size=bytes

Size of the physical eraseblock of the flash this UBI image is created for in bytes, kilobytes (KiB), or megabytes (MiB). This parameter is mandatory.

-m,  --min-io-size=bytes

Minimum input/output unit size of the flash in bytes

-s,  --sub-page-size=bytes

Minimum input/output unit used for UBI headers, e.g. sub-page size in case of NAND flash (equivalent to the minimum input/output unit size by default).

-O,  --vid-hdr-offset=num

Offset if the VID header from start of the physical eraseblock (default is the next minimum I/O unit or sub-page after the EC header)

-e,  --erase-counter=num

The erase counter value to put to EC headers (default is 0).

-x,  --ubi-ver=num

UBI version number to put to EC headers (default is 1).

-Q,  --image-seq=num

32-bit UBI image sequence number to use (by default a random number is picked).

-v,  --verbose

Be verbose.

-h,  --help

Print a help message and exit.

-V,  --version

Print program version and exit.

Example

ubinize -o ubi.img -p 16KiB -m 512 -s 256 cfg.ini

Create UBI image ubi.img as described by configuration file cfg.ini.

A physical erase block on the flash is 16KiB in size and has 512 byte pages with 256 byte sub-pages.

Ini-File Format

The input configuration ini-file describes all the volumes which have to be included to the output UBI image. Each volume is described in its own section which may be named arbitrarily. The section consists on "key=value" pairs, for example:

[jffs2-volume]
mode=ubi
image=../jffs2.img
vol_id=1
vol_size=30MiB
vol_type=dynamic
vol_name=jffs2_volume
vol_flags=autoresize
vol_alignment=1

This example configuration file tells the utility to create an UBI image with one volume with ID 1, volume size 30MiB, the volume is dynamic, has name jffs2_volume, autoresize volume flag, and alignment 1.

The image=../jffs2.img line tells the utility to take the contents of the volume from the ../jffs2.img file. The size of the image file has to be less or equivalent to the volume size (30MiB).

The mode=ubi line is mandatory and just tells that the section describes an UBI volume - other section modes may be added in the future.

Notes:

Authors

Man page written by David Oberhollenzer, based on the help text of
the ubinize utility written by Artem Bityutskiy and Oliver Lohmann.

Reporting Bugs

Report mtd-utils bugs to the Linux mtd mailing list.

Linux mtd mailing list: <linux-mtd@lists.infradead.org>

Linux mtd home page: <http://www.linux-mtd.infradead.org/>

Availability

The ubinize command is part of the mtd-utils package and is available from ftp://ftp.infradead.org/pub/mtd-utils/.

See Also

mkfs.jffs2(1)

Info

September 2016 mtd-utils