]> code.ossystems Code Review - openembedded-core.git/commitdiff
wic: fix images build in parallel
authorMaxim Uvarov <maxim.uvarov@linaro.org>
Fri, 17 Jan 2020 21:46:12 +0000 (00:46 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 19 Jan 2020 13:24:32 +0000 (13:24 +0000)
OE wic plugins create temporary file with the index of the line
tmp file name. This causes race in case several builds run in time.
If source_params['file'] is an absolute path, the cr_workdir prefix
is not applied by os.path.join(). So instead it writes to a ".1"
file next to the original image - this is outside the WORKDIR
and at risk of collision.

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Suggested-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Suggested-by: Paul Barker <pbarker@konsulko.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/lib/wic/plugins/source/rawcopy.py

index 82970ce51bc1912702754ad9ff32e9d03cea3b38..3c4997d8ba5e7f09583d9607911e3722da0e9ccd 100644 (file)
@@ -57,7 +57,7 @@ class RawCopyPlugin(SourcePlugin):
             raise WicError("No file specified")
 
         src = os.path.join(kernel_dir, source_params['file'])
-        dst = os.path.join(cr_workdir, "%s.%s" % (source_params['file'], part.lineno))
+        dst = os.path.join(cr_workdir, "%s.%s" % (os.path.basename(source_params['file']), part.lineno))
 
         if not os.path.exists(os.path.dirname(dst)):
             os.makedirs(os.path.dirname(dst))