3
BM=$CI_PROJECT_DIR/install/bare-metal
4
CI_COMMON=$CI_PROJECT_DIR/install/common
6
if [ -z "$BM_SERIAL" -a -z "$BM_SERIAL_SCRIPT" ]; then
7
echo "Must set BM_SERIAL OR BM_SERIAL_SCRIPT in your gitlab-runner config.toml [[runners]] environment"
9
echo " This is the serial device to talk to for waiting for fastboot to be ready and logging from the kernel."
10
echo "BM_SERIAL_SCRIPT:"
11
echo " This is a shell script to talk to for waiting for fastboot to be ready and logging from the kernel."
15
if [ -z "$BM_POWERUP" ]; then
16
echo "Must set BM_POWERUP in your gitlab-runner config.toml [[runners]] environment"
17
echo "This is a shell script that should reset the device and begin its boot sequence"
18
echo "such that it pauses at fastboot."
22
if [ -z "$BM_POWERDOWN" ]; then
23
echo "Must set BM_POWERDOWN in your gitlab-runner config.toml [[runners]] environment"
24
echo "This is a shell script that should power off the device."
28
if [ -z "$BM_FASTBOOT_SERIAL" ]; then
29
echo "Must set BM_FASTBOOT_SERIAL in your gitlab-runner config.toml [[runners]] environment"
30
echo "This must be the a stable-across-resets fastboot serial number."
34
if [ -z "$BM_KERNEL" ]; then
35
echo "Must set BM_KERNEL to your board's kernel vmlinuz or Image.gz in the job's variables:"
39
if [ -z "$BM_DTB" ]; then
40
echo "Must set BM_DTB to your board's DTB file in the job's variables:"
44
if [ -z "$BM_ROOTFS" ]; then
45
echo "Must set BM_ROOTFS to your board's rootfs directory in the job's variables:"
49
if echo $BM_CMDLINE | grep -q "root=/dev/nfs"; then
55
# Clear out any previous run's artifacts.
59
if [ -n "$BM_FASTBOOT_NFSROOT" ]; then
60
# Create the rootfs in the NFS directory. rm to make sure it's in a pristine
61
# state, since it's volume-mounted on the host.
62
rsync -a --delete $BM_ROOTFS/ /nfs/
64
. $BM/rootfs-setup.sh /nfs
66
# Root on NFS, no need for an inintramfs.
71
# Create the rootfs in a temp dir
72
rsync -a --delete $BM_ROOTFS/ rootfs/
73
. $BM/rootfs-setup.sh rootfs
75
# Finally, pack it up into a cpio rootfs. Skip the vulkan CTS since none of
76
# these devices use it and it would take up space in the initrd.
78
if [ -n "$PIGLIT_PROFILES" ]; then
79
EXCLUDE_FILTER="deqp|arb_gpu_shader5|arb_gpu_shader_fp64|arb_gpu_shader_int64|glsl-4.[0123456]0|arb_tessellation_shader"
81
EXCLUDE_FILTER="piglit|python"
86
egrep -v "external/(openglcts|vulkancts|amber|glslang|spirv-tools)" |
87
egrep -v "traces-db|apitrace|renderdoc" | \
88
egrep -v $EXCLUDE_FILTER | \
90
xz --check=crc32 -T4 - > $CI_PROJECT_DIR/rootfs.cpio.gz
94
# Make the combined kernel image and dtb for passing to fastboot. For normal
95
# Mesa development, we build the kernel and store it in the docker container
96
# that this script is running in.
98
# However, container builds are expensive, so when you're hacking on the
99
# kernel, it's nice to be able to skip the half hour container build and plus
100
# moving that container to the runner. So, if BM_KERNEL+BM_DTB are URLs,
101
# fetch them instead of looking in the container.
102
if echo "$BM_KERNEL $BM_DTB" | grep -q http; then
105
wget $BM_KERNEL -O kernel
108
cat kernel dtb > Image.gz-dtb
111
cat $BM_KERNEL $BM_DTB > Image.gz-dtb
116
--create artifacts/fastboot.img \
119
-c cmdline="$BM_CMDLINE"
122
export PATH=$BM:$PATH
124
# Start background command for talking to serial if we have one.
125
if [ -n "$BM_SERIAL_SCRIPT" ]; then
126
$BM_SERIAL_SCRIPT > results/serial-output.txt &
128
while [ ! -e results/serial-output.txt ]; do
134
$BM/fastboot_run.py \
136
--fbserial="$BM_FASTBOOT_SERIAL" \
137
--powerup="$BM_POWERUP" \
138
--powerdown="$BM_POWERDOWN"
142
if [ -n "$BM_FASTBOOT_NFSROOT" ]; then
143
# Bring artifacts back from the NFS dir to the build dir where gitlab-runner
144
# will look for them.
145
cp -Rp /nfs/results/. results/