Bug 8854

Summary: wic rawcopy plugin consumes source, doesn't copy (or the case of files going missing from my deploy dir…)
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Joshua Lock <joshuagloe>
Component: Scripts and ToolsAssignee: Ed Bartosh <eduard.bartosh>
Status: RESOLVED FIXED QA Contact: Daniel Istrate <daniel.alexandrux.istrate>
Severity: normal    
Priority: Medium CC: bogdanx.a.voiculescu, ross.burton
Version: 2.0   
Target Milestone: 2.1   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Attachments:
Description Flags
possible fix
none
possible fix v.2 none

Description Joshua Lock 2015-12-22 21:43:26 UTC
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 'skip' isn't in the source parameters the partition source_file is set to the 'file' parameter in rawcopy.py'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.
Comment 1 Ed Bartosh 2015-12-23 12:27:23 UTC
Created attachment 2912 [details]
possible fix

I'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?
Comment 2 Ed Bartosh 2015-12-23 12:32:05 UTC
Created attachment 2913 [details]
possible fix v.2

Attached slightly modified patch.
Comment 3 Joshua Lock 2015-12-23 13:59:07 UTC
Hi Ed,

This patch does seem to work I'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
Comment 4 Ed Bartosh 2015-12-23 14:23:57 UTC
Hi Joshua,
Thank you for testing the patch!

I've just sent it for review: http://lists.openembedded.org/pipermail/openembedded-core/2015-December/114602.html
Comment 5 Ed Bartosh 2016-01-08 11:19:14 UTC
The fix has been merged to master: http://cgit.openembedded.org/openembedded-core/commit/?id=33c52b1f2d39feb641465bf42e8b16d0ab22a316