Merge "Remove an excess cp of disk images."

This commit is contained in:
Jenkins 2014-03-26 08:38:52 +00:00 committed by Gerrit Code Review
commit bfba0ccd03
3 changed files with 12 additions and 8 deletions

View File

@ -187,5 +187,7 @@ unmount_image
if [ "$IS_RAMDISK" == "0" ]; then if [ "$IS_RAMDISK" == "0" ]; then
compress_and_save_image $IMAGE_NAME.$IMAGE_TYPE compress_and_save_image $IMAGE_NAME.$IMAGE_TYPE
else else
remove_image # This is a ramdisk build, we have already extracted the kernel and ramdisk
# by this point.
rm $TMP_IMAGE_PATH
fi fi

View File

@ -40,6 +40,14 @@ function mk_build_dir () {
export TMP_HOOKS_PATH=$TMP_BUILD_DIR/hooks export TMP_HOOKS_PATH=$TMP_BUILD_DIR/hooks
} }
function finish_image () {
mv $TMP_IMAGE_PATH $1
cleanup_dirs
# All done!
trap EXIT
echo "Image file $1 created..."
}
function save_image () { function save_image () {
# TODO: this really should rename the old file # TODO: this really should rename the old file
if [ -f $1 ] ; then if [ -f $1 ] ; then

View File

@ -106,13 +106,7 @@ function compress_and_save_image () {
rm $TMP_IMAGE_PATH rm $TMP_IMAGE_PATH
TMP_IMAGE_PATH=$1-new TMP_IMAGE_PATH=$1-new
save_image $1 finish_image $1
remove_image
}
function remove_image () {
echo "Removing $TMP_IMAGE_PATH"
rm $TMP_IMAGE_PATH
} }
function do_extra_package_install () { function do_extra_package_install () {