<?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>9414</bug_id>
          
          <creation_ts>2016-04-07 09:04:21 +0000</creation_ts>
          <short_desc>add support for bmap-tools</short_desc>
          <delta_ts>2016-05-19 12:59:33 +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>2.2</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>2.2 M1</target_milestone>
          
          <blocked>9413</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Ed Bartosh">eduard.bartosh</reporter>
          <assigned_to name="Ed Bartosh">eduard.bartosh</assigned_to>
          <cc>alexander.kanevskiy</cc>
    
    <cc>bluelightning</cc>
    
    <cc>jose.perez.carranza</cc>
    
    <cc>joshuagloe</cc>
    
    <cc>kergoth</cc>
          
          <qa_contact name="Francisco Pedraza">francisco.j.pedraza.gonzalez</qa_contact>
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Yes (doc changes required)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>60892</commentid>
    <comment_count>0</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2016-04-07 09:04:21 +0000</bug_when>
    <thetext>bmap-tools(https://github.com/01org/bmap-tools/tree/master/docs) is a set of generic tools for creating the block map (bmap) for a file, 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 &quot;dd&quot; or &quot;cp&quot;.

There is ongoing work in this area in Ostro project: https://github.com/ostroproject/meta-ostro/pull/70/commits that can be reused and should make the task of bringing bmap-tools support to yocto/oe-core much simpler.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>61687</commentid>
    <comment_count>1</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2016-04-26 12:49:00 +0000</bug_when>
    <thetext>Patchset has been sent for review: http://lists.openembedded.org/pipermail/openembedded-core/2016-April/thread.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>61715</commentid>
    <comment_count>2</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2016-04-27 11:32:01 +0000</bug_when>
    <thetext>The recipe is failing when MACHINE is changed:
$ bitbake bmap-tools-native
WARNING: Host distribution &quot;openSUSE-13.2&quot; has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.
Parsing recipes: 100% |########################################################################################################| Time: 00:00:11
Parsing of 882 .bb files complete (0 cached, 882 parsed). 1314 targets, 44 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION        = &quot;1.30.0&quot;
BUILD_SYS         = &quot;x86_64-linux&quot;
NATIVELSBSTRING   = &quot;universal&quot;
TARGET_SYS        = &quot;x86_64-poky-linux&quot;
MACHINE           = &quot;genericx86-64&quot;
DISTRO            = &quot;poky&quot;
DISTRO_VERSION    = &quot;2.1&quot;
TUNE_FEATURES     = &quot;m64 core2&quot;
TARGET_FPU        = &quot;&quot;
meta
meta-poky
meta-yocto-bsp
meta-selftest     = &quot;ed/oe-core/bmap-tools-9414:7416c3ba19f26fe6eea485fefad4db4881f829ad&quot;

NOTE: Preparing RunQueue
NOTE: Executing SetScene Tasks
ERROR: bmap-tools-native-3.2-r0 do_deploy_setscene: The recipe bmap-tools-native is trying to install files into a shared area when those files already exist. Those files and their manifest location are:
   /home/ed/git/yocto/poky/build/tmp/deploy/tools/bmaptool-3.2
 Matched in manifest-qemux86-64-bmap-tools-native.deploy
 /home/ed/git/yocto/poky/build/tmp/deploy/tools/bmaptool
 Matched in manifest-qemux86-64-bmap-tools-native.deploy
Please verify which recipe should provide the above files.

I&apos;ll remove preparing standalone binary and installing it into tmp/deploy/tools from the recipe. the tool still can be run as any native oe tool, so removing standalone version doesn&apos;t influence anything.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>61718</commentid>
    <comment_count>3</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2016-04-27 12:35:14 +0000</bug_when>
    <thetext>sent v2 for review: http://lists.openembedded.org/pipermail/openembedded-core/2016-April/120687.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>61816</commentid>
    <comment_count>4</comment_count>
    <who name="Alexander Kanevskiy">alexander.kanevskiy</who>
    <bug_when>2016-04-28 22:06:05 +0000</bug_when>
    <thetext>better to add &quot;inherit allarch&quot; than removing standalone version of tool.
Otherwise, user end-up in situation where bmap created, but there is no easily usable tool to use generated bmap for the image.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>61817</commentid>
    <comment_count>5</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2016-04-28 23:05:16 +0000</bug_when>
    <thetext>For reference, the ostro recipe (with do_deploy) is here:

https://raw.githubusercontent.com/ostroproject/meta-ostro/master/meta-ostro/recipes-devtools/bmap-tools/bmap-tools_3.2.bb</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>61821</commentid>
    <comment_count>6</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2016-04-29 04:21:03 +0000</bug_when>
    <thetext>I figured out the issue with the do_deploy error above - since the bmap-tools recipe is doing this in a non-machine-specific manner it should set the following:

do_deploy[stamp-extra-info] = &quot;&quot;

This overrides the default value of &quot;${MACHINE}&quot; set in deploy.bbclass which causes the task to re-execute when MACHINE changes (since what&apos;s in stamp-extra-info gets added to the name of the stamp file, so if it changes it doesn&apos;t see that it&apos;s stamped as already having been completed).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>61822</commentid>
    <comment_count>7</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2016-04-29 04:22:01 +0000</bug_when>
    <thetext>I should mention also, inherit allarch would not be appropriate for this recipe - when building for the target it *is* arch-dependent.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>61823</commentid>
    <comment_count>8</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2016-04-29 04:24:47 +0000</bug_when>
    <thetext>For clarification, the reason it&apos;s arch-dependent (even though it&apos;s written in an arch-independent scripting language) is that the signature depends on python which will rebuild for the target architecture and thus influence the signature of tasks within this recipe; this is something we don&apos;t currently optimise for.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>61835</commentid>
    <comment_count>9</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2016-05-02 07:15:49 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; better to add &quot;inherit allarch&quot; than removing standalone version of tool.
&gt; Otherwise, user end-up in situation where bmap created, but there is no
&gt; easily usable tool to use generated bmap for the image.

I can run the tool this way: PATH=tmp/sysroots/x86_64-linux/usr/bin/ bmaptool. It works just fine.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>61841</commentid>
    <comment_count>10</comment_count>
    <who name="Alexander Kanevskiy">alexander.kanevskiy</who>
    <bug_when>2016-05-02 10:46:58 +0000</bug_when>
    <thetext>I wouldn&apos;t call this method of tool invocation as &quot;convenient&quot; :)
Better to fix recipe, especially, because one line fix available from Paul.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>61885</commentid>
    <comment_count>11</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2016-05-03 10:20:14 +0000</bug_when>
    <thetext>Sent v3 for review: http://lists.openembedded.org/pipermail/openembedded-core/2016-May/120834.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>61888</commentid>
    <comment_count>12</comment_count>
    <who name="Alexander Kanevskiy">alexander.kanevskiy</who>
    <bug_when>2016-05-03 11:31:10 +0000</bug_when>
    <thetext>there is no much sense to separate bmap-tools recipe into two commits, but end result is ok.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62286</commentid>
    <comment_count>13</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2016-05-18 12:48:54 +0000</bug_when>
    <thetext>There are at least 3 concerns about standalone script mentioned on the mailing list:
http://lists.openembedded.org/pipermail/openembedded-core/2016-May/120921.html
http://lists.openembedded.org/pipermail/openembedded-core/2016-May/120922.html
http://lists.openembedded.org/pipermail/openembedded-core/2016-May/121472.html

I&apos;d propose to fix standalone script generation and send it for review separately.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62288</commentid>
    <comment_count>14</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2016-05-18 12:49:58 +0000</bug_when>
    <thetext>The core functionality has been accepted to poky master. I think it&apos;s enough to resolve this issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62314</commentid>
    <comment_count>15</comment_count>
    <who name="Alexander Kanevskiy">alexander.kanevskiy</who>
    <bug_when>2016-05-19 10:52:27 +0000</bug_when>
    <thetext>For issue mentioned in http://lists.openembedded.org/pipermail/openembedded-core/2016-May/121472.html I had chance to talk directly with Richard. Common understanding that it should be changed to
&quot;addtask deploy before do_build after do_install&quot;

As for other comments from Chris, we need to revisit how tool is used in wic code.
My understanding so far was that it uses python library from sysroot, not the standalone tool from deploy dir. Is it so Ed ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62315</commentid>
    <comment_count>16</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2016-05-19 12:17:56 +0000</bug_when>
    <thetext>wic is calling native bmaptool to generate .bmap file:
   exec_native_cmd(&quot;bmaptool create %s -o %s.bmap&quot; % (full_path, full_path),
                    self.native_sysroot)

However, I&apos;m not sure Chris is talking about wic in his comment:

You&apos;re right that this is very handy, but we hit a problem when building
from shared state. This uses do_deploy to deploy bmaptool into
DEPLOY_DIR_IMAGE, but IMAGE_DEPENDS only depends on do_populate_sysroot,
not do_deploy, so an image build from sstate won&apos;t write this script out.

I&apos;m also concerned about Richard saying in his comment:
I&apos;m not sure if we want to do this in the first place.

I think it&apos;s better to discuss this with Richard and Chris before sending the patch again.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62316</commentid>
    <comment_count>17</comment_count>
    <who name="Alexander Kanevskiy">alexander.kanevskiy</who>
    <bug_when>2016-05-19 12:46:22 +0000</bug_when>
    <thetext>That&apos;s very interesting. Ed, from your code it seems that you&apos;re calling native version of the tool and it is executed from native sysroot. thus, it should be correct usage, and it shouldn&apos;t be dependant on any content in deploy directory...
Thus, dependency on do_populate_sysroot is expected one...

Are you able to reproduce same error as Chris having with building image from sstate ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62317</commentid>
    <comment_count>18</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2016-05-19 12:59:33 +0000</bug_when>
    <thetext>No, I didn&apos;t try to reproduce it.

Chris, can you show us how to reproduce the issue with standalone bmaptool script you&apos;re talking about here http://lists.openembedded.org/pipermail/openembedded-core/2016-May/120921.html ?</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>