diff --git a/stages/org.osbuild.ovf b/stages/org.osbuild.ovf index e06014a2..0b5d18e6 100755 --- a/stages/org.osbuild.ovf +++ b/stages/org.osbuild.ovf @@ -157,7 +157,7 @@ def write_template(vmdk, options): vmware_os_type=options.get("vmware", {}).get("os_type", "other26xLinux64Guest"), vbox_machine_uuid=str(uuid.uuid4()), vbox_disk_uuid=str(uuid.uuid4()), - vbox_os_type="ArchLinux_64", + vbox_os_type=options.get("virtualbox", {}).get("os_type", "OtherLinux_64"), vbox_mac_address=vbox_mac_address(), image_name=basename, ) @@ -187,7 +187,6 @@ def write_manifest(vmdk, ovf): def main(options, tree): vmdk = os.path.join(tree, options["vmdk"]) - print(options) ovf = write_template(vmdk, options) write_manifest(vmdk, ovf) diff --git a/stages/org.osbuild.ovf.meta.json b/stages/org.osbuild.ovf.meta.json index 143a84db..71be3916 100644 --- a/stages/org.osbuild.ovf.meta.json +++ b/stages/org.osbuild.ovf.meta.json @@ -29,6 +29,17 @@ "default": "other26xLinux64Guest" } } + }, + "virtualbox": { + "description": "Settings for VirtualBox specific parts of the OVF file.", + "type": "object", + "additionalProperties": false, + "properties": { + "os_type": { + "type": "string", + "default": "OtherLinux_64" + } + } } } } diff --git a/stages/test/test_ovf.py b/stages/test/test_ovf.py index 304b0298..8e372548 100644 --- a/stages/test/test_ovf.py +++ b/stages/test/test_ovf.py @@ -41,7 +41,8 @@ def test_schema_validation_ovf(stage_schema, test_data, expected_err): @pytest.mark.skipif(not testutil.has_executable("qemu-img"), reason="need qemu-img") @pytest.mark.parametrize("test_opts, expected_substrings", [ # Replacements - ({"vmware": {"os_type": "my-os-type"}}, ["my-os-type"],), + ({"vmware": {"os_type": "my-vmware-os-type"}}, ["my-vmware-os-type"],), + ({"virtualbox": {"os_type": "my-vbox-os-type"}}, ["my-vbox-os-type"],), ]) def test_ovf_default_template(tmp_path, stage_module, test_opts, expected_substrings): faked_vmdk_path = tmp_path / "some-image.vmdk"