pan/bi: Add IR iteration macros
[mesa.git] / .gitlab-ci / prepare-artifacts.sh
1 #!/bin/bash
2
3 set -e
4 set -o xtrace
5
6 CROSS_FILE=/cross_file-"$CROSS".txt
7
8 # Delete unused bin and includes from artifacts to save space.
9 rm -rf install/bin install/include
10
11 # Strip the drivers in the artifacts to cut 80% of the artifacts size.
12 if [ -n "$CROSS" ]; then
13 STRIP=`sed -n -E "s/strip\s*=\s*'(.*)'/\1/p" "$CROSS_FILE"`
14 if [ -z "$STRIP" ]; then
15 echo "Failed to find strip command in cross file"
16 exit 1
17 fi
18 else
19 STRIP="strip"
20 fi
21 find install -name \*.so -exec $STRIP {} \;
22
23 # Test runs don't pull down the git tree, so put the dEQP helper
24 # script and associated bits there.
25 mkdir -p artifacts/
26 cp VERSION artifacts/
27 cp -Rp .gitlab-ci/deqp* artifacts/
28 cp -Rp .gitlab-ci/piglit artifacts/
29 cp -Rp .gitlab-ci/traces.yml artifacts/
30 cp -Rp .gitlab-ci/tracie artifacts/
31 cp -Rp .gitlab-ci/tracie-runner-gl.sh artifacts/
32 cp -Rp .gitlab-ci/tracie-runner-vk.sh artifacts/
33
34 # Tar up the install dir so that symlinks and hardlinks aren't each
35 # packed separately in the zip file.
36 tar -cf artifacts/install.tar install
37
38 # If the container has LAVA stuff, prepare the artifacts for LAVA jobs
39 if [ -d /lava-files ]; then
40 # Copy kernel and device trees for LAVA
41 cp /lava-files/*Image artifacts/.
42 cp /lava-files/*.dtb artifacts/.
43
44 # Pack ramdisk for LAVA
45 mkdir -p /lava-files/rootfs-${CROSS:-arm64}/mesa
46 cp -a install/* /lava-files/rootfs-${CROSS:-arm64}/mesa/.
47
48 cp .gitlab-ci/deqp-runner.sh /lava-files/rootfs-${CROSS:-arm64}/deqp/.
49 cp .gitlab-ci/deqp-*-fails.txt /lava-files/rootfs-${CROSS:-arm64}/deqp/.
50 cp .gitlab-ci/deqp-*-skips.txt /lava-files/rootfs-${CROSS:-arm64}/deqp/.
51 find /lava-files/rootfs-${CROSS:-arm64}/ -type f -printf "%s\t%i\t%p\n" | sort -n | tail -100
52
53 pushd /lava-files/rootfs-${CROSS:-arm64}/
54 find -H | cpio -H newc -o | gzip -c - > $CI_PROJECT_DIR/artifacts/lava-rootfs-${CROSS:-arm64}.cpio.gz
55 popd
56
57 if [ -z "$CROSS" ]; then
58 gzip -c artifacts/Image > Image.gz
59 cat Image.gz artifacts/apq8016-sbc.dtb > Image.gz-dtb
60 abootimg \
61 --create artifacts/db410c.img \
62 -k Image.gz-dtb \
63 -r artifacts/lava-rootfs-${CROSS:-arm64}.cpio.gz \
64 -c cmdline="ip=dhcp console=ttyMSM0,115200n8"
65 rm Image.gz Image.gz-dtb
66 fi
67
68 # Store job ID so the test stage can build URLs to the artifacts
69 echo $CI_JOB_ID > artifacts/build_job_id.txt
70
71 # Pass needed files to the test stage
72 cp $CI_PROJECT_DIR/.gitlab-ci/generate_lava.py artifacts/.
73 cp $CI_PROJECT_DIR/.gitlab-ci/lava-deqp.yml.jinja2 artifacts/.
74 fi