bmaptool create


bmaptool's "create" subcommand can be used to generate a bmap file for an image.

For example:

 $ bmaptool create image.raw

will generate bmap for the "image.raw" file and print it to the standard output. You can save the block map to a file either by redirecting the output or by using the "-o" option:

 $ bmaptool create image.raw > image.bmap
 $ bmaptool create -o image.bmap image.raw

It is very unlikely that an average Tizen IVI user would use the "create" subcommand. Not only because Tizen IVI images are distributed along with their bmap, but also because the images are distributed in a compressed form, so the information about mapped blocks is not there anyway.

In Tizen IVI, the bmap file for the image is generated by MIC, which supports the "--generate-bmap" option. However, MIC uses the "bmap-tools" project to generate the bmap.

Bmaptool uses the "FIEMAP" Linux ioctl to find all the mapped areas in the image file. This ioctl is supported by the Linux kernel, starting from version 2.6.28 by all following filesystems: "ext2", "ext3", "ext4", "xfs", "btrfs", "gfs2", "ocfs2", and "nilfs2".

Obviously, the "create" subcommand requires the host filesystem to support the "FIEMAP" ioctl. The "image.raw" file may contain any filesystem. In fact, "image.raw" is just a sparse file for the "create" subcommand, which is not even a tiny bit concerned about the contents of the "image.raw" file.