<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>10621</bug_id>
          
          <creation_ts>2016-11-08 10:36:17 +0000</creation_ts>
          <short_desc>make bmaptool a recommended tool for flashing images</short_desc>
          <delta_ts>2017-08-10 22:02:05 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>deployment</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>05 Jan 2017: IN PROGRESS REVIEW</status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>2.3 M2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ed Bartosh">eduard.bartosh</reporter>
          <assigned_to name="Ed Bartosh">eduard.bartosh</assigned_to>
          <cc>bluelightning</cc>
    
    <cc>jose.perez.carranza</cc>
    
    <cc>srifenbark</cc>
          
          <qa_contact name="oscar lopez arandas">oscarx.lopez.arandas</qa_contact>
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Done (doc changes complete)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>68075</commentid>
    <comment_count>0</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2016-11-08 10:36:17 +0000</bug_when>
    <thetext>bmaptool is integrated into oe-core image building system, but not many people are aware of what this tool is and how to use it.

We need to make changes that would simplify it&apos;s usage:
- generate .bmap files by default for oe images
- make it easier to use than currently
- update Yocto documentation and README.hardware providing usage info and explaining its benefits</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68897</commentid>
    <comment_count>1</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2016-12-07 13:50:51 +0000</bug_when>
    <thetext>Enabled generation of wic.bmap files for genericx86 and genericx86-64 machines: https://lists.yoctoproject.org/pipermail/poky/2016-December/010824.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68996</commentid>
    <comment_count>2</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2016-12-09 17:44:34 +0000</bug_when>
    <thetext>Enabled generation of wic.bmap files for Beaglebone: https://lists.yoctoproject.org/pipermail/poky/2016-December/010830.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68997</commentid>
    <comment_count>3</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2016-12-09 17:48:17 +0000</bug_when>
    <thetext>Enabled generation of wic.bmap for Edgerouter: http://lists.openembedded.org/pipermail/openembedded-core/2016-December/129984.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69035</commentid>
    <comment_count>4</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2016-12-12 12:44:11 +0000</bug_when>
    <thetext>Scott, I need your help in documenting bmaptool and suggesting it as a recommended way of flashing images.

My idea so far is to add new section &quot;2.4 Flashing images&quot; to Development manual and describe how to use bmaptool there.

Another place where it may make sense to mention bmaptool is &quot;5.9.6.1. Generate an Image using an Existing Kickstart File&apos;. Now only dd is mentioned there. Bmaptool should be mentioned first.

I&apos;d appreciate your suggestions on how to better put this in the documentation.

Here is a brief example of bmaptool usage for wic images (note that bmaptool can be used for other image types too):
 
1.       Put IMAGE_FSTYPES += &quot;wic wic.bmap&quot; into your local.conf
2.       Build core-image-minimal or any other image: bitbake &lt;image&gt;
3.       Flash image using bmap-tool to the media:
-          Easy way(if you have write access): oe-run-native bmap-tool copy ./tmp/deploy/images/qemux86-64/core-image-minimal-&lt;machine&gt;.wic /dev/sdX
-          A bit more complex way(if you don’t have write access):
o    sudo bash
o    PATH=tmp/sysroots/x86_64-linux/usr/bin/ bmaptool copy ./tmp/deploy/images/qemux86-64/core-image-minimal-&lt;machine&gt;.wic /dev/sdX
-          If you’re lucky user of Ubuntu 16.10 or Debian you can install bmaptool with apt-get install bmap-tools and use it without specifying PATH even from root account.

You can see comparison of flashing times for dd and bmaptool here:
http://lists.openembedded.org/pipermail/openembedded-core/2016-May/120834.html
 
And a feedback from happy bmaptool user:
http://lists.openembedded.org/pipermail/openembedded-core/2016-May/120934.html


I&apos;d be happy to answer any questions regarding this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69459</commentid>
    <comment_count>5</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2017-01-03 22:18:09 +0000</bug_when>
    <thetext>Hi Ed, 

See http://www.yoctoproject.org/docs/2.3/dev-manual/dev-manual.html#generate-an-image-using-a-provided-kickstart-file for a small additional example on flashing an image to some media.

Also, see http://www.yoctoproject.org/docs/2.3/dev-manual/dev-manual.html#flashing-images-using-bmap-tool for the new section on flashing an image using the bmap-tool.

One thing I am not sure of is the actual command... is it bmap-tool or bmaptool?

Anyway... give the changes a look and let me know how we can improve or correct them. 

Thanks, 
Scott

PS - I set the bug to IN PROGRESS REVIEW.  I am assuming it is just down to the docs now?  If not, then please reset the status appropriately.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69463</commentid>
    <comment_count>6</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2017-01-04 00:38:49 +0000</bug_when>
    <thetext>Ed, 

Applied your &apos;real-time&apos; edits over chat... Here are the links: 

http://www.yoctoproject.org/docs/2.3/dev-manual/dev-manual.html#generate-an-image-using-a-provided-kickstart-file 

http://www.yoctoproject.org/docs/2.3/dev-manual/dev-manual.html#flashing-images-using-bmap-tool

Since this is your bug Ed... you can mark it as RESOLVED when you want to  --- or if you find something else.. note it here. 

Thanks, 
Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69503</commentid>
    <comment_count>7</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2017-01-04 20:55:56 +0000</bug_when>
    <thetext>(In reply to comment #6)
Scott, thank you for documenting this!

Couple of suggestions:

1. I&apos;d change this to show that bmaptools is just one of two possible ways of flashing image to USB stick:

Continuing with the example, you can now write the image to a USB stick, or whatever media for which you built your image, and boot the resulting media.
This can be done using either bmaptool or dd:  

     $ oe-run-native bmaptool copy /var/tmp/wic/build/mkefidisk-201310230946-sda.direct /dev/sdX
                        
Note
For more information on how to use the bmaptool to flash an image, see the &quot;Flashing Images Using bmaptool&quot; section.

     $ sudo dd if=/var/tmp/wic/build/mkefidisk-201310230946-sda.direct of=/dev/sdX


Note: I changed /dev/sdb to /dev/sdX in dd command line and image path in bmfptool command line.

2. It&apos;d be better to change &apos;target device&apos; to &apos;media&apos; to avoid confusing USB media with a target embedded device:

&quot;If you have write access to the target device, use this command form:&quot; -&gt; &quot;If you have write access to the media, use this command form:&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69539</commentid>
    <comment_count>8</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2017-01-05 17:28:14 +0000</bug_when>
    <thetext>Ed, 

thanks for the additional comments:

http://www.yoctoproject.org/docs/2.3/dev-manual/dev-manual.html#generate-an-image-using-a-provided-kickstart-file

http://www.yoctoproject.org/docs/2.3/dev-manual/dev-manual.html#flashing-images-using-bmaptool

If these are acceptable, you can move the bug into RESOLVED and turn the doc flag to &quot;done.&quot;  Or, you just let me know and I will do that. 

Thanks, 
Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69616</commentid>
    <comment_count>9</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2017-01-09 11:02:04 +0000</bug_when>
    <thetext>Scott,

Thank you for updating the docs.

I still need to get couple of patches merged before I can close the bug. Most of them are already under test. I&apos;ll try to push maintainers to merge them fast.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69849</commentid>
    <comment_count>10</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2017-01-17 09:54:07 +0000</bug_when>
    <thetext>All patches have been accepted.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75817</commentid>
    <comment_count>11</comment_count>
    <who name="oscar lopez arandas">oscarx.lopez.arandas</who>
    <bug_when>2017-08-10 22:02:05 +0000</bug_when>
    <thetext>using same steps from http://www.yoctoproject.org/docs/2.3/dev-manual/dev-manual.html#flashing-images-using-bmaptool

If you are using Ubuntu or Debian distributions, you can install the bmap-tools package using the following command and then use the tool without specifying PATH even from the root account:

     $ sudo apt-get install bmap-tools

BUILD: 2.4 M2: rc3-9ed748a542b520c1cb763d981969233c0f5efd4e
ENVIRONMENT:ubuntu 16.04 lts
STEPS:                            
To use bmaptool to burn .wic
1. first download the two .wic images and the .wic.map in the same folder
2. make sure the usb is dismounting / dev / sdb
3.querem using bmaptool, with the following command.
 $ sudo bmaptool copy ./Downloads/nuc/core-image-sato-sdk-genericx86-64.wic / dev / sdb
4. use the command to make sure that all information is synchronized
 ~ $ sync

============================================================================
oscar@oscar:~$ umount /media/oscar/9415-B91F 
oscar@oscar:~$ sudo bmaptool copy ./Downloads/nuc/core-image-sato-sdk-genericx86-64.wic /dev/sdb
bmaptool: info: discovered bmap file &apos;./Downloads/nuc/core-image-sato-sdk-genericx86-64.wic.bmap&apos;
bmaptool: info: block map format version 2.0
bmaptool: info: 1115443 blocks of size 4096 (4.3 GiB), mapped 633712 blocks (2.4 GiB or 56.8%)
bmaptool: info: copying image &apos;core-image-sato-sdk-genericx86-64.wic&apos; to block device &apos;/dev/sdb&apos; using bmap file &apos;core-image-sato-sdk-genericx86-64.wic.bmap&apos;
bmaptool: info: 100% copied
bmaptool: info: synchronizing &apos;/dev/sdb&apos;
bmaptool: info: copying time: 4m 4.5s, copying speed 10.1 MiB/sec
oscar@oscar:~$ sync
================================================================================</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>