Openembedded Core Discussions
 help / color / mirror / Atom feed
* [wic][PATCH] wic: rawcopy: Copy source file to build folder
@ 2015-12-23 13:50 Ed Bartosh
  2015-12-24 10:02 ` Joshua Lock
  0 siblings, 1 reply; 2+ messages in thread
From: Ed Bartosh @ 2015-12-23 13:50 UTC (permalink / raw)
  To: openembedded-core; +Cc: Joshua Lock

From: Noor Ahsan <noor_ahsan@mentor.com>

When a file is given using --sourceparams then wic directly use that file
instead of copying them to build folder. At time of assembling it os.rename
is called which renames all the files to name. In that process the original
file is renamed. When image recipe is rebuilt then wic complains about
missing file which was renamed in previous build.

[YOCTO #8854]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
 scripts/lib/wic/plugins/source/rawcopy.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/scripts/lib/wic/plugins/source/rawcopy.py b/scripts/lib/wic/plugins/source/rawcopy.py
index f0691ba..0472f53 100644
--- a/scripts/lib/wic/plugins/source/rawcopy.py
+++ b/scripts/lib/wic/plugins/source/rawcopy.py
@@ -67,13 +67,14 @@ class RawCopyPlugin(SourcePlugin):
             return
 
         src = os.path.join(bootimg_dir, source_params['file'])
-        dst = src
+        dst = os.path.join(cr_workdir, source_params['file'])
 
         if 'skip' in source_params:
-            dst = os.path.join(cr_workdir, source_params['file'])
             dd_cmd = "dd if=%s of=%s ibs=%s skip=1 conv=notrunc" % \
                     (src, dst, source_params['skip'])
-            exec_cmd(dd_cmd)
+        else:
+            dd_cmd = "cp %s %s" % (src, dst)
+        exec_cmd(dd_cmd)
 
         # get the size in the right units for kickstart (kB)
         du_cmd = "du -Lbks %s" % dst
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-12-24 10:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-23 13:50 [wic][PATCH] wic: rawcopy: Copy source file to build folder Ed Bartosh
2015-12-24 10:02 ` Joshua Lock

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox