Remove unnecessary sync calls from build_image and image_to_vm.sh.

Calling sync in build scripts pauses the build unnecessarily, particularly
when other steps are running in parallel.

BUG=chromium-os:19150
TEST=Run cbuildbot release build and watch faster performance.

Change-Id: Ia2469e3be68fdd38474ab4e6f67b06339c04822f
Reviewed-on: http://gerrit.chromium.org/gerrit/5966
Reviewed-by: Thieu Le <thieule@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: <taysom@google.com>
Tested-by: David James <davidjames@chromium.org>
This commit is contained in:
David James 2011-08-13 23:16:49 -07:00
parent 7d164d20fc
commit b01cc8d2d3
2 changed files with 8 additions and 6 deletions

View File

@ -458,10 +458,7 @@ zero_free_space() {
# dd is a silly thing and will produce a "No space left on device" message
# that cannot be turned off and is confusing to unsuspecting victims.
( sudo dd if=/dev/zero of="${fs_mount_point}/filler" bs=4096 \
|| true ) 2>&1 |grep -v "No space left on device"
sudo sync
sudo rm -f "${fs_mount_point}/filler"
sudo sync
|| true ) 2>&1 | grep -v "No space left on device"
}
create_base_image() {
@ -627,6 +624,13 @@ create_base_image() {
trap delete_prompt EXIT
# Now that the filler file has been sync'd to disk and has filled up all free
# space with zeros, re-mount the rootfs to delete the filler file.
LOOP_DEV=$(sudo losetup --show -f "${ROOT_FS_IMG}")
sudo mount -t ext2 "${LOOP_DEV}" "${ROOT_FS_DIR}"
sudo rm -f "${ROOT_FS_DIR}/filler"
sudo umount -d "${ROOT_FS_DIR}"
# Create the GPT-formatted image.
build_gpt "${OUTPUT_DIR}/${image_name}" \
"${ROOT_FS_IMG}" \

View File

@ -166,7 +166,6 @@ else
fi
sudo e2fsck -pf "${STATEFUL_LOOP_DEV}"
sudo resize2fs "${STATEFUL_LOOP_DEV}"
sync
sudo losetup -d "${STATEFUL_LOOP_DEV}"
fi
fi
@ -194,7 +193,6 @@ sudo python "${SCRIPTS_DIR}/fixup_image_for_qemu.py" \
sudo sed -i -e 's/sdb3/sda3/g' "${TEMP_MNT}/boot/syslinux/usb.A.cfg"
# Unmount everything prior to building a final image
sync
trap - INT TERM EXIT
cleanup