From afa42cd143bcc7accdf006424ae8a5218477c259 Mon Sep 17 00:00:00 2001 From: Oliver Kurth Date: Wed, 19 Jun 2024 20:55:39 +0000 Subject: [PATCH 1/2] ova-compose: add option to set tar format (default: ustar) --- ova-compose/example.yaml | 2 +- ova-compose/ova-compose.py | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ova-compose/example.yaml b/ova-compose/example.yaml index c528d02..d053502 100644 --- a/ova-compose/example.yaml +++ b/ova-compose/example.yaml @@ -1,6 +1,6 @@ system: name: example - type: vmx-21 + type: vmx-20 os_vmw: !param os=other4xLinux64Guest firmware: !param firmware=efi secure_boot: !param secure-boot=false diff --git a/ova-compose/ova-compose.py b/ova-compose/ova-compose.py index 7616e01..1d81daf 100755 --- a/ova-compose/ova-compose.py +++ b/ova-compose/ova-compose.py @@ -1247,9 +1247,10 @@ def main(): do_manifest = False params = {} checksum_type = "sha256" + tar_format = "ustar" try: - opts, args = getopt.getopt(sys.argv[1:], 'f:hi:mo:q', longopts=['format=', 'input-file=', 'manifest', 'output-file=', 'param=', 'checksum-type=']) + opts, args = getopt.getopt(sys.argv[1:], 'f:hi:mo:q', longopts=['format=', 'input-file=', 'manifest', 'output-file=', 'param=', 'checksum-type=', 'tar-format=']) except: print ("invalid option") sys.exit(2) @@ -1268,6 +1269,8 @@ def main(): elif o in ['--param']: k,v = a.split('=', maxsplit=1) params[k] = yaml.safe_load(v) + elif o in ['--tar-format']: + tar_format = a elif o in ['-q']: do_quiet = True elif o in ['-h']: @@ -1336,7 +1339,7 @@ def main(): ovf.write_manifest(ovf_file=ovf_file, mf_file=mf_file, hash_type=checksum_type) if output_format == "ova": - ret = subprocess.check_call(["tar", "--format=ustar", "-h", + ret = subprocess.check_call(["tar", f"--format={tar_format}", "-h", "--owner=0", "--group=0", "--mode=0644", "-cf", os.path.join(pwd, output_file)] + all_files) From e0c5f5e2de3dc74a0912879b3e7eb0af7eeacc14 Mon Sep 17 00:00:00 2001 From: Oliver Kurth Date: Fri, 21 Jun 2024 21:28:14 +0000 Subject: [PATCH 2/2] ova-compose: add option to set tar format (default: gnu) --- ova-compose/ova-compose.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ova-compose/ova-compose.py b/ova-compose/ova-compose.py index 1d81daf..d143efa 100755 --- a/ova-compose/ova-compose.py +++ b/ova-compose/ova-compose.py @@ -1247,7 +1247,7 @@ def main(): do_manifest = False params = {} checksum_type = "sha256" - tar_format = "ustar" + tar_format = "gnu" try: opts, args = getopt.getopt(sys.argv[1:], 'f:hi:mo:q', longopts=['format=', 'input-file=', 'manifest', 'output-file=', 'param=', 'checksum-type=', 'tar-format='])