]> code.ossystems Code Review - openembedded-core.git/commitdiff
wic: rawcopy: make source filenames unique
authorEd Bartosh <ed.bartosh@linux.intel.com>
Fri, 1 Jul 2016 08:05:39 +0000 (11:05 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 6 Jul 2016 16:25:33 +0000 (17:25 +0100)
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]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/lib/wic/plugins/source/rawcopy.py

index 0472f536bafc184ba173cba834cf11816e48c3aa..7ce0cc41540b271ccb5dc0ce3d33d6afd708f2ec 100644 (file)
@@ -67,7 +67,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:
             dd_cmd = "dd if=%s of=%s ibs=%s skip=1 conv=notrunc" % \