Files
kata-containers/static-build/firecracker/build-static-firecracker.sh
Archana Shinde 9377c5d5ca release: Fix bug in how version is determined for actions
Althought, we changed the script "gen_versions_txt.sh" to accept a tag
rather than a branch, this change is not sufficient.
This script generates the right version file based on a tag, but
function `get_from_kata_deps` does not use this, and ends up using the
master branch instead. This is because this function looks at an env
variable called $BRANCH and ends up using master branch if the variable
is not defined.

Pass the tag/new version to the build scripts, so that this tag is
passed along to `get_from_kata_dep`.
With this change, the correct version information is consumed by the
build scripts for the various hypervisors and kernel.

Fixes #831

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2019-12-03 17:56:03 -08:00

41 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
#
# Copyright (c) 2018 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
set -o errexit
set -o nounset
set -o pipefail
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${script_dir}/../../scripts/lib.sh"
config_dir="${script_dir}/../../scripts/"
firecracker_repo="${firecracker_repo:-}"
firecracker_version="${firecracker_version:-}"
kata_version="${kata_version:-}"
if [ -z "$firecracker_repo" ]; then
info "Get firecracker information from runtime versions.yaml"
firecracker_url=$(get_from_kata_deps "assets.hypervisor.firecracker.url" "${kata_version}")
[ -n "$firecracker_url" ] || die "failed to get firecracker url"
firecracker_repo="${firecracker_url}.git"
fi
[ -n "$firecracker_repo" ] || die "failed to get firecracker repo"
[ -n "$firecracker_version" ] || firecracker_version=$(get_from_kata_deps "assets.hypervisor.firecracker.version" "${kata_version}")
[ -n "$firecracker_version" ] || die "failed to get firecracker version"
info "Build ${firecracker_repo} version: ${firecracker_version}"
git clone ${firecracker_repo}
cd firecracker
git checkout ${firecracker_version}
./tools/devtool --unattended build --release
ln -s ./build/cargo_target/x86_64-unknown-linux-musl/release/firecracker ./firecracker-static
ln -s ./build/cargo_target/x86_64-unknown-linux-musl/release/jailer ./jailer-static