Calculating the Arguments for mkfs.ubifs and ubinize - 2024.1 English

PetaLinux Tools Documentation: Reference Guide (UG1144)

Document ID
UG1144
Release Date
2024-06-21
Version
2024.1 English

After calculating the arguments for mkfs.ubifs and ubinize, which are used in the creation of the UBI file system, the final values need to be added to the petalinux-config options.

Calculating mkfs.ubifs Arguments

Table 1. mkfs.ubifs Args
Argument Description
-m / --min-io-size
The minimum I/O unit. Values are static based on the Flash type.
  • QSPI single and dual stacked value is 1
  • QSPI dual parallel value is 2
  • OSPI value is 1
-e / --leb-size
The logical erase block size of the UBI volume. leb-size/-e = PEB size - EC - VID = 128 K - 64 B - 64 B = 130944 B
-c / --max-leb-cnt
Specifies maximum file-system size in logical erase blocks
  • PEB(physical erase block) size = 128 KB . Spi datasheet or
    sf probe 0 0 0
    command from U-Boot terminal provide this.
  • EC header for spi flash = 64 B. The link shows the default values for QSPI.
max-leb-cnt/-c = QSPI ubifs partition size÷(division) leb-size = 50 MB ÷ 130944 B = 400 B
The final expanded values for mkfs.ubifs arguments are
-m 2 -e 130944 -c 400

mkfs.ubifs Arguments

Table 2. mkfs.ubifs Args
Argument Description
-m / --min-io-size
The minimum I/O unit. The following values are static based on the Flash type.
  • QSPI single and dual stacked value is 1
  • QSPI dual parallel value is 2
  • OSPI value is 1
-p / --peb-size
Tells ubinize that the physical erase block size of the flash chip for which the UBI image is created is 128 KiB. -peb-size / -p = 128 KB . The SPI datasheet or command from U-Boot terminal provide this value.
sf probe 0 0 0
-s / --sub-page-size
Tells ubinize that the flash supports sub-pages. This should not be more than the min-io-size. --sub-page-size / -s = 1 based on the min-io-size.
The final expanded values for ubinize arguments are
-m 2 -p 128KiB -s 1
Note: The specified mkfs.ubifs arguments and ubinize arguments are based on QSPI 128 KB erase size