From 8b93c412460eba405673a1bc24c859cdb3867a48 Mon Sep 17 00:00:00 2001 From: yang Date: Tue, 6 Aug 2019 19:00:31 +0800 Subject: [PATCH] add script to convert image to vmdk format --- convert_to_vmware.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 convert_to_vmware.sh diff --git a/convert_to_vmware.sh b/convert_to_vmware.sh new file mode 100755 index 0000000..f9383e0 --- /dev/null +++ b/convert_to_vmware.sh @@ -0,0 +1,15 @@ +#!/bin/bash +self_name=$0 +source_img=$1 +target_img=$2.vmdk + +show_help_exit() { + echo "help: $self_name " + echo "detail: convert chromiumos raw image to .vmdk" + exit 1 +} + +[ -z "$source_img" ] && show_help_exit +[ ! -f "$source_img" ] && show_help_exit +[ -f ${target_img} ] && rm ${target_img} +qemu-img convert -O vmdk ${source_img} ${target_img}