2020-06-08 05:19:50 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
set -o xtrace
|
|
|
|
|
2021-03-29 21:09:06 +08:00
|
|
|
# Fetch the arm-built rootfs image and unpack it in our x86 container (saves
|
|
|
|
# network transfer, disk usage, and runtime on test jobs)
|
|
|
|
|
2022-07-16 22:40:04 +08:00
|
|
|
# shellcheck disable=SC2154 # arch is assigned in previous scripts
|
2021-03-30 18:54:15 +08:00
|
|
|
if wget -q --method=HEAD "${ARTIFACTS_PREFIX}/${FDO_UPSTREAM_REPO}/${ARTIFACTS_SUFFIX}/${arch}/done"; then
|
|
|
|
ARTIFACTS_URL="${ARTIFACTS_PREFIX}/${FDO_UPSTREAM_REPO}/${ARTIFACTS_SUFFIX}/${arch}"
|
2021-03-29 21:09:06 +08:00
|
|
|
else
|
2021-03-30 18:54:15 +08:00
|
|
|
ARTIFACTS_URL="${ARTIFACTS_PREFIX}/${CI_PROJECT_PATH}/${ARTIFACTS_SUFFIX}/${arch}"
|
2021-03-29 21:09:06 +08:00
|
|
|
fi
|
|
|
|
|
2022-07-16 22:40:04 +08:00
|
|
|
wget "${ARTIFACTS_URL}"/lava-rootfs.tar.zst -O rootfs.tar.zst
|
|
|
|
mkdir -p /rootfs-"$arch"
|
|
|
|
tar -C /rootfs-"$arch" '--exclude=./dev/*' --zstd -xf rootfs.tar.zst
|
2022-07-27 19:57:42 +08:00
|
|
|
rm rootfs.tar.zst
|
2021-03-29 21:09:06 +08:00
|
|
|
|
|
|
|
if [[ $arch == "arm64" ]]; then
|
|
|
|
mkdir -p /baremetal-files
|
|
|
|
pushd /baremetal-files
|
|
|
|
|
2022-07-16 22:40:04 +08:00
|
|
|
wget "${ARTIFACTS_URL}"/Image
|
|
|
|
wget "${ARTIFACTS_URL}"/Image.gz
|
|
|
|
wget "${ARTIFACTS_URL}"/cheza-kernel
|
2021-03-29 21:09:06 +08:00
|
|
|
|
2021-12-03 08:14:30 +08:00
|
|
|
DEVICE_TREES=""
|
|
|
|
DEVICE_TREES="$DEVICE_TREES apq8016-sbc.dtb"
|
|
|
|
DEVICE_TREES="$DEVICE_TREES apq8096-db820c.dtb"
|
|
|
|
DEVICE_TREES="$DEVICE_TREES tegra210-p3450-0000.dtb"
|
2021-10-30 18:21:10 +08:00
|
|
|
DEVICE_TREES="$DEVICE_TREES imx8mq-nitrogen.dtb"
|
2021-03-29 21:09:06 +08:00
|
|
|
|
|
|
|
for DTB in $DEVICE_TREES; do
|
2022-07-16 22:40:04 +08:00
|
|
|
wget "${ARTIFACTS_URL}/$DTB"
|
2021-03-29 21:09:06 +08:00
|
|
|
done
|
|
|
|
|
2020-12-21 20:37:38 +08:00
|
|
|
popd
|
|
|
|
elif [[ $arch == "armhf" ]]; then
|
|
|
|
mkdir -p /baremetal-files
|
|
|
|
pushd /baremetal-files
|
|
|
|
|
2022-07-16 22:40:04 +08:00
|
|
|
wget "${ARTIFACTS_URL}"/zImage
|
2020-12-21 20:37:38 +08:00
|
|
|
|
2022-05-17 22:05:36 +08:00
|
|
|
DEVICE_TREES=""
|
|
|
|
DEVICE_TREES="$DEVICE_TREES imx6q-cubox-i.dtb"
|
|
|
|
DEVICE_TREES="$DEVICE_TREES tegra124-jetson-tk1.dtb"
|
2020-12-21 20:37:38 +08:00
|
|
|
|
|
|
|
for DTB in $DEVICE_TREES; do
|
2022-07-16 22:40:04 +08:00
|
|
|
wget "${ARTIFACTS_URL}/$DTB"
|
2020-12-21 20:37:38 +08:00
|
|
|
done
|
|
|
|
|
2021-03-29 21:09:06 +08:00
|
|
|
popd
|
|
|
|
fi
|