move the resulting image into the output directory

This commit is contained in:
Martin Sehnoutka 2019-06-21 13:19:10 +02:00 committed by Tom Gundersen
parent 63a4f795dc
commit d3023ec7f7

View file

@ -47,6 +47,7 @@ def main(tree, input_dir, options):
filename = options["filename"]
partition_table_id = options["partition_table_id"]
root_fs_uuid = options["root_fs_uuid"]
output_dir = options["output_dir"]
# Create a working directory on a tmpfs, maybe we should implicitly
# always do this.
@ -74,7 +75,7 @@ def main(tree, input_dir, options):
with mount_api(mountpoint):
subprocess.run(["chroot", mountpoint, "grub2-install", "--no-floppy", "--target", "i386-pc", loop], check=True)
subprocess.run(["qemu-img", "convert", "-O" "qcow2", "-c", image, filename], check=True)
subprocess.run(["qemu-img", "convert", "-O" "qcow2", "-c", image, f"{output_dir}/{filename}"], check=True)
if __name__ == '__main__':
args = json.load(sys.stdin)