Only copy the final image file on local disk if it is not in the default location.

BUG=None
TEST=run with a "--to" path that is the default location where the image is generated.
Verify the final image is not 0 bytes.

Change-Id: Ib9a7feceb17054362f00a813c369564e753cd3ab
Reviewed-on: http://gerrit.chromium.org/gerrit/2988
Tested-by: Dave Parker <dparker@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: Nick Sanders <nsanders@chromium.org>
This commit is contained in:
Dave Parker 2011-06-22 08:28:43 -07:00
parent c871ba2df4
commit 43395e3a70

View File

@ -261,8 +261,10 @@ if [ -b "${FLAGS_to}" ]; then
echo "Done."
else
# Output to a file, so just make a copy.
echo "Copying ${SRC_IMAGE} to ${FLAGS_to}..."
${COMMON_PV_CAT} "${SRC_IMAGE}" >"${FLAGS_to}"
if [ "${SRC_IMAGE}" != "${FLAGS_to}" ]; then
echo "Copying ${SRC_IMAGE} to ${FLAGS_to}..."
${COMMON_PV_CAT} "${SRC_IMAGE}" >"${FLAGS_to}"
fi
echo "Done. To copy to a USB/MMC drive, do something like:"
echo " sudo dd if=${FLAGS_to} of=/dev/sdX bs=4M oflag=sync"