Remove old logic ... and don't needlessly modifiy dev image.

Change-Id: I9b4047f2f124875553542df73e16cba6be41c561

BUG=chromium-os:chromium-os:8364
TEST=Ran it with pfq options.

Review URL: http://codereview.chromium.org/6527001
This commit is contained in:
Chris Sosa 2011-02-16 15:33:11 -08:00
parent 900bbd53ed
commit b885b80a33
3 changed files with 15 additions and 26 deletions

View File

@ -66,6 +66,7 @@ DEFINE_boolean official_build $FLAGS_FALSE \
DEFINE_string test_tarball "" "Optional path to test tarball to archive" DEFINE_string test_tarball "" "Optional path to test tarball to archive"
DEFINE_boolean test_mod $FLAGS_TRUE "Modify image for testing purposes" DEFINE_boolean test_mod $FLAGS_TRUE "Modify image for testing purposes"
DEFINE_boolean prebuilt_upload $FLAGS_FALSE "Upload prebuilt binary packages." DEFINE_boolean prebuilt_upload $FLAGS_FALSE "Upload prebuilt binary packages."
DEFINE_boolean remove_dev $FLAGS_TRUE "Remove the de image during archive."
DEFINE_string to "$DEFAULT_TO" "Directory of build archive" DEFINE_string to "$DEFAULT_TO" "Directory of build archive"
DEFINE_string zipname "image.zip" "Name of zip file to create." DEFINE_string zipname "image.zip" "Name of zip file to create."
@ -138,27 +139,11 @@ echo "archive to file: $ZIPFILE"
rm -rf "$OUTDIR" rm -rf "$OUTDIR"
mkdir -p "$OUTDIR" mkdir -p "$OUTDIR"
SRC_IMAGE="${FLAGS_from}/chromiumos_image.bin"
BACKUP_IMAGE="${FLAGS_from}/chromiumos_image_bkup.bin"
# Apply mod_image_for_test to the developer image, and store the
# result in a new location. Usage:
# do_chroot_mod "$OUTPUT_IMAGE" "--flags_to_mod_image_for_test"
function do_chroot_mod() {
MOD_ARGS=$2
OUTPUT_IMAGE=$1
cp -f "${SRC_IMAGE}" "${BACKUP_IMAGE}"
./enter_chroot.sh -- ./mod_image_for_test.sh --board $FLAGS_board \
--yes ${MOD_ARGS}
mv "${SRC_IMAGE}" "${OUTPUT_IMAGE}"
mv "${BACKUP_IMAGE}" "${SRC_IMAGE}"
}
# Modify image for test if flag set. # Modify image for test if flag set.
if [ $FLAGS_test_mod -eq $FLAGS_TRUE ]; then if [ $FLAGS_test_mod -eq $FLAGS_TRUE ]; then
echo "Modifying image for test" echo "Modifying image for test"
do_chroot_mod "${FLAGS_from}/chromiumos_test_image.bin" "" ./enter_chroot.sh -- ./mod_image_for_test.sh --board $FLAGS_board \
--noinplace --yes
pushd "${FLAGS_chroot}/build/${FLAGS_board}/usr/local" pushd "${FLAGS_chroot}/build/${FLAGS_board}/usr/local"
echo "Archiving autotest build artifacts" echo "Archiving autotest build artifacts"
@ -168,8 +153,8 @@ fi
if [ $FLAGS_factory_test_mod -eq $FLAGS_TRUE ]; then if [ $FLAGS_factory_test_mod -eq $FLAGS_TRUE ]; then
echo "Modifying image for factory test" echo "Modifying image for factory test"
do_chroot_mod "${FLAGS_from}/chromiumos_factory_image.bin" \ ./enter_chroot.sh -- ./mod_image_for_test.sh --board $FLAGS_board \
"--factory" --yes --noinplace --factory
fi fi
# Modify for recovery # Modify for recovery
@ -181,8 +166,8 @@ if [ $FLAGS_official_build -eq $FLAGS_TRUE ]; then
fi fi
# Remove the developer build if test image is also built. # Remove the developer build if test image is also built.
if [ $FLAGS_test_mod -eq $FLAGS_TRUE ] ; then if [ $FLAGS_remove_dev -eq $FLAGS_TRUE ]; then
rm -f ${SRC_IMAGE} rm -f "${FLAGS_from}/${CHROMEOS_IMAGE_NAME}"
fi fi
# Build differently sized shims. Currently only factory install shim is # Build differently sized shims. Currently only factory install shim is

View File

@ -157,7 +157,7 @@ DEFAULT_FAST=${FLAGS_TRUE}
# Standard filenames # Standard filenames
CHROMEOS_IMAGE_NAME="chromiumos_image.bin" CHROMEOS_IMAGE_NAME="chromiumos_image.bin"
CHROMEOS_TEST_IMAGE_NAME="chromiumos_test_image.bin" CHROMEOS_TEST_IMAGE_NAME="chromiumos_test_image.bin"
CHROMEOS_FACTORY_TEST_IMAGE_NAME="chromiumos_factory_image.bin"
# Directory locations inside the dev chroot # Directory locations inside the dev chroot
CHROOT_TRUNK_DIR="/home/$USER/trunk" CHROOT_TRUNK_DIR="/home/$USER/trunk"

View File

@ -54,11 +54,11 @@ DEFINE_boolean fast ${DEFAULT_FAST} "Call many emerges in parallel"
DEFINE_boolean inplace $FLAGS_TRUE \ DEFINE_boolean inplace $FLAGS_TRUE \
"Modify/overwrite the image ${CHROMEOS_IMAGE_NAME} in place. \ "Modify/overwrite the image ${CHROMEOS_IMAGE_NAME} in place. \
Otherwise the image will be copied to ${CHROMEOS_TEST_IMAGE_NAME} \ Otherwise the image will be copied to ${CHROMEOS_TEST_IMAGE_NAME} \
if needed, and modified there" (or ${CHROMEOS_FACTORY_TEST_IMAGE_NAME} for --factory) if needed, and \
modified there"
DEFINE_boolean force_copy ${FLAGS_FALSE} \ DEFINE_boolean force_copy ${FLAGS_FALSE} \
"Always rebuild test image if --noinplace" "Always rebuild test image if --noinplace"
# Parse command line # Parse command line
FLAGS "$@" || exit 1 FLAGS "$@" || exit 1
eval set -- "${FLAGS_ARGV}" eval set -- "${FLAGS_ARGV}"
@ -182,7 +182,11 @@ IMAGE_DIR="$(dirname "${FLAGS_image}")"
# Copy the image to a test location if required # Copy the image to a test location if required
if [ ${FLAGS_inplace} -eq ${FLAGS_FALSE} ]; then if [ ${FLAGS_inplace} -eq ${FLAGS_FALSE} ]; then
TEST_PATHNAME="${IMAGE_DIR}/${CHROMEOS_TEST_IMAGE_NAME}" if [ ${FLAGS_factory} -eq ${FLAGS_TRUE} ]; then
TEST_PATHNAME="${IMAGE_DIR}/${CHROMEOS_FACTORY_TEST_IMAGE_NAME}"
else
TEST_PATHNAME="${IMAGE_DIR}/${CHROMEOS_TEST_IMAGE_NAME}"
fi
if [ ! -f "${TEST_PATHNAME}" ] || \ if [ ! -f "${TEST_PATHNAME}" ] || \
[ ${FLAGS_force_copy} -eq ${FLAGS_TRUE} ] ; then [ ${FLAGS_force_copy} -eq ${FLAGS_TRUE} ] ; then
echo "Creating test image from original..." echo "Creating test image from original..."