#!/usr/bin/env bash images_dir="$1" cd "$images_dir" f=rootfs.ext2 exe="${HOST_DIR}/bin/qemu-img" if [ -f "$exe" ] && [ -f "$f" ]; then "$exe" convert -f raw -O qcow2 "$f" "${f}.qcow2" fi