mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-28 20:41:04 +00:00
packaging: Allow building QEMU for CC
We're adding a new target for building QEMU for CC, but it's important to note that the only difference between this one and the "vanilla" build is the installation path. The reason we're taking this approach is because the first release target for CC doesn't include TEE support. We had to also include a new builder for QEMU, a specific one for CC, as for now that's the easiest way to override the prefix in a way that we'll be easily able to expand the script to support TEE capable builds in the very near future. Fixes: #4568 Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
This commit is contained in:
parent
c4cc16efcd
commit
b307531c29
@ -76,6 +76,9 @@ cc-cloud-hypervisor-tarball:
|
||||
cc-kernel-tarball:
|
||||
${MAKE} $@-build
|
||||
|
||||
cc-qemu-tarball:
|
||||
${MAKE} $@-build
|
||||
|
||||
cc-rootfs-image-tarball:
|
||||
${MAKE} $@-build
|
||||
|
||||
|
@ -31,6 +31,7 @@ readonly virtiofsd_builder="${static_build_dir}/virtiofsd/build-static-virtiofsd
|
||||
readonly rootfs_builder="${repo_root_dir}/tools/packaging/guest-image/build_image.sh"
|
||||
|
||||
readonly cc_prefix="/opt/confidential-containers"
|
||||
readonly qemu_cc_builder="${static_build_dir}/qemu/build-static-qemu-cc.sh"
|
||||
|
||||
ARCH=$(uname -m)
|
||||
|
||||
@ -114,6 +115,15 @@ install_cc_kernel() {
|
||||
DESTDIR="${destdir}" PREFIX="${cc_prefix}" "${kernel_builder}" -f -v "${kernel_version}"
|
||||
}
|
||||
|
||||
# Install static CC qemu asset
|
||||
install_cc_qemu() {
|
||||
info "build static CC qemu"
|
||||
export qemu_repo="$(yq r $versions_yaml assets.hypervisor.qemu.url)"
|
||||
export qemu_version="$(yq r $versions_yaml assets.hypervisor.qemu.version)"
|
||||
"${qemu_cc_builder}"
|
||||
tar xvf "${builddir}/kata-static-qemu-cc.tar.gz" -C "${destdir}"
|
||||
}
|
||||
|
||||
#Install all components that are not assets
|
||||
install_cc_shimv2() {
|
||||
GO_VERSION="$(yq r ${versions_yaml} languages.golang.meta.newest-version)"
|
||||
@ -223,6 +233,8 @@ handle_build() {
|
||||
|
||||
cc-kernel) install_cc_kernel ;;
|
||||
|
||||
cc-qemu) install_cc_qemu ;;
|
||||
|
||||
cc-rootfs-image) install_cc_image ;;
|
||||
|
||||
cc-shim-v2) install_cc_shimv2 ;;
|
||||
|
31
tools/packaging/static-build/qemu/build-static-qemu-cc.sh
Executable file
31
tools/packaging/static-build/qemu/build-static-qemu-cc.sh
Executable file
@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright (c) 2022 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"
|
||||
|
||||
qemu_repo="${qemu_repo:-}"
|
||||
qemu_version="${qemu_version:-}"
|
||||
|
||||
export prefix="/opt/confidential-containers/"
|
||||
|
||||
if [ -z "$qemu_repo" ]; then
|
||||
info "Get qemu information from runtime versions.yaml"
|
||||
qemu_url=$(get_from_kata_deps "assets.hypervisor.qemu.url")
|
||||
[ -n "$qemu_url" ] || die "failed to get qemu url"
|
||||
qemu_repo="${qemu_url}.git"
|
||||
fi
|
||||
[ -n "$qemu_repo" ] || die "failed to get qemu repo"
|
||||
|
||||
[ -n "$qemu_version" ] || qemu_version=$(get_from_kata_deps "assets.hypervisor.qemu.version")
|
||||
[ -n "$qemu_version" ] || die "failed to get qemu version"
|
||||
|
||||
"${script_dir}/build-base-qemu.sh" "${qemu_repo}" "${qemu_version}" "" "kata-static-qemu-cc.tar.gz"
|
Loading…
Reference in New Issue
Block a user