From 0c32784663ec4639ea05a122833a4bf043a0e709 Mon Sep 17 00:00:00 2001 From: SamYaple Date: Thu, 10 Mar 2016 16:53:32 +0000 Subject: [PATCH] Revert "Zerofree the image if possible" This reverts commit 5184d02a7c80cf4b2d2851695f0a205994129ef7. The decision was made to go with fstrim because it is faster and more universal that zerofree. The related-id has the patchset that implements fstrim. Related-Id: I269b4416be450369616f9b8e030f84c30e329804 Change-Id: If40cf2fc0ecd8686768cbfeac9ecee90907674e7 --- bin/disk-image-create | 11 +---------- doc/source/user_guide/installation.rst | 5 ----- lib/img-functions | 5 ----- tests/install_test_deps.sh | 2 -- 4 files changed, 1 insertion(+), 22 deletions(-) diff --git a/bin/disk-image-create b/bin/disk-image-create index 4bb06f2d..2b6a94d9 100755 --- a/bin/disk-image-create +++ b/bin/disk-image-create @@ -335,9 +335,7 @@ if [ -n "$MAX_ONLINE_RESIZE" ]; then fi LOOPDEV=$(sudo losetup --show -f $TMP_IMAGE_PATH) -# Definied here for backward compat against set -u -export EXTRA_UNMOUNT="" -export EXTRA_CLEANUP="detach_loopback $LOOPDEV" +export EXTRA_UNMOUNT="detach_loopback $LOOPDEV" export IMAGE_BLOCK_DEVICE=$LOOPDEV eval_run_d block-device "IMAGE_BLOCK_DEVICE=" sudo mkfs $MKFS_OPTS -t $FS_TYPE -L ${DIB_ROOT_LABEL} ${IMAGE_BLOCK_DEVICE} @@ -384,13 +382,6 @@ done unmount_image cleanup_build_dir -# Write zeros to free blocks to aid compression of images. -if echo "$FS_TYPE" | grep -q "^ext" && which zerofree ; then - sudo zerofree $IMAGE_BLOCK_DEVICE -fi -# We are done with the loopback device make sure it is detached. -$EXTRA_CLEANUP - has_raw_type= if [ "$IS_RAMDISK" == "0" ]; then for IMAGE_TYPE in ${IMAGE_TYPES[@]} ; do diff --git a/doc/source/user_guide/installation.rst b/doc/source/user_guide/installation.rst index 2ef7b8e7..169c088d 100644 --- a/doc/source/user_guide/installation.rst +++ b/doc/source/user_guide/installation.rst @@ -27,11 +27,6 @@ It is recommended you check the documentation for each element you are using to determine if there are any additional dependencies. Of particular note is the need for the `dev-python/pyyaml` package on Gentoo hosts. -If the zerofree utility is present on the build system and you are building -an image with an ext filesystem zerofree will be used to zero out free -blocks in the image. This makes the resulting images much smaller if -compressed. - Source Installation ------------------- diff --git a/lib/img-functions b/lib/img-functions index 6285c0b9..cf817ae8 100644 --- a/lib/img-functions +++ b/lib/img-functions @@ -24,8 +24,6 @@ function unmount_image () { # unmount from the chroot # Don't use TMP_MOUNT_PATH here, it might not have been set. unmount_dir "$TMP_BUILD_DIR/mnt" - - # Left here for backward compatibility if [ -n "$EXTRA_UNMOUNT" ]; then $EXTRA_UNMOUNT fi @@ -41,9 +39,6 @@ function cleanup () { unmount_image cleanup_build_dir cleanup_image_dir - if [ -n "$EXTRA_CLEANUP" ]; then - $EXTRA_CLEANUP - fi } function ensure_nbd () { diff --git a/tests/install_test_deps.sh b/tests/install_test_deps.sh index 7925f10f..bbf66151 100755 --- a/tests/install_test_deps.sh +++ b/tests/install_test_deps.sh @@ -8,10 +8,8 @@ sudo apt-get install -y \ debootstrap \ inetutils-ping \ kpartx \ - zerofree \ qemu-utils || \ sudo yum -y install \ debootstrap \ kpartx \ - zerofree \ qemu-img