From c8c8eb0a3aef256c3e20bb385d01d5649f295f20 Mon Sep 17 00:00:00 2001 From: goffinet Date: Sun, 20 Oct 2024 23:08:39 +0200 Subject: [PATCH] sparsify images --- scripts/push-image.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/push-image.sh b/scripts/push-image.sh index f5cefc7..907d272 100755 --- a/scripts/push-image.sh +++ b/scripts/push-image.sh @@ -24,9 +24,9 @@ if [ $disable == "true" ] ; then exit ; fi cd ${path_image} -# rename the image, check the size, compute md5 and sha1 sum +# rename the image by sparsify, check the size, compute md5 sha256 sum -mv packer-${image} ${image}.qcow2 +virt-sparsify --check-tmpdir ignore --compress --convert qcow2 --format packer-${image} ${image}.qcow2 md5sum_image=$(md5sum ${image}.qcow2 | cut -d' ' -f1) size_image=$(stat -c %s ${image}.qcow2) md5sum ${image}.qcow2 > ${image}.qcow2.md5sum