Skip to contentSkip to conversation

wic: rawcopy: make source filenames unique

PATCH New Ed Bartosh 1 participant 1 message Jun 30, 2016

lore
Share & tools
lore

Ed Bartosh

author
#0 lore raw

PATCH 1/1 wic: rawcopy: make source filenames unique

Rawcopy plugin copies source files to build folder before using them to assemble result image. After assembling the image wic renames source files to <image>.p<partition number>. If the same source file is used in multiple partitions wic breaks trying to rename file that doesn't exist.

Added <line number> suffix to the files when copying them to the build dir. This should make filename unique even if the same source file is used for multiple partitions.

[YOCTO #9826]

---
 scripts/lib/wic/plugins/source/rawcopy.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/lib/wic/plugins/source/rawcopy.py +1 -1
index ba014b0..e0b11f9 100644
@@ -68,7 +68,7 @@ class RawCopyPlugin(SourcePlugin):
             return
 
         src = os.path.join(bootimg_dir, source_params['file'])
-        dst = os.path.join(cr_workdir, source_params['file'])
+        dst = os.path.join(cr_workdir, "%s.%s" % (source_params['file'], part.lineno))
 
         if 'skip' in source_params:
             sparse_copy(src, dst, skip=source_params['skip'])
Signature · 1 line
2.1.4