<?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>8854</bug_id>
          
          <creation_ts>2015-12-22 21:43:26 +0000</creation_ts>
          <short_desc>wic rawcopy plugin consumes source, doesn&apos;t copy (or the case of files going missing from my deploy dir…)</short_desc>
          <delta_ts>2016-02-08 16:14:35 +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.0</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.1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Joshua Lock">joshuagloe</reporter>
          <assigned_to name="Ed Bartosh">eduard.bartosh</assigned_to>
          <cc>bogdanx.a.voiculescu</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>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>57442</commentid>
    <comment_count>0</comment_count>
    <who name="Joshua Lock">joshuagloe</who>
    <bug_when>2015-12-22 21:43:26 +0000</bug_when>
    <thetext>After switching to using wic (and the image_types.bbclass function IMAGE_CMD_wic) I noticed that the source file I pass to the rawcopy plugin keeps going missing after the image is constructed.

This is because:
- if &apos;skip&apos; isn&apos;t in the source parameters the partition source_file is set to the &apos;file&apos; parameter in rawcopy.py&apos;s do_prepare_partition() method
- during the assemble() method of partitionedfs.py each partition source is renamed to ${OUTDIR}/${IMAGE_FILENAME}.p${PART_NUM} after it has been installed into the image
- after the image is assembled and copied to the deploy directory the IMAGE_CMD_wic removes the wic output directory, deleting all of the partition sources

The end result here is that a source passed to the rawcopy plugin is moved (pretty bad) and possibly deleted (very bad) depending on how wic is used.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57462</commentid>
    <comment_count>1</comment_count>
      <attachid>2912</attachid>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2015-12-23 12:27:23 +0000</bug_when>
    <thetext>Created attachment 2912
possible fix

I&apos;ve attached slightly modified change made by Noor Ahsan http://lists.openembedded.org/pipermail/openembedded-core/2015-October/111831.html

Can you please check if it fixes the issue?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57463</commentid>
    <comment_count>2</comment_count>
      <attachid>2913</attachid>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2015-12-23 12:32:05 +0000</bug_when>
    <thetext>Created attachment 2913
possible fix v.2

Attached slightly modified patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57465</commentid>
    <comment_count>3</comment_count>
    <who name="Joshua Lock">joshuagloe</who>
    <bug_when>2015-12-23 13:59:07 +0000</bug_when>
    <thetext>Hi Ed,

This patch does seem to work I&apos;ve just tested this patch. I have built two images in a row and the source file of the rawcopy remains in my DEPLOY_IMAGE_DIR.

Regards,

Joshua</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57466</commentid>
    <comment_count>4</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2015-12-23 14:23:57 +0000</bug_when>
    <thetext>Hi Joshua,
Thank you for testing the patch!

I&apos;ve just sent it for review: http://lists.openembedded.org/pipermail/openembedded-core/2015-December/114602.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57669</commentid>
    <comment_count>5</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2016-01-08 11:19:14 +0000</bug_when>
    <thetext>The fix has been merged to master: http://cgit.openembedded.org/openembedded-core/commit/?id=33c52b1f2d39feb641465bf42e8b16d0ab22a316</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="0"
              isprivate="0"
          >
            <attachid>2912</attachid>
            <date>2015-12-23 12:27:23 +0000</date>
            <delta_ts>2015-12-23 12:32:05 +0000</delta_ts>
            <desc>possible fix</desc>
            <filename>file_8854.txt</filename>
            <type>text/plain</type>
            <size>790</size>
            <attacher name="Ed Bartosh">eduard.bartosh</attacher>
            
              <data encoding="base64">LS0tIGEvc2NyaXB0cy9saWIvd2ljL3BsdWdpbnMvc291cmNlL3Jhd2NvcHkucHkNCisrKyBiL3Nj
cmlwdHMvbGliL3dpYy9wbHVnaW5zL3NvdXJjZS9yYXdjb3B5LnB5DQpAQCAtNjcsMTMgKzY3LDE1
IEBAIGNsYXNzIFJhd0NvcHlQbHVnaW4oU291cmNlUGx1Z2luKToNCiAgICAgICAgICAgICByZXR1
cm4NCg0KICAgICAgICAgc3JjID0gb3MucGF0aC5qb2luKGJvb3RpbWdfZGlyLCBzb3VyY2VfcGFy
YW1zWydmaWxlJ10pDQotICAgICAgICBkc3QgPSBzcmMNCisgICAgICAgIGRzdCA9IG9zLnBhdGgu
am9pbihjcl93b3JrZGlyLCBzb3VyY2VfcGFyYW1zWydmaWxlJ10pDQoNCiAgICAgICAgIGlmICdz
a2lwJyBpbiBzb3VyY2VfcGFyYW1zOg0KLSAgICAgICAgICAgIGRzdCA9IG9zLnBhdGguam9pbihj
cl93b3JrZGlyLCBzb3VyY2VfcGFyYW1zWydmaWxlJ10pDQogICAgICAgICAgICAgZGRfY21kID0g
ImRkIGlmPSVzIG9mPSVzIGlicz0lcyBza2lwPTEgY29udj1ub3RydW5jIiAlIFwNCiAgICAgICAg
ICAgICAgICAgICAgIChzcmMsIGRzdCwgc291cmNlX3BhcmFtc1snc2tpcCddKQ0KICAgICAgICAg
ICAgIGV4ZWNfY21kKGRkX2NtZCkNCisgICAgICAgIGVsc2U6DQorICAgICAgICAgICAgZGRfY21k
ID0gImNwICVzICVzIiAlIChzcmMsIGRzdCkNCisgICAgICAgICAgICBleGVjX2NtZChkZF9jbWQp
DQoNCiAgICAgICAgICMgZ2V0IHRoZSBzaXplIGluIHRoZSByaWdodCB1bml0cyBmb3Iga2lja3N0
YXJ0IChrQikNCiAgICAgICAgIGR1X2NtZCA9ICJkdSAtTGJrcyAlcyIgJSBkc3QNCg==
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>2913</attachid>
            <date>2015-12-23 12:32:05 +0000</date>
            <delta_ts>2015-12-23 12:32:05 +0000</delta_ts>
            <desc>possible fix v.2</desc>
            <filename>file_8854.txt</filename>
            <type>text/plain</type>
            <size>786</size>
            <attacher name="Ed Bartosh">eduard.bartosh</attacher>
            
              <data encoding="base64">LS0tIGEvc2NyaXB0cy9saWIvd2ljL3BsdWdpbnMvc291cmNlL3Jhd2NvcHkucHkNCisrKyBiL3Nj
cmlwdHMvbGliL3dpYy9wbHVnaW5zL3NvdXJjZS9yYXdjb3B5LnB5DQpAQCAtNjcsMTMgKzY3LDE0
IEBAIGNsYXNzIFJhd0NvcHlQbHVnaW4oU291cmNlUGx1Z2luKToNCiAgICAgICAgICAgICByZXR1
cm4NCg0KICAgICAgICAgc3JjID0gb3MucGF0aC5qb2luKGJvb3RpbWdfZGlyLCBzb3VyY2VfcGFy
YW1zWydmaWxlJ10pDQotICAgICAgICBkc3QgPSBzcmMNCisgICAgICAgIGRzdCA9IG9zLnBhdGgu
am9pbihjcl93b3JrZGlyLCBzb3VyY2VfcGFyYW1zWydmaWxlJ10pDQoNCiAgICAgICAgIGlmICdz
a2lwJyBpbiBzb3VyY2VfcGFyYW1zOg0KLSAgICAgICAgICAgIGRzdCA9IG9zLnBhdGguam9pbihj
cl93b3JrZGlyLCBzb3VyY2VfcGFyYW1zWydmaWxlJ10pDQogICAgICAgICAgICAgZGRfY21kID0g
ImRkIGlmPSVzIG9mPSVzIGlicz0lcyBza2lwPTEgY29udj1ub3RydW5jIiAlIFwNCiAgICAgICAg
ICAgICAgICAgICAgIChzcmMsIGRzdCwgc291cmNlX3BhcmFtc1snc2tpcCddKQ0KLSAgICAgICAg
ICAgIGV4ZWNfY21kKGRkX2NtZCkNCisgICAgICAgIGVsc2U6DQorICAgICAgICAgICAgZGRfY21k
ID0gImNwICVzICVzIiAlIChzcmMsIGRzdCkNCisgICAgICAgIGV4ZWNfY21kKGRkX2NtZCkNCg0K
ICAgICAgICAgIyBnZXQgdGhlIHNpemUgaW4gdGhlIHJpZ2h0IHVuaXRzIGZvciBraWNrc3RhcnQg
KGtCKQ0KICAgICAgICAgZHVfY21kID0gImR1IC1MYmtzICVzIiAlIGRzdA0K
</data>

          </attachment>
      

    </bug>

</bugzilla>