Skip to contentSkip to conversation

wic: rawcopy: Copy source file to build folder

PATCH In review Ed Bartosh 2 participants 2 messages Dec 23, 2015 – Dec 24, 2015

lore
Share & tools
lore

Ed Bartosh

author
#0 lore raw

PATCH 1/1 wic: rawcopy: Copy source file to build folder

From: Noor Ahsan <[email protected]>

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]

---
 scripts/lib/wic/plugins/source/rawcopy.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
scripts/lib/wic/plugins/source/rawcopy.py +4 -3
index f0691ba..0472f53 100644
@@ -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
Signature · 1 line
2.1.4
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Ed Bartosh

From: Noor Ahsan <[email protected]>

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.

Quoted 4 lines

[YOCTO #8854]

Thanks Ed,

I've verified this patch resolves the issue.

Quoted 36 lines
---
 scripts/lib/wic/plugins/source/rawcopy.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
scripts/lib/wic/plugins/source/rawcopy.py +4 -4
index f0691ba..0472f53 100644
@@ -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

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core