crosvm/integration_tests/guest_under_test/upload_prebuilts.sh
Dennis Kempin f217c0fb46 integration_tests: Add prebuilts for aarch64
Updates the guest_under_test Makefile / upload script to build
for aarch64 as well.

BUG=b:176748319
TEST=Unfortunately KVM is not fully functional in our arch64 VM, so I have
not been able to test the prebuilt yet.

Change-Id: I554da6a620b26ffa1db34baa13d529f0b1de1616
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2676994
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2021-03-12 22:50:30 +00:00

49 lines
1.6 KiB
Bash
Executable file

#!/bin/bash
# Copyright 2020 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Builds and uploads prebuilts to cloud storage.
#
# Note: Only Googlers with access to the crosvm-testing cloud storage bin can
# upload prebuilts.
#
# See README.md for how to uprev the prebuilt version.
set -e
cd "${0%/*}"
readonly PREBUILT_VERSION="$(cat ./PREBUILT_VERSION)"
readonly GS_BUCKET="gs://chromeos-localmirror/distfiles"
readonly GS_PREFIX="${GS_BUCKET}/crosvm-testing"
function prebuilts_exist_error() {
echo "Prebuilts of version ${PREBUILT_VERSION} already exist. See README.md"
exit 1
}
function upload() {
local arch=$1
local remote_bzimage="${GS_PREFIX}-bzimage-${arch}-${PREBUILT_VERSION}"
local remote_rootfs="${GS_PREFIX}-rootfs-${arch}-${PREBUILT_VERSION}"
# Local files
local cargo_target=$(cargo metadata --no-deps --format-version 1 |
jq -r ".target_directory")
local local_bzimage=${cargo_target}/guest_under_test/${arch}/bzImage
local local_rootfs=${cargo_target}/guest_under_test/${arch}/rootfs
echo "Checking if prebuilts already exist."
gsutil stat "${remote_bzimage}" && prebuilts_exist_error
gsutil stat "${remote_rootfs}" && prebuilts_exist_error
echo "Building rootfs and kernel."
make ARCH=${arch} "${local_bzimage}" "${local_rootfs}"
echo "Uploading files."
gsutil cp -n -a public-read "${local_bzimage}" "${remote_bzimage}"
gsutil cp -n -a public-read "${local_rootfs}" "${remote_rootfs}"
}
upload x86_64
upload aarch64