]> code.ossystems Code Review - openembedded-core.git/commitdiff
wic: Add workdir argument
authorPaul Barker <pbarker@konsulko.com>
Mon, 11 Jan 2021 10:32:42 +0000 (10:32 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 13 Jan 2021 23:12:25 +0000 (23:12 +0000)
This allows the path for the temporary workdir used by wic to be set
when running wic from bitbake or directly from the command line.

Signed-off-by: Paul Barker <pbarker@konsulko.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/lib/wic/plugins/imager/direct.py
scripts/wic

index 0ca67b77d5a58add4e0cb9d669041ece56b8d48e..b329568c7a1f05c5734c5f884d4139773ad03725 100644 (file)
@@ -62,7 +62,7 @@ class DirectPlugin(ImagerPlugin):
 
         self.name = "%s-%s" % (os.path.splitext(os.path.basename(wks_file))[0],
                                strftime("%Y%m%d%H%M"))
-        self.workdir = tempfile.mkdtemp(dir=self.outdir, prefix='tmp.wic.')
+        self.workdir = options.workdir or tempfile.mkdtemp(dir=self.outdir, prefix='tmp.wic.')
         self._image = None
         self.ptable_format = self.ks.bootloader.ptable
         self.parts = self.ks.partitions
index 24700f380f33691bdc1fd27022138d35c93cfe6a..a741aed364bff816fb3e97a397c772f7f9832900 100755 (executable)
@@ -312,6 +312,8 @@ def wic_init_parser_create(subparser):
 
     subparser.add_argument("-o", "--outdir", dest="outdir", default='.',
                       help="name of directory to create image in")
+    subparser.add_argument("-w", "--workdir",
+                      help="temporary workdir to use for intermediate files")
     subparser.add_argument("-e", "--image-name", dest="image_name",
                       help="name of the image to use the artifacts from "
                            "e.g. core-image-sato")