From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mail.openembedded.org (Postfix) with ESMTP id 893C76012C for ; Wed, 4 May 2016 09:20:06 +0000 (UTC) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP; 04 May 2016 02:19:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,576,1455004800"; d="scan'208";a="96917097" Received: from linux.intel.com ([10.23.219.25]) by fmsmga004.fm.intel.com with ESMTP; 04 May 2016 02:19:04 -0700 Received: from linux.intel.com (vmed.fi.intel.com [10.237.72.51]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by linux.intel.com (Postfix) with ESMTP id 224C26A4007; Wed, 4 May 2016 03:06:37 -0700 (PDT) Date: Wed, 4 May 2016 09:59:13 +0300 From: Ed Bartosh To: Christopher Larson Message-ID: <20160504065913.GA10864@linux.intel.com> Reply-To: ed.bartosh@linux.intel.com References: MIME-Version: 1.0 In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Patches and discussions about the oe-core layer Subject: Re: [PATCH v3 0/6] bmaptool support X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 09:20:09 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, May 03, 2016 at 08:22:48PM +0000, Christopher Larson wrote: > On Mon, May 2, 2016 at 12:22 PM, Ed Bartosh > wrote: > > > Hi, > > > > This patchset adds ability to use bmaptool to flash images faster than > > using traditional methods. It contains bmap-tools recipe and generation > > of .bmap files for the images generated by bitbake and wic. > > > > Bmaptool is a generic tool for creating the block map (bmap) for a file > > and and copying files using the block map. The idea is that large file > > containing unused blocks, like raw system image files, can be copied or > > flashed a lot faster with bmaptool than with traditional tools like > > "dd" or "cp". > > > > Here is an example of flashing image using dd and bmaptool showing > > around 25% performance gain in flashing time: > > > > > ls -slh > > 19M -rw-r--r-- 1 ed ed 26M Apr 26 11:36 > > core-image-minimal-qemux86-64-20160426083554.rootfs.ext4 > > 4.0K -rw-r--r-- 1 ed ed 2.7K Apr 26 11:36 > > core-image-minimal-qemux86-64-20160426083554.rootfs.ext4.bmap > > > > > time dd if=core-image-minimal-qemux86-64-20160426083554.rootfs.ext4 > > of=/dev/sdb > > 52302+0 records in > > 52302+0 records out > > 26778624 bytes (27 MB) copied, 2.51183 s, 10.7 MB/s > > > > real 0m2.515s > > user 0m0.014s > > sys 0m0.329s > > > > > time bmaptool copy > > core-image-minimal-qemux86-64-20160426083554.rootfs.ext4 /dev/sdb > > bmaptool: info: discovered bmap file > > 'core-image-minimal-qemux86-64-20160426083554.rootfs.ext4.bmap' > > bmaptool: info: block map format version 2.0 > > bmaptool: info: 6538 blocks of size 4096 (25.5 MiB), mapped 4799 blocks > > (18.7 MiB or 73.4%) > > 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' > > bmaptool: info: 100% copied > > bmaptool: info: synchronizing '/dev/sdb' > > bmaptool: info: copying time: 1.8s, copying speed 10.3 MiB/sec > > > > real 0m1.909s > > user 0m0.226s > > sys 0m0.052s > > > > The test was repeated 5 times with the same image and the same usb stick > > device. > > > > Changes in v2: Combined Alexander's and my bmap-tools recipes. > > Got rid of generating standalone script as it breaks build > > of bmap-tools-native. > > > > Changes in v3: Returned back generation of standalone bmaptool script > > Implemented --bmap option for wic > > Added test case to test bmap generation by wic --bmap > > > 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 :) Thank you! I also think bmaptool is awesome utility. It can save lots of flushing time especially for the 'very sparse' images. I had this work in my TODO for quite long time. Now, thanks to Alexander who did almost all hard work, it's eventually coming to oe/yocto. -- Regards, Ed