ci: Enable pre-merge fractional vulkan CTS runs on the turnip driver.
[mesa.git] / .gitlab-ci / container / lava_arm.sh
1 #!/bin/bash
2
3 set -e
4 set -o xtrace
5
6 if [[ "$DEBIAN_ARCH" = "arm64" ]]; then
7 GCC_ARCH="aarch64-linux-gnu"
8 KERNEL_ARCH="arm64"
9 DEFCONFIG="arch/arm64/configs/defconfig"
10 DEVICE_TREES="arch/arm64/boot/dts/rockchip/rk3399-gru-kevin.dtb arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dtb arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dtb arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dtb arch/arm64/boot/dts/qcom/apq8016-sbc.dtb"
11 KERNEL_IMAGE_NAME="Image"
12 else
13 GCC_ARCH="arm-linux-gnueabihf"
14 KERNEL_ARCH="arm"
15 DEFCONFIG="arch/arm/configs/multi_v7_defconfig"
16 DEVICE_TREES="arch/arm/boot/dts/rk3288-veyron-jaq.dtb arch/arm/boot/dts/sun8i-h3-libretech-all-h3-cc.dtb"
17 KERNEL_IMAGE_NAME="zImage"
18 fi
19
20 # Determine if we're in a cross build.
21 if [[ -e /cross_file-$DEBIAN_ARCH.txt ]]; then
22 EXTRA_MESON_ARGS="--cross-file /cross_file-$DEBIAN_ARCH.txt"
23 EXTRA_CMAKE_ARGS="-DCMAKE_TOOLCHAIN_FILE=/toolchain-$DEBIAN_ARCH.cmake"
24
25 export ARCH=${KERNEL_ARCH}
26 export CROSS_COMPILE="${GCC_ARCH}-"
27 fi
28
29 ############### Build dEQP runner
30 . .gitlab-ci/build-cts-runner.sh
31 mkdir -p /lava-files/rootfs-${DEBIAN_ARCH}/usr/bin
32 mv /usr/local/bin/deqp-runner /lava-files/rootfs-${DEBIAN_ARCH}/usr/bin/.
33
34
35 ############### Build dEQP
36 STRIP_CMD="${GCC_ARCH}-strip"
37 if [ -n "$INCLUDE_VK_CTS" ]; then
38 DEQP_TARGET=surfaceless . .gitlab-ci/build-deqp-vk.sh
39 else
40 . .gitlab-ci/build-deqp-gl.sh
41 fi
42
43 mv /deqp /lava-files/rootfs-${DEBIAN_ARCH}/.
44
45
46 ############### Cross-build kernel
47 KERNEL_URL="https://gitlab.freedesktop.org/tomeu/linux/-/archive/v5.5-panfrost-fixes/linux-v5.5-panfrost-fixes.tar.gz"
48
49 mkdir -p kernel
50 wget -qO- ${KERNEL_URL} | tar -xz --strip-components=1 -C kernel
51 pushd kernel
52 ./scripts/kconfig/merge_config.sh ${DEFCONFIG} ../.gitlab-ci/${KERNEL_ARCH}.config
53 make ${KERNEL_IMAGE_NAME} dtbs
54 for image in ${KERNEL_IMAGE_NAME}; do
55 cp arch/${KERNEL_ARCH}/boot/${image} /lava-files/.
56 done
57 cp ${DEVICE_TREES} /lava-files/.
58
59
60 if [[ ${DEBIAN_ARCH} = "arm64" ]] && which mkimage > /dev/null; then
61 make Image.lzma
62 mkimage \
63 -f auto \
64 -A arm \
65 -O linux \
66 -d arch/arm64/boot/Image.lzma \
67 -C lzma\
68 -b arch/arm64/boot/dts/qcom/sdm845-cheza-r3.dtb \
69 /lava-files/cheza-kernel
70 fi
71
72 popd
73 rm -rf kernel
74
75 ############### Create rootfs
76 set +e
77 debootstrap \
78 --variant=minbase \
79 --arch=${DEBIAN_ARCH} \
80 --components main,contrib,non-free \
81 testing \
82 /lava-files/rootfs-${DEBIAN_ARCH}/ \
83 http://deb.debian.org/debian
84
85 cat /lava-files/rootfs-${DEBIAN_ARCH}/debootstrap/debootstrap.log
86 set -e
87
88 cp .gitlab-ci/create-rootfs.sh /lava-files/rootfs-${DEBIAN_ARCH}/.
89 chroot /lava-files/rootfs-${DEBIAN_ARCH} sh /create-rootfs.sh
90 rm /lava-files/rootfs-${DEBIAN_ARCH}/create-rootfs.sh
91
92 if [ ${DEBIAN_ARCH} = arm64 ]; then
93 # Pull down a specific build of qcomlt/release/qcomlt-5.4 8c79b3d12355
94 # ("Merge tag 'v5.4.23' into release/qcomlt-5.4"), where I used the
95 # .config from
96 # http://snapshots.linaro.org/96boards/dragonboard820c/linaro/debian/457/config-5.4.0-qcomlt-arm64
97 # with the following merged in:
98 #
99 # CONFIG_DRM=y
100 # CONFIG_DRM_MSM=y
101 # CONFIG_ATL1C=y
102 #
103 # Reason: 5.5 has a big stack of oopses and warns on db820c. 4.14-5.4
104 # linaro kernel binaries (see above .config link) have these as modules
105 # and distributed the modules only in the debian system, not the initrd,
106 # so they're very hard to extract (involving simg2img and loopback
107 # mounting). 4.11 is missing d72fea538fe6 ("drm/msm: Fix the check for
108 # the command size") so it can't actually run fredreno. qcomlt-4.14 is
109 # unstable at boot (~10% instaboot rate). The 5.4 qcomlt kernel with msm
110 # built in seems like the easiest way to go.
111 wget https://people.freedesktop.org/~anholt/qcomlt-5.4-msm-build/Image.gz -O Image.gz \
112 -O /lava-files/db820c-kernel
113 wget https://people.freedesktop.org/~anholt/qcomlt-5.4-msm-build/apq8096-db820c.dtb \
114 -O /lava-files/db820c.dtb
115
116 # Make a gzipped copy of the Image for db410c.
117 gzip -k /lava-files/Image
118
119 # Add missing a630 firmware, added to debian packge in apr 2020
120 wget https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/qcom/a630_gmu.bin \
121 -O /lava-files/rootfs-arm64/lib/firmware/qcom/a630_gmu.bin
122 wget https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/qcom/a630_sqe.fw \
123 -O /lava-files/rootfs-arm64/lib/firmware/qcom/a630_sqe.fw
124 fi