mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-10 05:08:54 +00:00
image: Add suffix to image or initrd depending on the NVIDIA driver version
Fixes: #9478 We want to keep track of the driver versions build during initrd/image build so update the artifact_name after the fact. Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
This commit is contained in:
@@ -48,6 +48,12 @@ build_initrd() {
|
|||||||
PULL_TYPE="${PULL_TYPE:-default}" \
|
PULL_TYPE="${PULL_TYPE:-default}" \
|
||||||
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
|
||||||
|
nvidia_driver_version=$(cat "${builddir}"/initrd-image/*/nvidia_driver_version)
|
||||||
|
artifact_name=${artifact_name/.initrd/"-${nvidia_driver_version}".initrd}
|
||||||
|
fi
|
||||||
|
|
||||||
mv "kata-containers-initrd.img" "${install_dir}/${artifact_name}"
|
mv "kata-containers-initrd.img" "${install_dir}/${artifact_name}"
|
||||||
(
|
(
|
||||||
cd "${install_dir}"
|
cd "${install_dir}"
|
||||||
@@ -70,6 +76,12 @@ build_image() {
|
|||||||
PULL_TYPE="${PULL_TYPE:-default}" \
|
PULL_TYPE="${PULL_TYPE:-default}" \
|
||||||
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
|
||||||
|
nvidia_driver_version=$(cat "${builddir}"/rootfs-image/*/nvidia_driver_version)
|
||||||
|
artifact_name=${artifact_name/.img/"-${nvidia_driver_version}".img}
|
||||||
|
fi
|
||||||
|
|
||||||
mv -f "kata-containers.img" "${install_dir}/${artifact_name}"
|
mv -f "kata-containers.img" "${install_dir}/${artifact_name}"
|
||||||
if [ -e "root_hash.txt" ]; then
|
if [ -e "root_hash.txt" ]; then
|
||||||
cp root_hash.txt "${install_dir}/"
|
cp root_hash.txt "${install_dir}/"
|
||||||
|
Reference in New Issue
Block a user