From ef355361391b660eafd6ab6bd0d3ac6975c76e3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Sat, 25 Jul 2026 22:37:00 +0200 Subject: [PATCH] fixup! build: consume guest-components CoCo artefacts instead of building locally --- .../rootfs-builder/nvidia/nvidia_rootfs.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tools/osbuilder/rootfs-builder/nvidia/nvidia_rootfs.sh b/tools/osbuilder/rootfs-builder/nvidia/nvidia_rootfs.sh index c98111acb5..e82080f172 100644 --- a/tools/osbuilder/rootfs-builder/nvidia/nvidia_rootfs.sh +++ b/tools/osbuilder/rootfs-builder/nvidia/nvidia_rootfs.sh @@ -161,6 +161,16 @@ setup_nvidia_gpu_rootfs_stage_one() { mount --make-rslave ./dev mount -t proc /proc ./proc + # setup_rootfs() leaves an empty /etc/resolv.conf so the agent can bind-mount + # container DNS into the guest. That breaks name resolution inside this chroot + # when fetching NVIDIA packages, so temporarily copy the host DNS config into + # the rootfs only. Never touch the host /etc/resolv.conf. + local rootfs_resolv="${ROOTFS_DIR}/etc/resolv.conf" + [[ -n "${ROOTFS_DIR}" && "${ROOTFS_DIR}" != "/" && -d "${ROOTFS_DIR}/etc" ]] \ + || die "nvidia: refusing to modify resolv.conf: invalid ROOTFS_DIR='${ROOTFS_DIR:-}'" + rm -f "${rootfs_resolv}" + cp --remove-destination /etc/resolv.conf "${rootfs_resolv}" + local cuda_repo_url cuda_repo_pkg gpu_base_os_version ctk_version cuda_repo_url=$(get_package_version_from_kata_yaml "externals.nvidia.cuda.repo.${machine_arch}.url") cuda_repo_pkg=$(get_package_version_from_kata_yaml "externals.nvidia.cuda.repo.${machine_arch}.pkg") @@ -177,6 +187,10 @@ setup_nvidia_gpu_rootfs_stage_one() { umount -R ./dev umount ./proc + # Restore the empty resolv.conf for the stage-one tarball / final guest image. + rm -f "${rootfs_resolv}" + touch "${rootfs_resolv}" + rm ./nvidia_chroot.sh tar cfa "${stage_one}.tar.zst" --remove-files -- *