summaryrefslogtreecommitdiff
path: root/lib/mesa/.gitlab-ci/container/baremetal_build.sh
blob: 5752287a8f529d4978a15f777a59d6f72a8fbb33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash

set -e
set -o xtrace

# Fetch the arm-built rootfs image and unpack it in our x86 container (saves
# network transfer, disk usage, and runtime on test jobs)

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}"
else
  ARTIFACTS_URL="${ARTIFACTS_PREFIX}/${CI_PROJECT_PATH}/${ARTIFACTS_SUFFIX}/${arch}"
fi

wget ${ARTIFACTS_URL}/lava-rootfs.tgz -O rootfs.tgz
mkdir -p /rootfs-$arch
tar -C /rootfs-$arch '--exclude=./dev/*' -zxf rootfs.tgz
rm rootfs.tgz

if [[ $arch == "arm64" ]]; then
    mkdir -p /baremetal-files
    pushd /baremetal-files

    wget ${ARTIFACTS_URL}/Image
    wget ${ARTIFACTS_URL}/Image.gz
    wget ${ARTIFACTS_URL}/cheza-kernel

    DEVICE_TREES="apq8016-sbc.dtb apq8096-db820c.dtb"

    for DTB in $DEVICE_TREES; do
        wget ${ARTIFACTS_URL}/$DTB
    done

    popd
elif [[ $arch == "armhf" ]]; then
    mkdir -p /baremetal-files
    pushd /baremetal-files

    wget ${ARTIFACTS_URL}/zImage

    DEVICE_TREES="imx6q-cubox-i.dtb"

    for DTB in $DEVICE_TREES; do
        wget ${ARTIFACTS_URL}/$DTB
    done

    popd
fi