diff --git a/build_image b/build_image index e33749d55e..4cbc1dc87c 100755 --- a/build_image +++ b/build_image @@ -146,9 +146,6 @@ if [[ -e "$OUTPUT_DIR" ]]; then fi fi -# Be verbose to help debug failures. -set -x - # Create the output directory. mkdir -p "$OUTPUT_DIR" @@ -577,6 +574,8 @@ if [ "$FLAGS_withdev" -eq "$FLAGS_TRUE" ]; then echo "Developer image created as $DEVELOPER_IMAGE_NAME" fi +print_time_elapsed + echo "To copy to USB keyfob, OUTSIDE the chroot, do something like:" echo " ./image_to_usb.sh --from=${OUTSIDE_OUTPUT_DIR} --to=/dev/sdX" echo "To convert to VMWare image, OUTSIDE the chroot, do something like:" diff --git a/common.sh b/common.sh index 395310b43c..6d7a7f9173 100644 --- a/common.sh +++ b/common.sh @@ -429,3 +429,15 @@ setup_symlinks_on_root() { sudo ln -s "${var_target}" "${dev_image_root}/var" } + +# Get current timestamp. Assumes common.sh runs at startup. +start_time=$(date +%s) + +# Print time elsapsed since start_time. +print_time_elapsed() { + end_time=$(date +%s) + elapsed_seconds="$(( $end_time - $start_time ))" + minutes="$(( $elapsed_seconds / 60 ))" + seconds="$(( $elapsed_seconds % 60 ))" + echo "Elapsed time: ${minutes}:${seconds}" +} diff --git a/mod_image_for_test.sh b/mod_image_for_test.sh index a334769909..6b99b6d2e0 100755 --- a/mod_image_for_test.sh +++ b/mod_image_for_test.sh @@ -199,5 +199,8 @@ if [ "${VERIFY}" = "true" ]; then fi cleanup + +print_time_elapsed + trap - EXIT