** need to pay attention to kernel version and utiltools version.
mtd-utils# mkfs.ubifs/mkfs.ubifs -r filesystem/ -F -o ubifs.img -m 2048 -e 126976 -c 1580
- Create ubinize.cfg file and write the contents into it
mtd-utils# vi ubinize.cfg [ubifs] <== Section header mode=ubi <== Volume mode (other option is static) image=ubifs.img <== Source image vol_id=0 <== Volume ID in UBI image vol_size=192MiB <== Volume size vol_type=dynamic <== Allow for dynamic resize vol_name=rootfs <== Volume name vol_flags=autoresize <== Autoresize volume at first mount
mtd-utils# ubi-utils/ubinize -o ubi.img -m 2048 -p 128KiB -s 512 -O 2048 ubinize.cfg
Symbol | Meaning | Value for XO test case |
---|---|---|
SP | PEB Size | 128KiB |
SL | LEB Size | 128KiB - 2 * 2KiB = 124 KiB |
P | Total number of PEBs on the MTD device | 200MiB / 128KiB = 1600 |
B | Number of PEBs reserved for bad PEB handling | 1% of P = 16 |
O | The overhead related to storing EC and VID headers in bytes, i.e. O = SP - SL | 4KiB |