mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-30 23:37:45 +00:00
cache: kernel: Fix SEV kernel caching
The SEV kernel cache calls create_cache_asset() twice, once for the kernel and once for modules. Both calls need to use the same version string, otherwise the second call overwrites the "latest" file of the first one and the cache is not used. Fixes: #7403 Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
This commit is contained in:
@@ -60,13 +60,14 @@ cache_kernel_artifacts() {
|
||||
;;
|
||||
esac
|
||||
|
||||
create_cache_asset "${kernel_tarball_name}" "${current_kernel_version}-${current_kernel_kata_config_version}-${kernel_last_commit}" "${current_kernel_image}"
|
||||
local current_component_version="${current_kernel_version}-${current_kernel_kata_config_version}-${kernel_last_commit}"
|
||||
create_cache_asset "${kernel_tarball_name}" "${current_component_version}" "${current_kernel_image}"
|
||||
if [[ "${KERNEL_FLAVOUR}" == "kernel-sev" ]]; then
|
||||
module_dir="${repo_root_dir}/tools/packaging/kata-deploy/local-build/build/kernel-sev/builddir/kata-linux-${current_kernel_version#v}-${current_kernel_kata_config_version}/lib/modules/${current_kernel_version#v}"
|
||||
if [ ! -f "${kernel_modules_tarball_path}" ]; then
|
||||
tar cvfJ "${kernel_modules_tarball_path}" "${module_dir}/kernel/drivers/virt/coco/efi_secret/"
|
||||
fi
|
||||
create_cache_asset "kata-static-kernel-sev-modules.tar.xz" "${current_kernel_version}-${current_kernel_kata_config_version}" "${current_kernel_image}"
|
||||
create_cache_asset "kata-static-kernel-sev-modules.tar.xz" "${current_component_version}" "${current_kernel_image}"
|
||||
fi
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user