<?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>7672</bug_id>
          
          <creation_ts>2015-04-28 10:39:07 +0000</creation_ts>
          <short_desc>Allow automating running wic from the build system</short_desc>
          <delta_ts>2015-09-21 13:11:07 +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>1.9</version>
          <rep_platform>All</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</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>1.9</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Paul Eggleton">bluelightning</reporter>
          <assigned_to name="Igor Stoppa">igor.stoppa</assigned_to>
          <cc>alexander.kanevskiy</cc>
    
    <cc>andrei</cc>
    
    <cc>bogdanx.a.voiculescu</cc>
    
    <cc>igor.stoppa</cc>
    
    <cc>kergoth</cc>
    
    <cc>noor_ahsan</cc>
    
    <cc>ross.burton</cc>
          
          <qa_contact name="Daniel Istrate">daniel.alexandrux.istrate</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>50547</commentid>
    <comment_count>0</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2015-04-28 10:39:07 +0000</bug_when>
    <thetext>At the moment if you want to use wic to generate a more complicated image file (as opposed to using it to write directly to some external media e.g. an SD card), having to run wic manually at the end of every build isn&apos;t ideal. It would be great if we could have a way of running it automatically from the build, perhaps by adding an additional class that you can inherit that would wrap around wic, giving you the ability to control how it is run through additional variables.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50614</commentid>
    <comment_count>1</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2015-04-29 16:13:40 +0000</bug_when>
    <thetext>It&apos;s done a bit different way, but the result is the same, i.e. you don&apos;t need to run bitbake and then wic.

Here is how it&apos;s done: http://cgit.openembedded.org/openembedded-core/commit/?id=75ae0b7cf3863eb2857a2b6a7073beea626f751d

Please, let me know if this solution is ok for you.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50763</commentid>
    <comment_count>2</comment_count>
    <who name="Igor Stoppa">igor.stoppa</who>
    <bug_when>2015-05-04 19:07:57 +0000</bug_when>
    <thetext>I also would prefer that wic creates the image as part of the bb execution.

Reasons for this:

1) running wic after bb would require a duplication of the logic used to iterate over the possible image types

2) calling bb from wic would be even worse, as it would effectively void the optimizations that bb can do when there are multiple image targets.

3) architecturally, it seems anyway the proper choice, as bb is already capable of building images, albeit in a very limited variety (1), so it would seem only natural to extend the current capability by replacing the current image creator with wic, which should behave like a blackbox for current users and enhance the experience of users in need of more complex partition setup.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50783</commentid>
    <comment_count>3</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2015-05-05 11:22:59 +0000</bug_when>
    <thetext>This feature will be implemented this way:

if IMAGE_FSTYPES contains &quot;wic&quot; bitbake will call &quot;wic create &lt;wic image&gt; -e bitbake target&gt;&quot;

where &lt;bitbake target&gt; is a name of bitbake image target
       &lt;wic image&gt; is a name from the space separated list WIC_WKSFILES specified in &lt;bitbake target&gt;.bb

.wks files should be put to the same location with &lt;bitbake target&gt;.bb, i.e. to meta*/recipes*/images/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50790</commentid>
    <comment_count>4</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2015-05-05 14:40:29 +0000</bug_when>
    <thetext>moved to 1.9</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>51391</commentid>
    <comment_count>5</comment_count>
    <who name="Igor Stoppa">igor.stoppa</who>
    <bug_when>2015-06-01 15:33:49 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; This feature will be implemented this way:
&gt; 
&gt; if IMAGE_FSTYPES contains &quot;wic&quot; bitbake will call &quot;wic create &lt;wic image&gt; -e
&gt; bitbake target&gt;&quot;
&gt; 
&gt; where &lt;bitbake target&gt; is a name of bitbake image target
&gt;        &lt;wic image&gt; is a name from the space separated list WIC_WKSFILES
&gt; specified in &lt;bitbake target&gt;.bb
&gt; 
&gt; .wks files should be put to the same location with &lt;bitbake target&gt;.bb, i.e.
&gt; to meta*/recipes*/images/

I do not like this solution, at least not as final one, because wic should be _the_ way to create real images.
So it should not be necessary to say that the image type is wic.

For example the so called hddimg that is currently produced fro mthe ready-made recipes, is nothing more than a vfat partition.

Similarly, there is a pollution of recipes doing basically the same stuff (ex: populate a FAT32 partition), each in its own way.
And for what I could see, none of them uses the pre-defined recipes.

The solution you are proposing doesn&apos;t seem to be any different.

What I would like to have, for a clean implementation, is a recipe which creates and populates one or more directories, each of them corresponding to a partition.

Then wic should be called with a .wks file which describes, for each directory, in which type and size of partition it should go.

And it should be possible to create empty partitions, w/ and w/o filesystem.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>51605</commentid>
    <comment_count>6</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2015-06-10 11:18:39 +0000</bug_when>
    <thetext>It&apos;s not final solution of course. However, we can&apos;t just replace non-partitioned images produced by bitbake now with partitioned images produced by wic. We should be able to support both types at least for some time.(In reply to comment #5)
&gt; (In reply to comment #3)
&gt; &gt; This feature will be implemented this way:
&gt; &gt; 
&gt; &gt; if IMAGE_FSTYPES contains &quot;wic&quot; bitbake will call &quot;wic create &lt;wic image&gt; -e
&gt; &gt; bitbake target&gt;&quot;
&gt; &gt; 
&gt; &gt; where &lt;bitbake target&gt; is a name of bitbake image target
&gt; &gt;        &lt;wic image&gt; is a name from the space separated list WIC_WKSFILES
&gt; &gt; specified in &lt;bitbake target&gt;.bb
&gt; &gt; 
&gt; &gt; .wks files should be put to the same location with &lt;bitbake target&gt;.bb, i.e.
&gt; &gt; to meta*/recipes*/images/
&gt; 
&gt; I do not like this solution, at least not as final one, because wic should
&gt; be _the_ way to create real images.

It&apos;s not final solution of course. However, we can&apos;t just replace non-partitioned images produced by bitbake now with partitioned images produced by wic. We should be able to support both types at least for some time.

&gt; So it should not be necessary to say that the image type is wic.
&gt;
&gt; For example the so called hddimg that is currently produced fro mthe
&gt; ready-made recipes, is nothing more than a vfat partition.
&gt; 
It is a bootable image and we should continue support this.


&gt; Similarly, there is a pollution of recipes doing basically the same stuff
&gt; (ex: populate a FAT32 partition), each in its own way.
&gt; And for what I could see, none of them uses the pre-defined recipes.
&gt; 
&gt; The solution you are proposing doesn&apos;t seem to be any different.
&gt; 
I don&apos;t understand this. Of course it&apos;s different as it will produce partitioned images.

&gt; What I would like to have, for a clean implementation, is a recipe which
&gt; creates and populates one or more directories, each of them corresponding to
&gt; a partition.
&gt; 
Perfect. But this doesn&apos;t mean that we should break existing recipes. At least not before we have working solution. That&apos;s why introducing &apos;wic&apos; image types should make it possible to build both types of images.  

&gt; Then wic should be called with a .wks file which describes, for each
&gt; directory, in which type and size of partition it should go.
&gt; 
Yes, but how that conflicts with proposed solution?

&gt; And it should be possible to create empty partitions, w/ and w/o filesystem.
I think it&apos;s already possible. At least there is bug 7131 about documenting it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53269</commentid>
    <comment_count>7</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2015-08-20 13:58:00 +0000</bug_when>
    <thetext>Please review: http://lists.openembedded.org/pipermail/openembedded-core/2015-August/109069.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53436</commentid>
    <comment_count>8</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2015-08-26 16:52:41 +0000</bug_when>
    <thetext>Updated patch: http://lists.openembedded.org/pipermail/openembedded-core/2015-August/109340.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53559</commentid>
    <comment_count>9</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2015-08-31 09:41:10 +0000</bug_when>
    <thetext>Changes have been merged to master: http://cgit.openembedded.org/openembedded-core/commit/?id=173d440c14ee3140ae08c6a87decc9b2f4c9e391</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53560</commentid>
    <comment_count>10</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2015-08-31 09:42:10 +0000</bug_when>
    <thetext>Assigned to Igor for verification.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54380</commentid>
    <comment_count>11</comment_count>
    <who name="Daniel Istrate">daniel.alexandrux.istrate</who>
    <bug_when>2015-09-21 13:11:07 +0000</bug_when>
    <thetext>Verified on master: 7b86c771c80d0759c2ca0e57c46c4c966f89c49e

There is a recipe: ./meta-selftest/recipes-test/images/wic-image-minimal.bb which has a wks file associated ./meta-selftest/recipes-test/images/wic-image-minimal.wks

This allows you to build a wic image from within bitbake:

bitbake wic-image-minimal

which deploys the images to:
tmp/deploy/images/genericx86-64/wic-image-minimal-genericx86-64*</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>