From caabd54b6e65d8fe69caf13ab426587371a800e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Thu, 30 Jun 2022 13:59:39 +0200 Subject: [PATCH] packaging: Allow building Cloud Hypervisor for CC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- tools/packaging/kata-deploy/local-build/Makefile | 3 +++ .../local-build/kata-deploy-binaries.sh | 15 +++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/tools/packaging/kata-deploy/local-build/Makefile b/tools/packaging/kata-deploy/local-build/Makefile index 73204e106d..d9229b38dc 100644 --- a/tools/packaging/kata-deploy/local-build/Makefile +++ b/tools/packaging/kata-deploy/local-build/Makefile @@ -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 diff --git a/tools/packaging/kata-deploy/local-build/kata-deploy-binaries.sh b/tools/packaging/kata-deploy/local-build/kata-deploy-binaries.sh index 7a29c40f08..41fba87929 100755 --- a/tools/packaging/kata-deploy/local-build/kata-deploy-binaries.sh +++ b/tools/packaging/kata-deploy/local-build/kata-deploy-binaries.sh @@ -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 ;;