mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-22 06:01:41 +02:00
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 <davidjames@chromium.org> Reviewed-by: Chris Sosa <sosa@chromium.org> Reviewed-by: Ryan Cui <rcui@chromium.org> Commit-Ready: David James <davidjames@chromium.org>
This commit is contained in:
parent
b4605b42c0
commit
a884512e93
@ -10,10 +10,11 @@ SCRIPT_ROOT=$(dirname $(readlink -f "$0"))
|
|||||||
. "${SCRIPT_ROOT}/common.sh" || exit 1
|
. "${SCRIPT_ROOT}/common.sh" || exit 1
|
||||||
|
|
||||||
# Flags
|
# 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 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 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")
|
TMP=$(mktemp -d "/tmp/image.XXXX")
|
||||||
|
|
||||||
@ -31,8 +32,11 @@ main() {
|
|||||||
switch_to_strict_mode
|
switch_to_strict_mode
|
||||||
|
|
||||||
if [[ -z "${FLAGS_from}" ]]; then
|
if [[ -z "${FLAGS_from}" ]]; then
|
||||||
echo "Please specify --from directory"
|
die "Please specify --from directory"
|
||||||
exit 1
|
fi
|
||||||
|
|
||||||
|
if [[ -z "${FLAGS_image_dir}" ]]; then
|
||||||
|
die "Please specify --image_dir directory"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
FLAGS_from=$(readlink -f "${FLAGS_from}")
|
FLAGS_from=$(readlink -f "${FLAGS_from}")
|
||||||
@ -50,8 +54,6 @@ main() {
|
|||||||
cd "${TMP}"
|
cd "${TMP}"
|
||||||
|
|
||||||
echo "Extracting build artifacts..."
|
echo "Extracting build artifacts..."
|
||||||
unzip "${FLAGS_from}/${FLAGS_zipname}"
|
|
||||||
mkdir -p image
|
|
||||||
mkdir -p "tarball/${FLAGS_output_tag}"
|
mkdir -p "tarball/${FLAGS_output_tag}"
|
||||||
|
|
||||||
if which pbzip2 >/dev/null 2>/dev/null; then
|
if which pbzip2 >/dev/null 2>/dev/null; then
|
||||||
@ -65,10 +67,9 @@ main() {
|
|||||||
|
|
||||||
cd "${TMP}"
|
cd "${TMP}"
|
||||||
|
|
||||||
mv chromiumos_test_image.bin image/chromiumos_image.bin
|
|
||||||
|
|
||||||
echo "Formatting rootfs as a USB image..."
|
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"
|
--to="tarball/${FLAGS_output_tag}/chromeos-hwqual-usb.img"
|
||||||
|
|
||||||
echo "Inserting documentation and autotest to tarball..."
|
echo "Inserting documentation and autotest to tarball..."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user