1187971a19063ea5d6f0d5488ef5aac75449e54e
[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 TU_DEBUG \
38 VK_DRIVER \
39 ; do
40 val=`echo ${!var} | sed 's|"||g'`
41 echo "export $var=\"${val}\"" >> $rootfs_dst/set-job-env-vars.sh
42 done
43 echo "Variables passed through:"
44 cat $rootfs_dst/set-job-env-vars.sh
45 set -x
46
47 # Add the Mesa drivers we built, and make a consistent symlink to them.
48 mkdir -p $rootfs_dst/$CI_PROJECT_DIR
49 tar -C $rootfs_dst/$CI_PROJECT_DIR/ -xf $CI_PROJECT_DIR/artifacts/install.tar
50 ln -sf $CI_PROJECT_DIR/install $rootfs_dst/install
51
52 # Copy the deqp runner script and metadata.
53 cp .gitlab-ci/deqp-runner.sh $rootfs_dst/deqp/
54 cp .gitlab-ci/$DEQP_SKIPS $rootfs_dst/$CI_PROJECT_DIR/install/deqp-skips.txt
55 if [ -n "$DEQP_EXPECTED_FAILS" ]; then
56 cp .gitlab-ci/$DEQP_EXPECTED_FAILS $rootfs_dst/$CI_PROJECT_DIR/install/deqp-expected-fails.txt
57 fi