diff --git a/tools/packaging/guest-image/build_image.sh b/tools/packaging/guest-image/build_image.sh index ee77f396b9..27bd02c579 100755 --- a/tools/packaging/guest-image/build_image.sh +++ b/tools/packaging/guest-image/build_image.sh @@ -19,9 +19,6 @@ source "${packaging_root_dir}/scripts/lib.sh" 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} final_image_name="kata-containers" 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 ba213d0d15..765c349171 100755 --- a/tools/packaging/kata-deploy/local-build/kata-deploy-binaries.sh +++ b/tools/packaging/kata-deploy/local-build/kata-deploy-binaries.sh @@ -239,13 +239,14 @@ install_cc_image() { local root_hash_tdx="" local initramfs_last_commit="" 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 + jenkins="${jenkins_url}/job/kata-containers-2.0-rootfs-image-${tee}-cc-$(uname -m)/${cached_artifacts_path}" component="${tee}-rootfs-image" root_hash_vanilla="" root_hash_tdx="root_hash_${tee}.txt" fi 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" root_hash_vanilla="" initramfs_last_commit="$(get_initramfs_image_name)" @@ -265,7 +266,7 @@ install_cc_image() { install_cached_component \ "${component}" \ "${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_path}" \ @@ -285,7 +286,7 @@ install_cc_image() { install_cc_sev_image() { AA_KBC="online_sev_kbc" image_type="initrd" - install_cc_image "${AA_KBC}" "${image_type}" "sev" + install_cc_image "${AA_KBC}" "${image_type}" "" "" "sev" } install_cc_tdx_image() { @@ -400,7 +401,7 @@ install_cached_kernel_component() { kernel_version="${2}" module_dir="${3:-}" - install_cached_compnent \ + install_cached_component \ "kernel" \ "${jenkins_url}/job/kata-containers-2.0-kernel-${tee}-cc-$(uname -m)/${cached_artifacts_path}" \ "${kernel_version}" \ @@ -453,7 +454,9 @@ install_cc_tdx_kernel() { install_cc_sev_kernel() { 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() { diff --git a/tools/packaging/kernel/build-kernel.sh b/tools/packaging/kernel/build-kernel.sh index bc4c85ee1d..68aead4131 100755 --- a/tools/packaging/kernel/build-kernel.sh +++ b/tools/packaging/kernel/build-kernel.sh @@ -24,8 +24,6 @@ download_kernel=false # The repository where kernel configuration lives readonly kernel_config_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 readonly default_kernel_config_dir="${script_dir}/configs" # Default path to search for kernel config fragments diff --git a/tools/packaging/kernel/kata_config_version b/tools/packaging/kernel/kata_config_version index 29d6383b52..398050c62c 100644 --- a/tools/packaging/kernel/kata_config_version +++ b/tools/packaging/kernel/kata_config_version @@ -1 +1 @@ -100 +101 diff --git a/tools/packaging/scripts/lib.sh b/tools/packaging/scripts/lib.sh index ef74acad33..b884cb0a3f 100755 --- a/tools/packaging/scripts/lib.sh +++ b/tools/packaging/scripts/lib.sh @@ -19,6 +19,9 @@ short_commit_length=10 hub_bin="hub-bin" +patches_path="" +default_patches_dir="${repo_root_dir}/tools/packaging/kernel/patches" + # Jenkins URL jenkins_url="http://jenkins.katacontainers.io" # Path where cached artifacts are found. @@ -115,7 +118,7 @@ get_config_and_patches() { get_config_version() { 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 cat "${config_version_file}" else diff --git a/tools/packaging/static-build/cache_components.sh b/tools/packaging/static-build/cache_components.sh index fb28dee90a..13fb420f3e 100755 --- a/tools/packaging/static-build/cache_components.sh +++ b/tools/packaging/static-build/cache_components.sh @@ -47,11 +47,9 @@ cache_kernel_artifacts() { create_cache_asset "${kernel_tarball_name}" "${current_kernel_version}" "${current_kernel_image}" 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}" - pushd "${repo_root_dir}/tools/packaging/kata-deploy/local-build/build/" - tar cvfJ "kata-static-cc-sev-kernel-modules.tar.xz" "${module_dir}/kernel/drivers/virt/coco/efi_secret/" - popd - create_cache_asset "kata-static-cc-kernel-modules.tar.xz" "${current_kernel_version}" "${current_kernel_image}" + 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}" + 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/" + create_cache_asset "kata-static-cc-sev-kernel-modules.tar.xz" "${current_kernel_version}" "${current_kernel_image}" fi } @@ -114,6 +112,7 @@ cache_rootfs_artifacts() { root_hash_tdx="${repo_root_dir}/tools/osbuilder/root_hash_tdx.txt" fi if [ "${TEE}" == "sev" ]; then + root_hash_vanilla="" rootfs_tarball_name="kata-static-cc-sev-rootfs-initrd.tar.xz" aa_kbc="online_sev_kbc" image_type="initrd"