Fix bug with building on the base image with build_image base.

This comes from not correctly negating all FLAGS and also the weird
way we set PRISTINE_IMAGE_NAME.  Addressed in both cases and
simplified FLAGS_* logic in build_image_util.sh

BUG=chromium-os:24627
TEST=build_image base so far.

Change-Id: I92e8550db3ea713cda1f997b702777035145d8d5
Reviewed-on: https://gerrit.chromium.org/gerrit/13636
Tested-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
Commit-Ready: Chris Sosa <sosa@chromium.org>
This commit is contained in:
Chris Sosa 2012-01-03 15:52:12 -08:00 committed by Gerrit
parent 0628fadf9d
commit 93e7b78eea
2 changed files with 17 additions and 12 deletions

View File

@ -159,12 +159,22 @@ fi
# If we are creating a developer image, also create a pristine image with a
# different name.
PRISTINE_IMAGE_NAME=chromiumos_image.bin
PRISTINE_IMAGE_NAME=
if [ ${FLAGS_withdev} -eq ${FLAGS_TRUE} ]; then
PRISTINE_IMAGE_NAME=${CHROMEOS_BASE_IMAGE_NAME}
# Rename pristine image for factory install shim.
elif [ ${FLAGS_factory_install} -eq ${FLAGS_TRUE} ]; then
PRISTINE_IMAGE_NAME=${CHROMEOS_FACTORY_INSTALL_SHIM_NAME}
else
# No withdev and no factory_install set meaning we must be building just the
# base image.
PRISTINE_IMAGE_NAME=chromiumos_image.bin
# Verify our assertion is true.
if [ ${IMAGES_TO_BUILD} != ${CHROMEOS_BASE_IMAGE_NAME} ]; then
warn "${IMAGES_TO_BUILD} != ${CHROMEOS_BASE_IMAGE_NAME}"
die "Should only reach this condition if only building the base image."
fi
IMAGES_TO_BUILD="chromiumos_image.bin"
fi
ROOT_FS_DIR="${BUILD_DIR}/rootfs"

View File

@ -57,26 +57,24 @@ parse_build_image_args() {
if [ -n "${FLAGS_ARGV}" ]; then
info "Ignoring image flags since image(s) in $FLAGS_ARGV specified."
get_images_to_build ${FLAGS_ARGV}
if should_build_image ${CHROMEOS_BASE_IMAGE_NAME}; then
FLAGS_factory_install=${FLAGS_FALSE}
fi
# Start at ground zero with all image flags set to False.
FLAGS_withdev=${FLAGS_FALSE}
FLAGS_test=${FLAGS_FALSE}
FLAGS_factory=${FLAGS_FALSE}
FLAGS_factory_install=${FLAGS_FALSE}
if should_build_image ${CHROMEOS_DEVELOPER_IMAGE_NAME}; then
FLAGS_withdev=${FLAGS_TRUE}
FLAGS_factory_install=${FLAGS_FALSE}
fi
if should_build_image ${CHROMEOS_TEST_IMAGE_NAME}; then
FLAGS_withdev=${FLAGS_TRUE}
FLAGS_test=${FLAGS_TRUE}
FLAGS_factory_install=${FLAGS_FALSE}
if should_build_image "${CHROMEOS_FACTORY_TEST_IMAGE_NAME}"; then
die "Cannot build both the test and factory_test images."
fi
fi
if should_build_image ${CHROMEOS_FACTORY_TEST_IMAGE_NAME}; then
FLAGS_withdev=${FLAGS_TRUE}
FLAGS_test=${FLAGS_FALSE}
FLAGS_factory=${FLAGS_TRUE}
FLAGS_factory_install=${FLAGS_FALSE}
fi
if should_build_image ${CHROMEOS_FACTORY_INSTALL_SHIM_NAME}; then
for image in ${CHROMEOS_BASE_IMAGE_NAME} ${CHROMEOS_DEVELOPER_IMAGE_NAME}\
@ -84,9 +82,6 @@ parse_build_image_args() {
should_build_image ${image} && die "Can't build both $image" \
"and ${CHROMEOS_FACTORY_INSTALL_SHIM_NAME}."
done
FLAGS_withdev=${FLAGS_FALSE}
FLAGS_test=${FLAGS_FALSE}
FLAGS_factory=${FLAGS_FALSE}
FLAGS_factory_install=${FLAGS_TRUE}
fi
else
@ -205,4 +200,4 @@ generate_au_zip () {
test ! -d "${BUILD_DIR}" && mkdir -p "${BUILD_DIR}"
info "Running ${lgenerateauzip} ${largs} for generating AU updater zip file"
$lgenerateauzip $largs
}
}