Add an advanced option to build_image so that a caller can specify the version.

This change adds the ability for a caller to pass a specific version name
to build_image rather than rely on parsing of chromeos_version.sh + attempt
number.

BUG=chromium-os:29077
TEST=Ran build_image w/ w/out option

Change-Id: I69b76ae4bfc148325686902606476a0aae293e56
Reviewed-on: https://gerrit.chromium.org/gerrit/19861
Tested-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Chris Sosa <sosa@chromium.org>
This commit is contained in:
Chris Sosa 2012-04-09 15:07:47 -07:00 committed by Gerrit
parent df23c6db56
commit dbc853b2bf
2 changed files with 8 additions and 1 deletions

View File

@ -62,6 +62,8 @@ show_help_if_requested "$@"
# not needed for the typical developer workflow. # not needed for the typical developer workflow.
DEFINE_integer build_attempt 1 \ DEFINE_integer build_attempt 1 \
"The build attempt for this image build." "The build attempt for this image build."
DEFINE_string version "" \
"Overrides version number in name to this version."
DEFINE_integer jobs -1 \ DEFINE_integer jobs -1 \
"How many packages to build in parallel at maximum." "How many packages to build in parallel at maximum."
DEFINE_boolean replace ${FLAGS_FALSE} \ DEFINE_boolean replace ${FLAGS_FALSE} \

View File

@ -11,8 +11,13 @@
# Use canonical path since some tools (e.g. mount) do not like symlinks. # Use canonical path since some tools (e.g. mount) do not like symlinks.
# Append build attempt to output directory. # Append build attempt to output directory.
IMAGE_SUBDIR="R${CHROME_BRANCH}-${CHROMEOS_VERSION_STRING}-a\ IMAGE_SUBDIR="R${CHROME_BRANCH}"
if [ -z "${FLAGS_version}" ]; then
IMAGE_SUBDIR="${IMAGE_SUBDIR}-${CHROMEOS_VERSION_STRING}-a\
${FLAGS_build_attempt}" ${FLAGS_build_attempt}"
else
IMAGE_SUBDIR="${IMAGE_SUBDIR}-${FLAGS_version}"
fi
BUILD_DIR="${FLAGS_output_root}/${BOARD}/${IMAGE_SUBDIR}" BUILD_DIR="${FLAGS_output_root}/${BOARD}/${IMAGE_SUBDIR}"
OUTSIDE_OUTPUT_DIR="../build/images/${BOARD}/${IMAGE_SUBDIR}" OUTSIDE_OUTPUT_DIR="../build/images/${BOARD}/${IMAGE_SUBDIR}"
IMAGES_TO_BUILD= IMAGES_TO_BUILD=