From 9769c6bc9ff8e2520d123fbed9a7d1ec5bc8670f Mon Sep 17 00:00:00 2001 From: Chris Sosa Date: Thu, 17 Feb 2011 12:42:22 -0800 Subject: [PATCH] Move check for image until we actually need it. This addresses the case where we don't have chromiumos_image.bin but don't actually need it since we've previously generated a test image. Change-Id: Ie7be0165e0f68bbd9d34156b55e17d971cb86fa9 BUG=chromium-os:12268 TEST=Ran it with --noinplace and missing dev image. Review URL: http://codereview.chromium.org/6538031 --- mod_image_for_test.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/mod_image_for_test.sh b/mod_image_for_test.sh index b9f123fb0a..822a293262 100755 --- a/mod_image_for_test.sh +++ b/mod_image_for_test.sh @@ -87,12 +87,6 @@ fi # Turn path into an absolute path. FLAGS_image=`eval readlink -f ${FLAGS_image}` -# Abort early if we can't find the image -if [ ! -f $FLAGS_image ] ; then - echo "No image found at $FLAGS_image" - exit 1 -fi - # What cross-build are we targeting? . "${FLAGS_build_root}/${FLAGS_board}/etc/make.conf.board_setup" # Figure out ARCH from the given toolchain. @@ -214,6 +208,11 @@ else echo "Modifying image ${FLAGS_image} for test..." fi +# Abort early if we can't find the image +if [ ! -f $FLAGS_image ] && [ ${FLAGS_inplace} -eq ${FLAGS_TRUE} ; then + die "No image found at $FLAGS_image to modify" +fi + set -e IMAGE_DIR=$(dirname "$FLAGS_image")