ci/baremetal: Use find_s3_project_artifact on baremetal_build.sh

So we can reuse artifact finding functionality and also can make the
`gallo/mesa` workaround to work.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36946>
This commit is contained in:
Guilherme Gallo 2025-08-22 17:57:02 -03:00 committed by Marge Bot
parent 50f5ade796
commit de5f96b4de

View file

@ -7,16 +7,13 @@ set -o xtrace
# Fetch the arm-built rootfs image and unpack it in our x86_64 container (saves
# network transfer, disk usage, and runtime on test jobs)
S3_PATH="https://${S3_HOST}/${S3_KERNEL_BUCKET}"
if curl -L --retry 3 -f --retry-delay 10 -s --head "${S3_PATH}/${FDO_UPSTREAM_REPO}/${LAVA_DISTRIBUTION_TAG}/lava-rootfs.tar.zst"; then
ARTIFACTS_URL="${S3_PATH}/${FDO_UPSTREAM_REPO}/${LAVA_DISTRIBUTION_TAG}"
else
ARTIFACTS_URL="${S3_PATH}/${S3_PROJECT_PATH}/${LAVA_DISTRIBUTION_TAG}"
fi
# shellcheck disable=SC2034 # S3_BASE_PATH is used in find_s3_project_artifact
S3_BASE_PATH="${S3_HOST}/${S3_KERNEL_BUCKET}"
ARTIFACTS_PATH="${LAVA_DISTRIBUTION_TAG}/lava-rootfs.tar.zst"
ARTIFACTS_URL="$(find_s3_project_artifact "${ARTIFACTS_PATH}")"
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
"${ARTIFACTS_URL}"/lava-rootfs.tar.zst -o rootfs.tar.zst
"${ARTIFACTS_URL}" -o rootfs.tar.zst
mkdir -p /rootfs-"$arch"
tar -C /rootfs-"$arch" '--exclude=./dev/*' --zstd -xf rootfs.tar.zst
rm rootfs.tar.zst