diff --git a/tools/packaging/static-build/ovmf/build-ovmf.sh b/tools/packaging/static-build/ovmf/build-ovmf.sh index 988af19d2a..83537686c9 100755 --- a/tools/packaging/static-build/ovmf/build-ovmf.sh +++ b/tools/packaging/static-build/ovmf/build-ovmf.sh @@ -13,6 +13,7 @@ source "${script_dir}/../../scripts/lib.sh" # disabling set -u because scripts attempt to expand undefined variables set +u +ovmf_build="${ovmf_build:-x86_64}" ovmf_repo="${ovmf_repo:-}" ovmf_dir="edk2" ovmf_version="${ovmf_version:-}" @@ -45,6 +46,12 @@ make -C BaseTools/ info "Calling edksetup script" source edksetup.sh +if [ "${ovmf_build}" == "sev" ]; then + info "Creating dummy grub file" + #required for building AmdSev package without grub + touch OvmfPkg/AmdSev/Grub/grub.efi +fi + info "Building ovmf" build -b "${build_target}" -t "${toolchain}" -a "${architecture}" -p "${ovmf_package}" diff --git a/tools/packaging/static-build/ovmf/build.sh b/tools/packaging/static-build/ovmf/build.sh index 2cc3c8f10e..0662d20b82 100755 --- a/tools/packaging/static-build/ovmf/build.sh +++ b/tools/packaging/static-build/ovmf/build.sh @@ -34,6 +34,10 @@ if [ "${ovmf_build}" == "x86_64" ]; then [ -n "$ovmf_version" ] || ovmf_version=$(get_from_kata_deps "externals.ovmf.x86_64.version" "${kata_version}") [ -n "$ovmf_package" ] || ovmf_package=$(get_from_kata_deps "externals.ovmf.x86_64.package" "${kata_version}") [ -n "$package_output_dir" ] || package_output_dir=$(get_from_kata_deps "externals.ovmf.x86_64.package_output_dir" "${kata_version}") +elif [ "${ovmf_build}" == "sev" ]; then + [ -n "$ovmf_version" ] || ovmf_version=$(get_from_kata_deps "externals.ovmf.sev.version" "${kata_version}") + [ -n "$ovmf_package" ] || ovmf_package=$(get_from_kata_deps "externals.ovmf.sev.package" "${kata_version}") + [ -n "$package_output_dir" ] || package_output_dir=$(get_from_kata_deps "externals.ovmf.sev.package_output_dir" "${kata_version}") fi [ -n "$ovmf_version" ] || die "failed to get ovmf version or commit" @@ -45,6 +49,7 @@ sudo docker build -t "${container_image}" "${script_dir}" sudo docker run --rm -i -v "${repo_root_dir}:${repo_root_dir}" \ -w "${PWD}" \ --env DESTDIR="${DESTDIR}" --env PREFIX="${PREFIX}" \ + --env ovmf_build="${ovmf_build}" \ --env ovmf_repo="${ovmf_repo}" \ --env ovmf_version="${ovmf_version}" \ --env ovmf_package="${ovmf_package}" \ diff --git a/versions.yaml b/versions.yaml index 075ce8e89d..06d54788e1 100644 --- a/versions.yaml +++ b/versions.yaml @@ -251,7 +251,12 @@ externals: version: "edk2-stable202202" package: "OvmfPkg/OvmfPkgX64.dsc" package_output_dir: "OvmfX64" - + sev: + description: "AmdSev build needed for SEV measured direct boot." + version: "edk2-stable202202" + package: "OvmfPkg/AmdSev/AmdSevX64.dsc" + package_output_dir: "AmdSev" + virtiofsd: description: "vhost-user virtio-fs device backend written in Rust" url: "https://gitlab.com/virtio-fs/virtiofsd"