<?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>12173</bug_id>
          
          <creation_ts>2017-10-03 22:10:26 +0000</creation_ts>
          <short_desc>wic cp,rm,ls of a partition e.g. ic ls myimage.wic:1/ fails if host mtools are not installed</short_desc>
          <delta_ts>2017-11-06 00:19:19 +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>Scripts and Tools</component>
          <version>2.4</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>normal</bug_severity>
          <target_milestone>2.5 M1</target_milestone>
          
          <blocked>12176</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="brian avery">brian.avery</reporter>
          <assigned_to name="Saul Wold">sgw</assigned_to>
          <cc>eduard.bartosh</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>ross.burton</cc>
    
    <cc>sgw</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>77321</commentid>
    <comment_count>0</comment_count>
    <who name="brian avery">brian.avery</who>
    <bug_when>2017-10-03 22:10:26 +0000</bug_when>
    <thetext>Wic does depend on mtools-native and mtools-native does get built.  
$ wic ls myimage.wic 
lists partitions even if mtools is not installed on the host. This is because it is just using /bin/parted. Unfortunately, 
$ wic ls myimage.wic:1 
fails if mtools is not installed as a host package. Turns out that we are using /usr/bin/mdir.  If mtools is not installed on the host we get error:
ERROR: BB Cannot run command: None, lost dependency?

We should fix wic to use the mtools-native for these commands.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77627</commentid>
    <comment_count>1</comment_count>
    <who name="Saul Wold">sgw</who>
    <bug_when>2017-10-17 04:21:06 +0000</bug_when>
    <thetext>There was some missing commands in the command matching code, but also it turns out that you MUST set the native_sysroot for all the new commands, it does not currently use the same bitbake -e parsing as does the wic_create command does.

I think that the parsing should be done for all commands, but it will slow things down unless bitbake-server setup is fully used.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77652</commentid>
    <comment_count>2</comment_count>
    <who name="Saul Wold">sgw</who>
    <bug_when>2017-10-17 22:53:44 +0000</bug_when>
    <thetext>wic needs a simpler method of determining it&apos;s NATIVE_SYSROOT for the simpler commands (ls, cp, rm, ...) when operating on an image to change the kernel for example.

I am open to suggestions on this one.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77654</commentid>
    <comment_count>3</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2017-10-18 08:44:08 +0000</bug_when>
    <thetext>The ideas was to either allow wic to use host tools or use native sysroot specified by user. So, used doesn&apos;t have to specify native sysroot.

One of the way to improve this is to make wic to use wic-tools native sys root as a default for wic (cp, ls, rm) commands.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77658</commentid>
    <comment_count>4</comment_count>
    <who name="brian avery">brian.avery</who>
    <bug_when>2017-10-18 16:14:35 +0000</bug_when>
    <thetext>i like the native sysroot approach, but bitbake -e is pretty slow to run for each command. any ideas on a quicker way to get the native sysroot location quickly &amp;/or a way to find it once and reuse it?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77686</commentid>
    <comment_count>5</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2017-10-19 08:49:45 +0000</bug_when>
    <thetext>why would we want to run bitbake -e for every command?

When implementing this I thought that most of the users would use host tools. For those who want to use native tools I implemented -n option to specify native sysroot.

If wic is going to be run from other scripts those scripts should make sure the tools are built and provide native sysroot path to wic.

There are couple of things that we discussed on irc:
Richard suggested to use bitbake -e -b &lt;recipe&gt;, which is much faster than bitbake -e.
bitbake server is going to speed up this a lot. We can just wait for it a bit.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77708</commentid>
    <comment_count>6</comment_count>
    <who name="Saul Wold">sgw</who>
    <bug_when>2017-10-19 14:58:02 +0000</bug_when>
    <thetext>Further investigation with the combination of bitbake-server and bitbake -e -b wic-tools, that provides the native sysroot info in about 1s, so that overhead is low enough I think.

Regarding using the host tools, it&apos;s been mentioned before that the host tools may not behave the same as our native tools, therefore it&apos;s safer and more consistent to use the native tools to ensure consistency even if it means a slightly longer startup time.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77877</commentid>
    <comment_count>7</comment_count>
    <who name="Saul Wold">sgw</who>
    <bug_when>2017-10-30 20:19:07 +0000</bug_when>
    <thetext>Patches posted</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77969</commentid>
    <comment_count>8</comment_count>
    <who name="Saul Wold">sgw</who>
    <bug_when>2017-11-06 00:19:19 +0000</bug_when>
    <thetext>http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=d0bb833ec7cdfb457c3cabfffaf5ae2896aa148a</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>