UBINIZE(8) System Manager's Manual UBINIZE(8)

ubinize - a tool for generating UBI images

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

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.

Specify output file
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.
Minimum input/output unit size of the flash in 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).
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)
The erase counter value to put to EC headers (default is 0).
UBI version number to put to EC headers (default is 1).
32-bit UBI image sequence number to use (by default a random number is picked).
Be verbose.
Print a help message and exit.
Print program version and exit.

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.

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:

Size in vol_size might be specified kilobytes (KiB), megabytes (MiB), gigabytes (GiB) or bytes (no modifier).
If "vol_size" key is absent, the volume size is assumed to be equivalent to the size of the image file (defined by "image" key).
If the "image" is absent, the volume is assumed to be empty
Volume alignment must not be greater than the logical eraseblock size.
One ini file may contain arbitrary number of sections, the utility will put all the volumes which are described by these section to the output UBI image file.

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

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

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

Copyright © International Business Machines Corp., 2006
Copyright © 2008 Nokia Corporation
Copyright © 2016 sigma star gmbh

License GPLv2: GNU GPL version 2 http://gnu.org/licenses/gpl2.html.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

mkfs.jffs2(1)

September 2016 mtd-utils