ci: Add scripts for controlling bare-metal chezas.
[mesa.git] / .gitlab-ci / bare-metal / rootfs-setup.sh
1 #!/bin/bash
2
3 rootfs_dst=$1
4
5 # Copy the rootfs to a temporary for our setup, as I believe changes to the
6 # container can end up impacting future runs.
7 cp -Rp $BM_ROOTFS/. $rootfs_dst
8
9 # Set up the init script that brings up the system.
10 cp $BM/init.sh $rootfs_dst/init
11
12 set +x
13 # Pass through relevant env vars from the gitlab job to the baremetal init script
14 touch $rootfs_dst/set-job-env-vars.sh
15 chmod +x $rootfs_dst/set-job-env-vars.sh
16 for var in \
17 CI_COMMIT_BRANCH \
18 CI_COMMIT_TITLE \
19 CI_JOB_ID \
20 CI_JOB_URL \
21 CI_MERGE_REQUEST_SOURCE_BRANCH_NAME \
22 CI_MERGE_REQUEST_TITLE \
23 CI_NODE_INDEX \
24 CI_NODE_TOTAL \
25 CI_PIPELINE_ID \
26 CI_RUNNER_DESCRIPTION \
27 DEQP_CASELIST_FILTER \
28 DEQP_EXPECTED_RENDERER \
29 DEQP_NO_SAVE_RESULTS \
30 DEQP_PARALLEL \
31 DEQP_RUN_SUFFIX \
32 DEQP_VER \
33 FD_MESA_DEBUG \
34 FLAKES_CHANNEL \
35 IR3_SHADER_DEBUG \
36 NIR_VALIDATE \
37 ; do
38 val=`echo ${!var} | sed 's|"||g'`
39 echo "export $var=\"${val}\"" >> $rootfs_dst/set-job-env-vars.sh
40 done
41 echo "Variables passed through:"
42 cat $rootfs_dst/set-job-env-vars.sh
43 set -x
44
45 # Add the Mesa drivers we built, and make a consistent symlink to them.
46 mkdir -p $rootfs_dst/$CI_PROJECT_DIR
47 tar -C $rootfs_dst/$CI_PROJECT_DIR/ -xf $CI_PROJECT_DIR/artifacts/install.tar
48 ln -sf $CI_PROJECT_DIR/install $rootfs_dst/install
49
50 # Copy the deqp runner script and metadata.
51 cp .gitlab-ci/deqp-runner.sh $rootfs_dst/deqp/
52 cp .gitlab-ci/$DEQP_SKIPS $rootfs_dst/$CI_PROJECT_DIR/install/deqp-skips.txt
53 if [ -n "$DEQP_EXPECTED_FAILS" ]; then
54 cp .gitlab-ci/$DEQP_EXPECTED_FAILS $rootfs_dst/$CI_PROJECT_DIR/install/deqp-expected-fails.txt
55 fi