From 59727f84b1c4a32ca9302cab0e74936926cfb181 Mon Sep 17 00:00:00 2001 From: Jiri Konecny Date: Tue, 15 Sep 2020 14:28:01 +0200 Subject: [PATCH] Support change of the patch-iso temp dir This is useful when running pungi-patch-iso on VM with low amount of memory but higher disk space. Without this option the operation will fail because /tmp is tmpfs filesystem. Signed-off-by: Jiri Konecny --- pungi/scripts/patch_iso.py | 3 +++ pungi_utils/patch_iso.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pungi/scripts/patch_iso.py b/pungi/scripts/patch_iso.py index 40d7f858..406a15e3 100644 --- a/pungi/scripts/patch_iso.py +++ b/pungi/scripts/patch_iso.py @@ -33,6 +33,9 @@ def main(args=None): parser.add_argument( "--force-arch", help="Treat the ISO as bootable on given architecture" ) + parser.add_argument( + "--work-dir", help="Set custom working directory. Default: /tmp/", default=None + ) parser.add_argument( "target", metavar="TARGET_ISO", help="which file to write the result to" ) diff --git a/pungi_utils/patch_iso.py b/pungi_utils/patch_iso.py index 8d3f9d1f..8a9d94d4 100644 --- a/pungi_utils/patch_iso.py +++ b/pungi_utils/patch_iso.py @@ -79,7 +79,7 @@ def run(log, opts): log.info("Mounting %s", opts.source) target = os.path.abspath(opts.target) - with util.temp_dir(prefix="patch-iso-") as work_dir: + with util.temp_dir(prefix="patch-iso-", dir=opts.work_dir) as work_dir: with iso.mount(opts.source) as source_iso_dir: util.copy_all(source_iso_dir, work_dir)