mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-25 18:53:44 +00:00
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:
@@ -37,6 +37,7 @@ build_initrd() {
|
||||
info "initrd os: $os_name"
|
||||
info "initrd os version: $os_version"
|
||||
make initrd \
|
||||
VARIANT="${image_initrd_suffix}" \
|
||||
DISTRO="$os_name" \
|
||||
DEBUG="${DEBUG:-}" \
|
||||
OS_VERSION="${os_version}" \
|
||||
@@ -49,7 +50,7 @@ build_initrd() {
|
||||
COCO_GUEST_COMPONENTS_TARBALL="${COCO_GUEST_COMPONENTS_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)
|
||||
artifact_name=${artifact_name/.initrd/"-${nvidia_driver_version}".initrd}
|
||||
fi
|
||||
@@ -66,6 +67,7 @@ build_image() {
|
||||
info "image os: $os_name"
|
||||
info "image os version: $os_version"
|
||||
make image \
|
||||
VARIANT="${image_initrd_suffix}" \
|
||||
DISTRO="${os_name}" \
|
||||
DEBUG="${DEBUG:-}" \
|
||||
USE_DOCKER="1" \
|
||||
@@ -77,9 +79,9 @@ build_image() {
|
||||
COCO_GUEST_COMPONENTS_TARBALL="${COCO_GUEST_COMPONENTS_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)
|
||||
artifact_name=${artifact_name/.img/"-${nvidia_driver_version}".img}
|
||||
artifact_name=${artifact_name/.image/"-${nvidia_driver_version}".image}
|
||||
fi
|
||||
|
||||
mv -f "kata-containers.img" "${install_dir}/${artifact_name}"
|
||||
|
Reference in New Issue
Block a user