diff options
author | Yuya Kusakabe <yuya.kusakabe@gmail.com> | 2016-03-07 15:39:31 +0900 |
---|---|---|
committer | Yuya Kusakabe <yuya.kusakabe@gmail.com> | 2016-03-07 21:14:50 +0900 |
commit | df70d5d1779d6a5c5cc027a80d2e9440d517eff2 (patch) | |
tree | e67a253a373c25d8602a316e98d452f6ffbe9931 /scripts | |
parent | 2a41a6b34f78fc7e81c5959cbefc88f1c9719040 (diff) | |
download | vyos-build-df70d5d1779d6a5c5cc027a80d2e9440d517eff2.tar.gz vyos-build-df70d5d1779d6a5c5cc027a80d2e9440d517eff2.zip |
vmware-ovf: Generate manifest file (T14).
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/build-vmware-ovf | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/scripts/build-vmware-ovf b/scripts/build-vmware-ovf index ff2a5464..f3424a03 100755 --- a/scripts/build-vmware-ovf +++ b/scripts/build-vmware-ovf @@ -30,16 +30,22 @@ export PACKER_LOG_PATH=${PACKER_BUILD_DIR}/build_vmware_ovf.log export PACKER_LOG=1 mkdir -p ${PACKER_BUILD_DIR} +DST_DIR=${PACKER_BUILD_DIR}/vmware packer build -only=vmware-image scripts/packer.json # Convert raw image to VMDK -source_image=${PACKER_BUILD_DIR}/vmware/vyos_vmware_image.img -tmp_vmdk=${PACKER_BUILD_DIR}/vmware/tmp.vmdk -vmdk=${PACKER_BUILD_DIR}/vmware/vyos_vmware_image.vmdk +source_image=${DST_DIR}/vyos_vmware_image.img +tmp_vmdk=${DST_DIR}/tmp.vmdk +vmdk=${DST_DIR}/vyos_vmware_image.vmdk +ovf=${DST_DIR}/vyos_vmware_image.ovf qemu-img convert -f raw ${source_image} -O vmdk -o adapter_type=lsilogic ${tmp_vmdk} 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}/" > packer_build/vmware/vyos_vmware_image.ovf +cat scripts/template.ovf | sed "s/{{vmdk_file_size}}/${vmdk_file_size}/" > ${ovf} + +# Generate manifest file +cd ${DST_DIR} +openssl sha1 *.vmdk *.ovf > vyos_vmware_image.mf |