mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-25 19:21:53 +00:00
packaging: Fix sev cache kernel issue
Fix cache kernel issue introduced by #6177 Fixes: #6362 Signed-off-by: Unmesh Deodhar <udeodhar@amd.com>
This commit is contained in:
parent
2d525bbf1b
commit
46a6fe75dc
@ -19,9 +19,6 @@ source "${packaging_root_dir}/scripts/lib.sh"
|
|||||||
|
|
||||||
readonly osbuilder_dir="$(cd "${repo_root_dir}/tools/osbuilder" && pwd)"
|
readonly osbuilder_dir="$(cd "${repo_root_dir}/tools/osbuilder" && pwd)"
|
||||||
|
|
||||||
patches_path=""
|
|
||||||
readonly default_patches_dir="${packaging_root_dir}/kernel/patches"
|
|
||||||
|
|
||||||
export GOPATH=${GOPATH:-${HOME}/go}
|
export GOPATH=${GOPATH:-${HOME}/go}
|
||||||
|
|
||||||
final_image_name="kata-containers"
|
final_image_name="kata-containers"
|
||||||
|
@ -239,13 +239,14 @@ install_cc_image() {
|
|||||||
local root_hash_tdx=""
|
local root_hash_tdx=""
|
||||||
local initramfs_last_commit=""
|
local initramfs_last_commit=""
|
||||||
if [ -n "${tee}" ]; then
|
if [ -n "${tee}" ]; then
|
||||||
jenkins="${jenkins_url}/job/kata-containers-2.0-rootfs-image-${tee}-cc-$(uname -m)/${cached_artifacts_path}"
|
|
||||||
if [ "${tee}" == "tdx" ]; then
|
if [ "${tee}" == "tdx" ]; then
|
||||||
|
jenkins="${jenkins_url}/job/kata-containers-2.0-rootfs-image-${tee}-cc-$(uname -m)/${cached_artifacts_path}"
|
||||||
component="${tee}-rootfs-image"
|
component="${tee}-rootfs-image"
|
||||||
root_hash_vanilla=""
|
root_hash_vanilla=""
|
||||||
root_hash_tdx="root_hash_${tee}.txt"
|
root_hash_tdx="root_hash_${tee}.txt"
|
||||||
fi
|
fi
|
||||||
if [ "${tee}" == "sev" ]; then
|
if [ "${tee}" == "sev" ]; then
|
||||||
|
jenkins="${jenkins_url}/job/kata-containers-2.0-rootfs-initrd-${tee}-cc-$(uname -m)/${cached_artifacts_path}"
|
||||||
component="${tee}-rootfs-initrd"
|
component="${tee}-rootfs-initrd"
|
||||||
root_hash_vanilla=""
|
root_hash_vanilla=""
|
||||||
initramfs_last_commit="$(get_initramfs_image_name)"
|
initramfs_last_commit="$(get_initramfs_image_name)"
|
||||||
@ -265,7 +266,7 @@ install_cc_image() {
|
|||||||
install_cached_component \
|
install_cached_component \
|
||||||
"${component}" \
|
"${component}" \
|
||||||
"${jenkins}" \
|
"${jenkins}" \
|
||||||
"${osbuilder_last_commit}-${guest_image_last_commit}$-${initramfs_last_commit}-${agent_last_commit}-${libs_last_commit}-${attestation_agent_version}-${gperf_version}-${libseccomp_version}-${pause_version}-${rust_version}-${image_type}-${AA_KBC}" \
|
"${osbuilder_last_commit}-${guest_image_last_commit}-${initramfs_last_commit}-${agent_last_commit}-${libs_last_commit}-${attestation_agent_version}-${gperf_version}-${libseccomp_version}-${pause_version}-${rust_version}-${image_type}-${AA_KBC}" \
|
||||||
"" \
|
"" \
|
||||||
"${final_tarball_name}" \
|
"${final_tarball_name}" \
|
||||||
"${final_tarball_path}" \
|
"${final_tarball_path}" \
|
||||||
@ -285,7 +286,7 @@ install_cc_image() {
|
|||||||
install_cc_sev_image() {
|
install_cc_sev_image() {
|
||||||
AA_KBC="online_sev_kbc"
|
AA_KBC="online_sev_kbc"
|
||||||
image_type="initrd"
|
image_type="initrd"
|
||||||
install_cc_image "${AA_KBC}" "${image_type}" "sev"
|
install_cc_image "${AA_KBC}" "${image_type}" "" "" "sev"
|
||||||
}
|
}
|
||||||
|
|
||||||
install_cc_tdx_image() {
|
install_cc_tdx_image() {
|
||||||
@ -400,7 +401,7 @@ install_cached_kernel_component() {
|
|||||||
kernel_version="${2}"
|
kernel_version="${2}"
|
||||||
module_dir="${3:-}"
|
module_dir="${3:-}"
|
||||||
|
|
||||||
install_cached_compnent \
|
install_cached_component \
|
||||||
"kernel" \
|
"kernel" \
|
||||||
"${jenkins_url}/job/kata-containers-2.0-kernel-${tee}-cc-$(uname -m)/${cached_artifacts_path}" \
|
"${jenkins_url}/job/kata-containers-2.0-kernel-${tee}-cc-$(uname -m)/${cached_artifacts_path}" \
|
||||||
"${kernel_version}" \
|
"${kernel_version}" \
|
||||||
@ -453,7 +454,9 @@ install_cc_tdx_kernel() {
|
|||||||
|
|
||||||
install_cc_sev_kernel() {
|
install_cc_sev_kernel() {
|
||||||
kernel_version="$(yq r $versions_yaml assets.kernel.sev.version)"
|
kernel_version="$(yq r $versions_yaml assets.kernel.sev.version)"
|
||||||
install_cc_tee_kernel "sev" "${kernel_version}"
|
default_patches_dir="${repo_root_dir}/tools/packaging/kernel/patches"
|
||||||
|
module_dir="${repo_root_dir}/tools/packaging/kata-deploy/local-build/build/cc-sev-kernel/builddir/kata-linux-${kernel_version#v}-$(get_config_version)/lib/modules/${kernel_version#v}"
|
||||||
|
install_cc_tee_kernel "sev" "${kernel_version}" "${module_dir}"
|
||||||
}
|
}
|
||||||
|
|
||||||
install_cc_tee_qemu() {
|
install_cc_tee_qemu() {
|
||||||
|
@ -24,8 +24,6 @@ download_kernel=false
|
|||||||
# The repository where kernel configuration lives
|
# The repository where kernel configuration lives
|
||||||
readonly kernel_config_repo="github.com/${project_name}/kata-containers/tools/packaging"
|
readonly kernel_config_repo="github.com/${project_name}/kata-containers/tools/packaging"
|
||||||
readonly patches_repo="github.com/${project_name}/kata-containers/tools/packaging"
|
readonly patches_repo="github.com/${project_name}/kata-containers/tools/packaging"
|
||||||
# Default path to search patches to apply to kernel
|
|
||||||
readonly default_patches_dir="${script_dir}/patches"
|
|
||||||
# Default path to search config for kata
|
# Default path to search config for kata
|
||||||
readonly default_kernel_config_dir="${script_dir}/configs"
|
readonly default_kernel_config_dir="${script_dir}/configs"
|
||||||
# Default path to search for kernel config fragments
|
# Default path to search for kernel config fragments
|
||||||
|
@ -1 +1 @@
|
|||||||
100
|
101
|
||||||
|
@ -19,6 +19,9 @@ short_commit_length=10
|
|||||||
|
|
||||||
hub_bin="hub-bin"
|
hub_bin="hub-bin"
|
||||||
|
|
||||||
|
patches_path=""
|
||||||
|
default_patches_dir="${repo_root_dir}/tools/packaging/kernel/patches"
|
||||||
|
|
||||||
# Jenkins URL
|
# Jenkins URL
|
||||||
jenkins_url="http://jenkins.katacontainers.io"
|
jenkins_url="http://jenkins.katacontainers.io"
|
||||||
# Path where cached artifacts are found.
|
# Path where cached artifacts are found.
|
||||||
@ -115,7 +118,7 @@ get_config_and_patches() {
|
|||||||
|
|
||||||
get_config_version() {
|
get_config_version() {
|
||||||
get_config_and_patches
|
get_config_and_patches
|
||||||
config_version_file="${default_patches_dir}/../kata_config_version"
|
config_version_file="${repo_root_dir}/tools/packaging/kernel/kata_config_version"
|
||||||
if [ -f "${config_version_file}" ]; then
|
if [ -f "${config_version_file}" ]; then
|
||||||
cat "${config_version_file}"
|
cat "${config_version_file}"
|
||||||
else
|
else
|
||||||
|
@ -47,11 +47,9 @@ cache_kernel_artifacts() {
|
|||||||
create_cache_asset "${kernel_tarball_name}" "${current_kernel_version}" "${current_kernel_image}"
|
create_cache_asset "${kernel_tarball_name}" "${current_kernel_version}" "${current_kernel_image}"
|
||||||
|
|
||||||
if [ "${TEE}" == "sev" ]; then
|
if [ "${TEE}" == "sev" ]; then
|
||||||
module_dir="${repo_root_dir}/tools/packaging/kata-deploy/local-build/build/cc-sev-kernel/builddir/kata-linux-${kernel_version#v}-${get_config_version}/lib/modules/${kernel_version#v}"
|
module_dir="${repo_root_dir}/tools/packaging/kata-deploy/local-build/build/cc-sev-kernel/builddir/kata-linux-${current_kernel_version#v}-$(get_config_version)/lib/modules/${current_kernel_version#v}"
|
||||||
pushd "${repo_root_dir}/tools/packaging/kata-deploy/local-build/build/"
|
tar cvfJ "${repo_root_dir}/tools/packaging/kata-deploy/local-build/build/kata-static-cc-sev-kernel-modules.tar.xz" "${module_dir}/kernel/drivers/virt/coco/efi_secret/"
|
||||||
tar cvfJ "kata-static-cc-sev-kernel-modules.tar.xz" "${module_dir}/kernel/drivers/virt/coco/efi_secret/"
|
create_cache_asset "kata-static-cc-sev-kernel-modules.tar.xz" "${current_kernel_version}" "${current_kernel_image}"
|
||||||
popd
|
|
||||||
create_cache_asset "kata-static-cc-kernel-modules.tar.xz" "${current_kernel_version}" "${current_kernel_image}"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -114,6 +112,7 @@ cache_rootfs_artifacts() {
|
|||||||
root_hash_tdx="${repo_root_dir}/tools/osbuilder/root_hash_tdx.txt"
|
root_hash_tdx="${repo_root_dir}/tools/osbuilder/root_hash_tdx.txt"
|
||||||
fi
|
fi
|
||||||
if [ "${TEE}" == "sev" ]; then
|
if [ "${TEE}" == "sev" ]; then
|
||||||
|
root_hash_vanilla=""
|
||||||
rootfs_tarball_name="kata-static-cc-sev-rootfs-initrd.tar.xz"
|
rootfs_tarball_name="kata-static-cc-sev-rootfs-initrd.tar.xz"
|
||||||
aa_kbc="online_sev_kbc"
|
aa_kbc="online_sev_kbc"
|
||||||
image_type="initrd"
|
image_type="initrd"
|
||||||
|
Loading…
Reference in New Issue
Block a user