packaging: Allow building Cloud Hypervisor for CC

We're adding a new target for building Cloud Hypervisor for CC, but it's
important to note that the only difference between this one and the
"vanilla" build is the installation path.

The reasons we're taking this approach are:
* Cloud Hypervisor, for the `main` and `stable` branches, is already
  built with TDX support.
* The first target for the CC release doesn't include TEE support.

Fixes: #4566

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
This commit is contained in:
Fabiano Fidêncio
2022-06-30 13:59:39 +02:00
parent 8f6eca517a
commit caabd54b6e
2 changed files with 18 additions and 0 deletions

View File

@@ -70,6 +70,9 @@ install-tarball:
image: kata-tarball
$(MK_DIR)kata-deploy-build-and-upload-image.sh $(CURDIR)/kata-static.tar.xz
cc-cloud-hypervisor-tarball:
${MAKE} $@-build
cc-rootfs-image-tarball:
${MAKE} $@-build

View File

@@ -85,6 +85,19 @@ EOF
exit "${return_code}"
}
# Install static CC cloud-hypervisor asset
install_cc_clh() {
if [[ "${ARCH}" == "x86_64" ]]; then
export features="tdx"
fi
info "build static CC cloud-hypervisor"
"${clh_builder}"
info "Install static CC cloud-hypervisor"
mkdir -p "${destdir}/${cc_prefix}/bin/"
sudo install -D --owner root --group root --mode 0744 cloud-hypervisor/cloud-hypervisor "${destdir}/${cc_prefix}/bin/cloud-hypervisor"
}
#Install cc capable guest image
install_cc_image() {
info "Create CC image"
@@ -200,6 +213,8 @@ handle_build() {
install_virtiofsd
;;
cc-cloud-hypervisor) install_cc_clh ;;
cc-rootfs-image) install_cc_image ;;
cc-shim-v2) install_cc_shimv2 ;;