build-vm, pack: implement qcow2c support
This is a compressed version of good ol' qcow2. Suggested-by: Alexey Shabalin <shaba@altlinux.org>
This commit is contained in:
parent
0f2411ec34
commit
e043f87775
@ -33,16 +33,18 @@ prepare-image: check-sudo
|
||||
fi
|
||||
|
||||
convert-image: prepare-image
|
||||
@case "$(IMAGE_TYPE)" in \
|
||||
@VM_COMPRESS=; \
|
||||
case "$(IMAGE_TYPE)" in \
|
||||
"img") mv "$(VM_RAWDISK)" "$(IMAGE_OUTPATH)"; exit 0;; \
|
||||
"vhd") VM_FORMAT="vpc";; \
|
||||
"qcow2c") VM_FORMAT="qcow2"; VM_COMPRESS="-c";; \
|
||||
*) VM_FORMAT="$(IMAGE_TYPE)"; \
|
||||
esac; \
|
||||
if ! type -t qemu-img >&/dev/null; then \
|
||||
echo "** error: qemu-img not available" >&2; \
|
||||
exit 1; \
|
||||
else \
|
||||
qemu-img convert -O "$$VM_FORMAT" \
|
||||
qemu-img convert $$VM_COMPRESS -O "$$VM_FORMAT" \
|
||||
"$(VM_RAWDISK)" "$(IMAGE_OUTPATH)"; \
|
||||
rm "$(VM_RAWDISK)"; \
|
||||
if [ "0$(DEBUG)" -le 1 ]; then rm "$(VM_TARBALL)"; fi; \
|
||||
|
@ -40,6 +40,6 @@ $(foreach c,$(VE_ARCHIVES), \
|
||||
$(eval $(call PACK_compressors,$(c),$(z)))))
|
||||
|
||||
# virtual machines
|
||||
VM_EXTS := .img .qcow2 .vdi .vmdk .vhd
|
||||
VM_EXTS := .img .qcow2 .qcow2c .vdi .vmdk .vhd
|
||||
|
||||
$(VM_EXTS:.%=use/pack/%): use/pack; @:
|
||||
|
Loading…
Reference in New Issue
Block a user