[OE-core] [PATCH 2/3] wic: direct: fix creation of work directory
Ed Bartosh
ed.bartosh at linux.intel.com
Thu Feb 2 13:32:58 UTC 2017
It was a typo in current code: mktemp was used instead of
mkdtemp to create work directory. This is fixed by using
mkdtemp.
Create work directory as a subdirectory of output directory
to make sure both are on the same partition to make moving
of result image faster.
This also fixes possible disk space issues as mkdtemp uses
TMPDIR, TEMP or TMP environment variables to get default value
of its 'dir' parameter. Those variables are usually pointing
to /tmp, which is not the best location to create huge images.
Signed-off-by: Ed Bartosh <ed.bartosh at linux.intel.com>
---
scripts/lib/wic/plugins/imager/direct.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/lib/wic/plugins/imager/direct.py b/scripts/lib/wic/plugins/imager/direct.py
index 4637fbf3..b38e876 100644
--- a/scripts/lib/wic/plugins/imager/direct.py
+++ b/scripts/lib/wic/plugins/imager/direct.py
@@ -122,7 +122,7 @@ class DirectImageCreator:
"""
self.name = name
self.outdir = outdir
- self.workdir = tempfile.mktemp(prefix='wic')
+ self.workdir = tempfile.mkdtemp(dir=outdir, prefix='tmp.wic.')
self.ks = ksobj
self._image = None
--
2.1.4
More information about the Openembedded-core
mailing list