<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 2, 2016 at 12:22 PM, Ed Bartosh <span dir="ltr"><<a href="mailto:ed.bartosh@linux.intel.com" target="_blank">ed.bartosh@linux.intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
This patchset adds ability to use bmaptool to flash images faster than<br>
using traditional methods. It contains bmap-tools recipe and generation<br>
of .bmap files for the images generated by bitbake and wic.<br>
<br>
Bmaptool is a generic tool for creating the block map (bmap) for a file<br>
and and copying files using the block map. The idea is that large file<br>
containing unused blocks, like raw system image files, can be copied or<br>
flashed a lot faster with bmaptool than with traditional tools like<br>
"dd" or "cp".<br>
<br>
Here is an example of flashing image using dd and bmaptool showing<br>
around 25% performance gain in flashing time:<br>
<br>
> ls -slh<br>
19M -rw-r--r-- 1 ed ed 26M Apr 26 11:36 core-image-minimal-qemux86-64-20160426083554.rootfs.ext4<br>
4.0K -rw-r--r-- 1 ed ed 2.7K Apr 26 11:36 core-image-minimal-qemux86-64-20160426083554.rootfs.ext4.bmap<br>
<br>
> time dd if=core-image-minimal-qemux86-64-20160426083554.rootfs.ext4 of=/dev/sdb<br>
52302+0 records in<br>
52302+0 records out<br>
26778624 bytes (27 MB) copied, 2.51183 s, 10.7 MB/s<br>
<br>
real 0m2.515s<br>
user 0m0.014s<br>
sys 0m0.329s<br>
<br>
> time bmaptool copy core-image-minimal-qemux86-64-20160426083554.rootfs.ext4 /dev/sdb<br>
bmaptool: info: discovered bmap file 'core-image-minimal-qemux86-64-20160426083554.rootfs.ext4.bmap'<br>
bmaptool: info: block map format version 2.0<br>
bmaptool: info: 6538 blocks of size 4096 (25.5 MiB), mapped 4799 blocks (18.7 MiB or 73.4%)<br>
bmaptool: info: copying image 'core-image-minimal-qemux86-64-20160426083554.rootfs.ext4' to block device '/dev/sdb' using bmap file 'core-image-minimal-qemux86-64-20160426083554.rootfs.ext4.bmap'<br>
bmaptool: info: 100% copied<br>
bmaptool: info: synchronizing '/dev/sdb'<br>
bmaptool: info: copying time: 1.8s, copying speed 10.3 MiB/sec<br>
<br>
real 0m1.909s<br>
user 0m0.226s<br>
sys 0m0.052s<br>
<br>
The test was repeated 5 times with the same image and the same usb stick device.<br>
<br>
Changes in v2: Combined Alexander's and my bmap-tools recipes.<br>
Got rid of generating standalone script as it breaks build of bmap-tools-native.<br>
<br>
Changes in v3: Returned back generation of standalone bmaptool script<br>
Implemented --bmap option for wic<br>
Added test case to test bmap generation by wic --bmap</blockquote><div><br></div><div>I just wanted to say, this + the sparseness series is just awesome. Such a timesaver in my test cycle, particularly on my old macbook which has a usb 2.0 sd card reader :) </div></div>-- <br><div class="gmail_signature">Christopher Larson<br>clarson at kergoth dot com<br>Founder - BitBake, OpenEmbedded, OpenZaurus<br>Maintainer - Tslib<br>Senior Software Engineer, Mentor Graphics</div>
</div></div>