summaryrefslogtreecommitdiff
path: root/scripts/build-vmware-ovf
diff options
context:
space:
mode:
authorYuya Kusakabe <yuya.kusakabe@gmail.com>2016-03-07 23:47:39 +0900
committerYuya Kusakabe <yuya.kusakabe@gmail.com>2016-03-07 23:47:39 +0900
commit01083886e1e861378ce16195c9ad76c1d5ce3e4a (patch)
treef669adcf915879f4b51848cc628e496cb885e97b /scripts/build-vmware-ovf
parentdf70d5d1779d6a5c5cc027a80d2e9440d517eff2 (diff)
downloadvyos-build-01083886e1e861378ce16195c9ad76c1d5ce3e4a.tar.gz
vyos-build-01083886e1e861378ce16195c9ad76c1d5ce3e4a.zip
Add product section to VMware OVF (ref T14).
Diffstat (limited to 'scripts/build-vmware-ovf')
-rwxr-xr-xscripts/build-vmware-ovf8
1 files changed, 6 insertions, 2 deletions
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}