From a884512e9300ecde4873c235ce3a6bf4d58828d4 Mon Sep 17 00:00:00 2001 From: David James Date: Mon, 15 Oct 2012 11:08:41 -0700 Subject: [PATCH] Don't depend on zip files in archive_hwqual (1 of 2). Right now, archive_hwqual extracts the test image from image.zip. This dependency between archive_hwqual and the image zipfile is a bit of a landmine because it's currently undocumented and not tested by unit tests or the commit queue. Fortunately, we can remove this dependency, as the test image already lives in the image dir. This simplification also speeds up the archive stage by removing unnecessary unzipping. This CL teaches archive_hwqual to look in the image dir instead of re-extracting the test image from the image.zip file. This will allow me to later decouple the image.zip creation from the creation of the hwqual tarball. BUG=chromium-os:35331 CQ-DEPEND=CL:35590 TEST=canary remote trybot run. Change-Id: I5930f06f58a9b63afa9ab3445823ed9fd0c2a2e2 Reviewed-on: https://gerrit.chromium.org/gerrit/35588 Tested-by: David James Reviewed-by: Chris Sosa Reviewed-by: Ryan Cui Commit-Ready: David James --- archive_hwqual | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/archive_hwqual b/archive_hwqual index 70aedce4dd..7a5d3c6c65 100755 --- a/archive_hwqual +++ b/archive_hwqual @@ -10,10 +10,11 @@ SCRIPT_ROOT=$(dirname $(readlink -f "$0")) . "${SCRIPT_ROOT}/common.sh" || exit 1 # Flags -DEFINE_string from "" "Directory with build archive (zipname)" +DEFINE_string from "" "Directory with autotest tarball" DEFINE_string to "" "Directory to receive packaged hwqual" -DEFINE_string zipname "image.zip" "Name of zip file to create." DEFINE_string output_tag "chromeos-hwqual" "Name used in tar" +DEFINE_string image_dir "" "Directory containing test image." +DEFINE_string image "${CHROMEOS_TEST_IMAGE_NAME}" "Name of image file to use." TMP=$(mktemp -d "/tmp/image.XXXX") @@ -31,8 +32,11 @@ main() { switch_to_strict_mode if [[ -z "${FLAGS_from}" ]]; then - echo "Please specify --from directory" - exit 1 + die "Please specify --from directory" + fi + + if [[ -z "${FLAGS_image_dir}" ]]; then + die "Please specify --image_dir directory" fi FLAGS_from=$(readlink -f "${FLAGS_from}") @@ -50,8 +54,6 @@ main() { cd "${TMP}" echo "Extracting build artifacts..." - unzip "${FLAGS_from}/${FLAGS_zipname}" - mkdir -p image mkdir -p "tarball/${FLAGS_output_tag}" if which pbzip2 >/dev/null 2>/dev/null; then @@ -65,10 +67,9 @@ main() { cd "${TMP}" - mv chromiumos_test_image.bin image/chromiumos_image.bin - echo "Formatting rootfs as a USB image..." - "${script_dir}/image_to_usb.sh" --from=image \ + "${script_dir}/image_to_usb.sh" --from="${FLAGS_image_dir}" \ + --image="${FLAGS_image}" \ --to="tarball/${FLAGS_output_tag}/chromeos-hwqual-usb.img" echo "Inserting documentation and autotest to tarball..."