gpu: Add VARIANT to the initrd and image build

We need to know if we're building a nvidia initrd or image
Additionally if we build a regular or confidential VARIANT

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
This commit is contained in:
Zvonko Kaiser
2024-05-10 09:52:46 +00:00
parent 95b69c5732
commit 3781526c94

View File

@@ -37,6 +37,7 @@ build_initrd() {
info "initrd os: $os_name" info "initrd os: $os_name"
info "initrd os version: $os_version" info "initrd os version: $os_version"
make initrd \ make initrd \
VARIANT="${image_initrd_suffix}" \
DISTRO="$os_name" \ DISTRO="$os_name" \
DEBUG="${DEBUG:-}" \ DEBUG="${DEBUG:-}" \
OS_VERSION="${os_version}" \ OS_VERSION="${os_version}" \
@@ -49,7 +50,7 @@ build_initrd() {
COCO_GUEST_COMPONENTS_TARBALL="${COCO_GUEST_COMPONENTS_TARBALL:-}" \ COCO_GUEST_COMPONENTS_TARBALL="${COCO_GUEST_COMPONENTS_TARBALL:-}" \
PAUSE_IMAGE_TARBALL="${PAUSE_IMAGE_TARBALL:-}" PAUSE_IMAGE_TARBALL="${PAUSE_IMAGE_TARBALL:-}"
if [[ "$artifact_name" == *"nvidia-gpu"* ]]; then if [[ "${image_initrd_suffix}" == "nvidia-gpu"* ]]; then
nvidia_driver_version=$(cat "${builddir}"/initrd-image/*/nvidia_driver_version) nvidia_driver_version=$(cat "${builddir}"/initrd-image/*/nvidia_driver_version)
artifact_name=${artifact_name/.initrd/"-${nvidia_driver_version}".initrd} artifact_name=${artifact_name/.initrd/"-${nvidia_driver_version}".initrd}
fi fi
@@ -66,6 +67,7 @@ build_image() {
info "image os: $os_name" info "image os: $os_name"
info "image os version: $os_version" info "image os version: $os_version"
make image \ make image \
VARIANT="${image_initrd_suffix}" \
DISTRO="${os_name}" \ DISTRO="${os_name}" \
DEBUG="${DEBUG:-}" \ DEBUG="${DEBUG:-}" \
USE_DOCKER="1" \ USE_DOCKER="1" \
@@ -77,9 +79,9 @@ build_image() {
COCO_GUEST_COMPONENTS_TARBALL="${COCO_GUEST_COMPONENTS_TARBALL:-}" \ COCO_GUEST_COMPONENTS_TARBALL="${COCO_GUEST_COMPONENTS_TARBALL:-}" \
PAUSE_IMAGE_TARBALL="${PAUSE_IMAGE_TARBALL:-}" PAUSE_IMAGE_TARBALL="${PAUSE_IMAGE_TARBALL:-}"
if [[ "$artifact_name" == *"nvidia-gpu"* ]]; then if [[ "${image_initrd_suffix}" == "nvidia-gpu"* ]]; then
nvidia_driver_version=$(cat "${builddir}"/rootfs-image/*/nvidia_driver_version) nvidia_driver_version=$(cat "${builddir}"/rootfs-image/*/nvidia_driver_version)
artifact_name=${artifact_name/.img/"-${nvidia_driver_version}".img} artifact_name=${artifact_name/.image/"-${nvidia_driver_version}".image}
fi fi
mv -f "kata-containers.img" "${install_dir}/${artifact_name}" mv -f "kata-containers.img" "${install_dir}/${artifact_name}"