From 01083886e1e861378ce16195c9ad76c1d5ce3e4a Mon Sep 17 00:00:00 2001 From: Yuya Kusakabe Date: Mon, 7 Mar 2016 23:47:39 +0900 Subject: Add product section to VMware OVF (ref T14). --- scripts/build-vmware-ovf | 8 ++++++-- scripts/check-vm-build-env | 2 +- scripts/template.ovf | 8 +++++++- 3 files changed, 14 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/build-vmware-ovf b/scripts/build-vmware-ovf index f3424a03..8890ba69 100755 --- a/scripts/build-vmware-ovf +++ b/scripts/build-vmware-ovf @@ -43,8 +43,12 @@ qemu-img convert -f raw ${source_image} -O vmdk -o adapter_type=lsilogic ${tmp_v vmdk-convert ${tmp_vmdk} ${vmdk} # Generate OVF -vmdk_file_size=$(du --bytes ${vmdk} | awk '{print $1}') -cat scripts/template.ovf | sed "s/{{vmdk_file_size}}/${vmdk_file_size}/" > ${ovf} +vmdk_file_size=$(vmdk-convert -i ${vmdk} | jq .capacity) +vmdk_populated_size=$(vmdk-convert -i ${vmdk} | jq .used) +version=$(cat build/version) +cat scripts/template.ovf | sed "s/{{vmdk_file_size}}/${vmdk_file_size}/" > ${ovf} +sed -i "s/{{vmdk_populated_size}}/${vmdk_populated_size}/" ${ovf} +sed -i "s/{{version}}/${version}/" ${ovf} # Generate manifest file cd ${DST_DIR} diff --git a/scripts/check-vm-build-env b/scripts/check-vm-build-env index 47ec5922..c32f2b13 100755 --- a/scripts/check-vm-build-env +++ b/scripts/check-vm-build-env @@ -26,7 +26,7 @@ import util deps = { 'packages': [ - 'make', + 'jq', 'qemu-system-x86', 'qemu-utils' ], diff --git a/scripts/template.ovf b/scripts/template.ovf index 7e341c3e..b7c9aa32 100644 --- a/scripts/template.ovf +++ b/scripts/template.ovf @@ -5,7 +5,7 @@ Virtual disk information - + The list of logical networks @@ -111,5 +111,11 @@ + + VyOS is a Linux-based network operating system that provides software-based network routing, firewall, and VPN functionality. + VyOS + VyOS maintainers and contributors + {{version}} + -- cgit v1.2.3