1#!/bin/bash 2 3set -e 4set -o xtrace 5 6# Fetch the arm-built rootfs image and unpack it in our x86 container (saves 7# network transfer, disk usage, and runtime on test jobs) 8 9if wget -q --method=HEAD "${ARTIFACTS_PREFIX}/${FDO_UPSTREAM_REPO}/${ARTIFACTS_SUFFIX}/${arch}/done"; then 10 ARTIFACTS_URL="${ARTIFACTS_PREFIX}/${FDO_UPSTREAM_REPO}/${ARTIFACTS_SUFFIX}/${arch}" 11else 12 ARTIFACTS_URL="${ARTIFACTS_PREFIX}/${CI_PROJECT_PATH}/${ARTIFACTS_SUFFIX}/${arch}" 13fi 14 15wget ${ARTIFACTS_URL}/lava-rootfs.tgz -O rootfs.tgz 16mkdir -p /rootfs-$arch 17tar -C /rootfs-$arch '--exclude=./dev/*' -zxf rootfs.tgz 18rm rootfs.tgz 19 20if [[ $arch == "arm64" ]]; then 21 mkdir -p /baremetal-files 22 pushd /baremetal-files 23 24 wget ${ARTIFACTS_URL}/Image 25 wget ${ARTIFACTS_URL}/Image.gz 26 wget ${ARTIFACTS_URL}/cheza-kernel 27 28 DEVICE_TREES="" 29 DEVICE_TREES="$DEVICE_TREES apq8016-sbc.dtb" 30 DEVICE_TREES="$DEVICE_TREES apq8096-db820c.dtb" 31 DEVICE_TREES="$DEVICE_TREES tegra210-p3450-0000.dtb" 32 33 for DTB in $DEVICE_TREES; do 34 wget ${ARTIFACTS_URL}/$DTB 35 done 36 37 popd 38elif [[ $arch == "armhf" ]]; then 39 mkdir -p /baremetal-files 40 pushd /baremetal-files 41 42 wget ${ARTIFACTS_URL}/zImage 43 44 DEVICE_TREES="imx6q-cubox-i.dtb" 45 46 for DTB in $DEVICE_TREES; do 47 wget ${ARTIFACTS_URL}/$DTB 48 done 49 50 popd 51fi 52