2019-06-07 09:20:28 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
set -o xtrace
|
|
|
|
|
2020-07-09 15:14:14 +01:00
|
|
|
check_minio()
|
|
|
|
{
|
2020-08-23 21:32:40 +01:00
|
|
|
MINIO_PATH="${MINIO_HOST}/mesa-lava/$1/${DISTRIBUTION_TAG}/${DEBIAN_ARCH}"
|
2020-07-09 15:14:14 +01:00
|
|
|
if wget -q --method=HEAD "https://${MINIO_PATH}/done"; then
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-04-01 12:07:46 +01:00
|
|
|
# If remote files are up-to-date, skip rebuilding them
|
2020-12-09 19:41:01 +00:00
|
|
|
check_minio "${FDO_UPSTREAM_REPO}"
|
2020-07-09 15:14:14 +01:00
|
|
|
check_minio "${CI_PROJECT_PATH}"
|
2020-04-01 12:07:46 +01:00
|
|
|
|
|
|
|
. .gitlab-ci/container/container_pre_build.sh
|
|
|
|
|
2020-10-29 17:29:28 +00:00
|
|
|
# Install rust, which we'll be using for deqp-runner. It will be cleaned up at the end.
|
2021-01-27 15:38:01 +00:00
|
|
|
. .gitlab-ci/container/build-rust.sh
|
2020-10-29 17:29:28 +00:00
|
|
|
|
2019-12-17 10:50:14 +00:00
|
|
|
if [[ "$DEBIAN_ARCH" = "arm64" ]]; then
|
|
|
|
GCC_ARCH="aarch64-linux-gnu"
|
|
|
|
KERNEL_ARCH="arm64"
|
|
|
|
DEFCONFIG="arch/arm64/configs/defconfig"
|
2021-02-05 00:42:51 +00:00
|
|
|
DEVICE_TREES="arch/arm64/boot/dts/rockchip/rk3399-gru-kevin.dtb"
|
|
|
|
DEVICE_TREES+=" arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dtb"
|
|
|
|
DEVICE_TREES+=" arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dtb"
|
|
|
|
DEVICE_TREES+=" arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dtb"
|
|
|
|
DEVICE_TREES+=" arch/arm64/boot/dts/qcom/apq8016-sbc.dtb"
|
|
|
|
DEVICE_TREES+=" arch/arm64/boot/dts/qcom/apq8096-db820c.dtb"
|
|
|
|
DEVICE_TREES+=" arch/arm64/boot/dts/amlogic/meson-g12b-a311d-khadas-vim3.dtb"
|
2019-12-17 10:50:14 +00:00
|
|
|
KERNEL_IMAGE_NAME="Image"
|
2020-07-03 09:04:20 +01:00
|
|
|
elif [[ "$DEBIAN_ARCH" = "armhf" ]]; then
|
2019-12-17 10:50:14 +00:00
|
|
|
GCC_ARCH="arm-linux-gnueabihf"
|
|
|
|
KERNEL_ARCH="arm"
|
|
|
|
DEFCONFIG="arch/arm/configs/multi_v7_defconfig"
|
|
|
|
DEVICE_TREES="arch/arm/boot/dts/rk3288-veyron-jaq.dtb arch/arm/boot/dts/sun8i-h3-libretech-all-h3-cc.dtb"
|
|
|
|
KERNEL_IMAGE_NAME="zImage"
|
2021-01-27 15:38:01 +00:00
|
|
|
. .gitlab-ci/container/create-cross-file.sh armhf
|
2020-07-03 09:04:20 +01:00
|
|
|
else
|
|
|
|
GCC_ARCH="x86_64-linux-gnu"
|
|
|
|
KERNEL_ARCH="x86_64"
|
|
|
|
DEFCONFIG="arch/x86/configs/x86_64_defconfig"
|
|
|
|
DEVICE_TREES=""
|
|
|
|
KERNEL_IMAGE_NAME="bzImage"
|
2019-12-17 10:50:14 +00:00
|
|
|
fi
|
2019-06-07 09:20:28 +01:00
|
|
|
|
2020-05-13 20:14:39 +01:00
|
|
|
# Determine if we're in a cross build.
|
|
|
|
if [[ -e /cross_file-$DEBIAN_ARCH.txt ]]; then
|
|
|
|
EXTRA_MESON_ARGS="--cross-file /cross_file-$DEBIAN_ARCH.txt"
|
2020-05-14 18:38:12 +01:00
|
|
|
EXTRA_CMAKE_ARGS="-DCMAKE_TOOLCHAIN_FILE=/toolchain-$DEBIAN_ARCH.cmake"
|
2020-05-13 20:14:39 +01:00
|
|
|
|
2020-10-29 17:29:28 +00:00
|
|
|
if [ $DEBIAN_ARCH = arm64 ]; then
|
|
|
|
RUST_TARGET="aarch64-unknown-linux-gnu"
|
|
|
|
elif [ $DEBIAN_ARCH = armhf ]; then
|
|
|
|
RUST_TARGET="armv7-unknown-linux-gnueabihf"
|
|
|
|
fi
|
|
|
|
rustup target add $RUST_TARGET
|
|
|
|
export EXTRA_CARGO_ARGS="--target $RUST_TARGET"
|
|
|
|
|
2020-05-13 20:14:39 +01:00
|
|
|
export ARCH=${KERNEL_ARCH}
|
|
|
|
export CROSS_COMPILE="${GCC_ARCH}-"
|
2019-12-17 10:50:14 +00:00
|
|
|
fi
|
2020-05-13 20:14:39 +01:00
|
|
|
|
2020-04-01 12:07:46 +01:00
|
|
|
apt-get update
|
|
|
|
apt-get install -y automake \
|
|
|
|
bc \
|
|
|
|
cmake \
|
|
|
|
debootstrap \
|
2020-11-11 16:15:25 +00:00
|
|
|
git \
|
2020-04-01 12:07:46 +01:00
|
|
|
libboost-dev \
|
|
|
|
libegl1-mesa-dev \
|
|
|
|
libgbm-dev \
|
|
|
|
libgles2-mesa-dev \
|
|
|
|
libpcre3-dev \
|
|
|
|
libpng-dev \
|
|
|
|
libpython3-dev \
|
|
|
|
libssl-dev \
|
|
|
|
libvulkan-dev \
|
2020-08-27 20:18:17 +01:00
|
|
|
libwaffle-dev \
|
2020-04-01 12:07:46 +01:00
|
|
|
libxcb-keysyms1-dev \
|
2020-08-27 20:18:17 +01:00
|
|
|
libxkbcommon-dev \
|
|
|
|
patch \
|
2020-04-01 12:07:46 +01:00
|
|
|
python3-dev \
|
|
|
|
python3-distutils \
|
2020-08-27 20:18:17 +01:00
|
|
|
python3-mako \
|
|
|
|
python3-numpy \
|
2020-04-01 12:07:46 +01:00
|
|
|
python3-serial \
|
|
|
|
qt5-default \
|
|
|
|
qt5-qmake \
|
2020-11-11 16:15:25 +00:00
|
|
|
qtbase5-dev \
|
|
|
|
wget
|
2020-04-01 12:07:46 +01:00
|
|
|
|
|
|
|
|
|
|
|
if [[ "$DEBIAN_ARCH" = "armhf" ]]; then
|
2020-08-27 20:18:17 +01:00
|
|
|
apt-get install -y libboost-dev:armhf \
|
|
|
|
libegl1-mesa-dev:armhf \
|
2020-11-11 16:15:25 +00:00
|
|
|
libelf-dev:armhf \
|
|
|
|
libgbm-dev:armhf \
|
|
|
|
libgles2-mesa-dev:armhf \
|
|
|
|
libpcre3-dev:armhf \
|
|
|
|
libpng-dev:armhf \
|
|
|
|
libpython3-dev:armhf \
|
|
|
|
libvulkan-dev:armhf \
|
2020-08-27 20:18:17 +01:00
|
|
|
libwaffle-dev:armhf \
|
2020-11-11 16:15:25 +00:00
|
|
|
libxcb-keysyms1-dev:armhf \
|
2020-08-27 20:18:17 +01:00
|
|
|
libxkbcommon-dev:armhf \
|
2020-11-11 16:15:25 +00:00
|
|
|
qtbase5-dev:armhf
|
2020-04-01 12:07:46 +01:00
|
|
|
fi
|
|
|
|
|
2020-10-29 17:29:28 +00:00
|
|
|
|
2020-11-11 19:29:46 +00:00
|
|
|
############### Building
|
|
|
|
STRIP_CMD="${GCC_ARCH}-strip"
|
|
|
|
mkdir -p /lava-files/rootfs-${DEBIAN_ARCH}
|
|
|
|
|
|
|
|
|
|
|
|
############### Build dEQP runner
|
2021-01-27 15:38:01 +00:00
|
|
|
. .gitlab-ci/container/build-deqp-runner.sh
|
2019-12-17 10:50:14 +00:00
|
|
|
mkdir -p /lava-files/rootfs-${DEBIAN_ARCH}/usr/bin
|
|
|
|
mv /usr/local/bin/deqp-runner /lava-files/rootfs-${DEBIAN_ARCH}/usr/bin/.
|
2021-03-06 00:20:48 +00:00
|
|
|
mv /usr/local/bin/piglit-runner /lava-files/rootfs-${DEBIAN_ARCH}/usr/bin/.
|
2019-09-10 16:43:25 +01:00
|
|
|
|
2019-06-07 09:20:28 +01:00
|
|
|
|
2019-12-13 09:20:23 +00:00
|
|
|
############### Build dEQP
|
2021-01-27 15:38:01 +00:00
|
|
|
DEQP_TARGET=surfaceless . .gitlab-ci/container/build-deqp.sh
|
2020-05-28 20:50:51 +01:00
|
|
|
|
2019-12-17 10:50:14 +00:00
|
|
|
mv /deqp /lava-files/rootfs-${DEBIAN_ARCH}/.
|
2019-08-15 09:41:21 +01:00
|
|
|
|
|
|
|
|
2020-08-27 20:18:17 +01:00
|
|
|
############### Build piglit
|
2021-03-31 08:32:20 +01:00
|
|
|
. .gitlab-ci/container/build-piglit.sh
|
|
|
|
mv /piglit /lava-files/rootfs-${DEBIAN_ARCH}/.
|
2020-08-27 20:18:17 +01:00
|
|
|
|
|
|
|
|
2020-01-28 14:19:53 +00:00
|
|
|
############### Build apitrace
|
2021-01-27 15:38:01 +00:00
|
|
|
. .gitlab-ci/container/build-apitrace.sh
|
2020-01-28 14:19:53 +00:00
|
|
|
mkdir -p /lava-files/rootfs-${DEBIAN_ARCH}/apitrace
|
|
|
|
mv /apitrace/build /lava-files/rootfs-${DEBIAN_ARCH}/apitrace
|
|
|
|
rm -rf /apitrace
|
|
|
|
|
|
|
|
mkdir -p /lava-files/rootfs-${DEBIAN_ARCH}/waffle
|
|
|
|
mv /waffle/build /lava-files/rootfs-${DEBIAN_ARCH}/waffle
|
|
|
|
rm -rf /waffle
|
|
|
|
|
|
|
|
|
|
|
|
############### Build renderdoc
|
|
|
|
EXTRA_CMAKE_ARGS+=" -DENABLE_XCB=false"
|
2021-01-27 15:38:01 +00:00
|
|
|
. .gitlab-ci/container/build-renderdoc.sh
|
2020-01-28 14:19:53 +00:00
|
|
|
mkdir -p /lava-files/rootfs-${DEBIAN_ARCH}/renderdoc
|
|
|
|
mv /renderdoc/build /lava-files/rootfs-${DEBIAN_ARCH}/renderdoc
|
|
|
|
rm -rf /renderdoc
|
|
|
|
|
|
|
|
|
2020-07-03 09:04:20 +01:00
|
|
|
############### Build libdrm
|
|
|
|
EXTRA_MESON_ARGS+=" -D prefix=/libdrm"
|
2021-01-27 15:38:01 +00:00
|
|
|
. .gitlab-ci/container/build-libdrm.sh
|
2020-07-03 09:04:20 +01:00
|
|
|
|
|
|
|
|
2019-06-07 09:20:28 +01:00
|
|
|
############### Cross-build kernel
|
2019-12-17 10:50:14 +00:00
|
|
|
mkdir -p kernel
|
|
|
|
wget -qO- ${KERNEL_URL} | tar -xz --strip-components=1 -C kernel
|
|
|
|
pushd kernel
|
2020-08-13 22:21:50 +01:00
|
|
|
|
|
|
|
# The kernel doesn't like the gold linker (or the old lld in our debians).
|
|
|
|
# Sneak in some override symlinks during kernel build until we can update
|
|
|
|
# debian (they'll get blown away by the rm of the kernel dir at the end).
|
|
|
|
mkdir -p ld-links
|
|
|
|
for i in /usr/bin/*-ld /usr/bin/ld; do
|
|
|
|
i=`basename $i`
|
|
|
|
ln -sf /usr/bin/$i.bfd ld-links/$i
|
|
|
|
done
|
|
|
|
export PATH=`pwd`/ld-links:$PATH
|
|
|
|
|
2020-11-09 23:06:38 +00:00
|
|
|
if [ -n "$INSTALL_KERNEL_MODULES" ]; then
|
|
|
|
# Disable all modules in defconfig, so we only build the ones we want
|
|
|
|
sed -i 's/=m/=n/g' ${DEFCONFIG}
|
|
|
|
fi
|
2020-11-04 09:06:20 +00:00
|
|
|
|
2021-01-27 15:38:01 +00:00
|
|
|
./scripts/kconfig/merge_config.sh ${DEFCONFIG} ../.gitlab-ci/container/${KERNEL_ARCH}.config
|
2020-08-04 10:00:54 +01:00
|
|
|
make ${KERNEL_IMAGE_NAME}
|
2020-04-06 23:55:30 +01:00
|
|
|
for image in ${KERNEL_IMAGE_NAME}; do
|
|
|
|
cp arch/${KERNEL_ARCH}/boot/${image} /lava-files/.
|
|
|
|
done
|
2020-11-04 09:06:20 +00:00
|
|
|
|
2020-07-03 09:04:20 +01:00
|
|
|
if [[ -n ${DEVICE_TREES} ]]; then
|
|
|
|
make dtbs
|
|
|
|
cp ${DEVICE_TREES} /lava-files/.
|
|
|
|
fi
|
2020-04-06 23:55:30 +01:00
|
|
|
|
2020-11-09 23:06:38 +00:00
|
|
|
if [ -n "$INSTALL_KERNEL_MODULES" ]; then
|
|
|
|
make modules
|
|
|
|
INSTALL_MOD_PATH=/lava-files/rootfs-${DEBIAN_ARCH}/ make modules_install
|
|
|
|
fi
|
2020-11-04 09:06:20 +00:00
|
|
|
|
2020-07-09 21:38:51 +01:00
|
|
|
if [[ ${DEBIAN_ARCH} = "arm64" ]] && which mkimage > /dev/null; then
|
|
|
|
make Image.lzma
|
|
|
|
mkimage \
|
|
|
|
-f auto \
|
|
|
|
-A arm \
|
|
|
|
-O linux \
|
|
|
|
-d arch/arm64/boot/Image.lzma \
|
|
|
|
-C lzma\
|
|
|
|
-b arch/arm64/boot/dts/qcom/sdm845-cheza-r3.dtb \
|
|
|
|
/lava-files/cheza-kernel
|
|
|
|
fi
|
|
|
|
|
2019-12-17 10:50:14 +00:00
|
|
|
popd
|
|
|
|
rm -rf kernel
|
2019-06-07 09:20:28 +01:00
|
|
|
|
2020-11-07 17:25:37 +00:00
|
|
|
############### Delete rust, since the tests won't be compiling anything.
|
|
|
|
rm -rf /root/.rustup /root/.cargo
|
|
|
|
|
2019-06-07 09:20:28 +01:00
|
|
|
############### Create rootfs
|
2019-08-19 15:40:53 +01:00
|
|
|
set +e
|
ci: Include db410c support in the ARM container.
I'm working on moving the db410c CI from docker to LAVA, which means we
get to boot a custom kernel. To do that, we need to enable ARCH_QCOM in
the kernel, save the dtb around, and include abootimg in our container so
that we can generate combined kernel/dtb/ramdisk images for fastboot.
LAVA's fastboot support is unable to pack the overlay into an abootimg
image, just a cpio rootfs. We could flash the cpio rootfs after overlay
addition, but that takes 2 minutes to do, and causes wear on the devices.
Instead, we'll bring up the network at boot and use wget to fetch the
overlay. We'll want network support anyway, so that we can transfer the
failure xmls back to the gitlab job's artifacts at some point.
Since the msm GPU and realtek network firmware increase our payload by
3MB, add in firmware compression so that it doesn't waste as much RAM on
devices not using it.
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3928>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3928>
2020-01-28 20:02:39 +00:00
|
|
|
debootstrap \
|
|
|
|
--variant=minbase \
|
|
|
|
--arch=${DEBIAN_ARCH} \
|
|
|
|
--components main,contrib,non-free \
|
2020-06-15 12:29:22 +01:00
|
|
|
buster \
|
ci: Include db410c support in the ARM container.
I'm working on moving the db410c CI from docker to LAVA, which means we
get to boot a custom kernel. To do that, we need to enable ARCH_QCOM in
the kernel, save the dtb around, and include abootimg in our container so
that we can generate combined kernel/dtb/ramdisk images for fastboot.
LAVA's fastboot support is unable to pack the overlay into an abootimg
image, just a cpio rootfs. We could flash the cpio rootfs after overlay
addition, but that takes 2 minutes to do, and causes wear on the devices.
Instead, we'll bring up the network at boot and use wget to fetch the
overlay. We'll want network support anyway, so that we can transfer the
failure xmls back to the gitlab job's artifacts at some point.
Since the msm GPU and realtek network firmware increase our payload by
3MB, add in firmware compression so that it doesn't waste as much RAM on
devices not using it.
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3928>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3928>
2020-01-28 20:02:39 +00:00
|
|
|
/lava-files/rootfs-${DEBIAN_ARCH}/ \
|
|
|
|
http://deb.debian.org/debian
|
|
|
|
|
2019-12-17 10:50:14 +00:00
|
|
|
cat /lava-files/rootfs-${DEBIAN_ARCH}/debootstrap/debootstrap.log
|
2019-08-19 15:40:53 +01:00
|
|
|
set -e
|
2019-08-19 16:30:10 +01:00
|
|
|
|
2021-01-27 15:38:01 +00:00
|
|
|
cp .gitlab-ci/container/create-rootfs.sh /lava-files/rootfs-${DEBIAN_ARCH}/.
|
2020-07-03 09:04:20 +01:00
|
|
|
cp .gitlab-ci/container/llvm-snapshot.gpg.key /lava-files/rootfs-${DEBIAN_ARCH}/.
|
2021-03-31 08:32:20 +01:00
|
|
|
chroot /lava-files/rootfs-${DEBIAN_ARCH} sh /create-rootfs.sh
|
2019-12-17 10:50:14 +00:00
|
|
|
rm /lava-files/rootfs-${DEBIAN_ARCH}/create-rootfs.sh
|
2020-07-03 09:04:20 +01:00
|
|
|
rm /lava-files/rootfs-${DEBIAN_ARCH}/llvm-snapshot.gpg.key
|
2020-08-27 20:18:17 +01:00
|
|
|
|
|
|
|
|
|
|
|
############### Install the built libdrm
|
|
|
|
# Dependencies pulled during the creation of the rootfs may overwrite
|
|
|
|
# the built libdrm. Hence, we add it after the rootfs has been already
|
|
|
|
# created.
|
|
|
|
mkdir -p /lava-files/rootfs-${DEBIAN_ARCH}/usr/lib/$GCC_ARCH
|
|
|
|
find /libdrm/ -name lib\*\.so\* | xargs cp -t /lava-files/rootfs-${DEBIAN_ARCH}/usr/lib/$GCC_ARCH/.
|
|
|
|
rm -rf /libdrm
|
|
|
|
|
|
|
|
|
2020-07-03 09:04:20 +01:00
|
|
|
du -ah /lava-files/rootfs-${DEBIAN_ARCH} | sort -h | tail -100
|
2020-04-01 12:07:46 +01:00
|
|
|
pushd /lava-files/rootfs-${DEBIAN_ARCH}
|
2020-10-17 20:34:42 +01:00
|
|
|
tar czf /lava-files/lava-rootfs.tgz .
|
2020-04-01 12:07:46 +01:00
|
|
|
popd
|
|
|
|
|
2020-07-09 21:38:51 +01:00
|
|
|
if [ ${DEBIAN_ARCH} = arm64 ]; then
|
|
|
|
# Make a gzipped copy of the Image for db410c.
|
|
|
|
gzip -k /lava-files/Image
|
|
|
|
|
|
|
|
# Add missing a630 firmware, added to debian packge in apr 2020
|
|
|
|
wget https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/qcom/a630_gmu.bin \
|
|
|
|
-O /lava-files/rootfs-arm64/lib/firmware/qcom/a630_gmu.bin
|
|
|
|
wget https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/qcom/a630_sqe.fw \
|
|
|
|
-O /lava-files/rootfs-arm64/lib/firmware/qcom/a630_sqe.fw
|
|
|
|
fi
|
2020-04-01 12:07:46 +01:00
|
|
|
|
|
|
|
. .gitlab-ci/container/container_post_build.sh
|
|
|
|
|
|
|
|
############### Upload the files!
|
2020-07-09 21:38:51 +01:00
|
|
|
if [ -n "$UPLOAD_FOR_LAVA" ]; then
|
|
|
|
ci-fairy minio login $CI_JOB_JWT
|
2020-07-28 10:42:42 +01:00
|
|
|
FILES_TO_UPLOAD="lava-rootfs.tgz \
|
2020-07-03 09:04:20 +01:00
|
|
|
$KERNEL_IMAGE_NAME"
|
|
|
|
|
|
|
|
if [[ -n $DEVICE_TREES ]]; then
|
|
|
|
FILES_TO_UPLOAD="$FILES_TO_UPLOAD $(basename -a $DEVICE_TREES)"
|
|
|
|
fi
|
2020-07-09 21:38:51 +01:00
|
|
|
|
|
|
|
for f in $FILES_TO_UPLOAD; do
|
|
|
|
ci-fairy minio cp /lava-files/$f \
|
|
|
|
minio://${MINIO_PATH}/$f
|
|
|
|
done
|
|
|
|
|
|
|
|
touch /lava-files/done
|
|
|
|
ci-fairy minio cp /lava-files/done minio://${MINIO_PATH}/done
|
|
|
|
fi
|
2020-03-03 22:38:09 +00:00
|
|
|
|