packaging: Allow building a TDX capable kernel

We're adding a new target for building a TDX capable kernel for CC.
This commit, differently than c4cc16efcd,
introduces support for building the artefacts that are TEE specific.

Fixes: #4622

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
This commit is contained in:
Fabiano Fidêncio 2022-07-11 08:41:56 +02:00
parent 423162d2aa
commit 516ed240f4
2 changed files with 22 additions and 0 deletions

View File

@ -88,6 +88,9 @@ cc-cloud-hypervisor-tarball:
cc-kernel-tarball:
${MAKE} $@-build
cc-tdx-kernel-tarball:
${MAKE} $@-build
cc-qemu-tarball:
${MAKE} $@-build

View File

@ -84,6 +84,7 @@ options:
cc
cc-cloud-hypervisor
cc-kernel
cc-tdx-kernel
cc-qemu
cc-rootfs-image
cc-shimv2
@ -116,6 +117,22 @@ install_cc_image() {
"${rootfs_builder}" --imagetype=image --prefix="${cc_prefix}" --destdir="${destdir}"
}
#Install CC kernel assert, with TEE support
install_cc_tee_kernel() {
tee="${1}"
[ "${tee}" != "tdx" ] && die "Non supported TEE"
export kernel_version="$(yq r $versions_yaml assets.kernel.${tee}.tag)"
export kernel_url="$(yq r $versions_yaml assets.kernel.${tee}.url)"
DESTDIR="${destdir}" PREFIX="${cc_prefix}" "${kernel_builder}" -x "${tee}" -v "${kernel_version}" -u "${kernel_url}"
}
#Install CC kernel assert for Intel TDX
install_cc_tdx_kernel() {
install_cc_tee_kernel "tdx"
}
#Install CC kernel asset
install_cc_kernel() {
export kernel_version="$(yq r $versions_yaml assets.kernel.version)"
@ -258,6 +275,8 @@ handle_build() {
cc-kernel) install_cc_kernel ;;
cc-tdx-kernel) install_cc_tdx_kernel ;;
cc-qemu) install_cc_qemu ;;
cc-rootfs-image) install_cc_image ;;