3 BM
=$CI_PROJECT_DIR/install
/bare-metal
5 if [ -z "$BM_SERIAL" -a -z "$BM_SERIAL_SCRIPT" ]; then
6 echo "Must set BM_SERIAL OR BM_SERIAL_SCRIPT in your gitlab-runner config.toml [[runners]] environment"
8 echo " This is the serial device to talk to for waiting for fastboot to be ready and logging from the kernel."
9 echo "BM_SERIAL_SCRIPT:"
10 echo " This is a shell script to talk to for waiting for fastboot to be ready and logging from the kernel."
14 if [ -z "$BM_POWERUP" ]; then
15 echo "Must set BM_POWERUP in your gitlab-runner config.toml [[runners]] environment"
16 echo "This is a shell script that should reset the device and begin its boot sequence"
17 echo "such that it pauses at fastboot."
21 if [ -z "$BM_POWERDOWN" ]; then
22 echo "Must set BM_POWERDOWN in your gitlab-runner config.toml [[runners]] environment"
23 echo "This is a shell script that should power off the device."
27 if [ -z "$BM_FASTBOOT_SERIAL" ]; then
28 echo "Must set BM_FASTBOOT_SERIAL in your gitlab-runner config.toml [[runners]] environment"
29 echo "This must be the a stable-across-resets fastboot serial number."
33 if [ -z "$BM_KERNEL" ]; then
34 echo "Must set BM_KERNEL to your board's kernel vmlinuz or Image.gz in the job's variables:"
38 if [ -z "$BM_DTB" ]; then
39 echo "Must set BM_DTB to your board's DTB file in the job's variables:"
43 if [ -z "$BM_ROOTFS" ]; then
44 echo "Must set BM_ROOTFS to your board's rootfs directory in the job's variables:"
50 # Clear out any previous run's artifacts.
53 find artifacts
/ -name serial\
*.txt |
xargs rm -f
55 # Create the rootfs in a temp dir
56 rsync
-a --delete $BM_ROOTFS/ rootfs
/
57 .
$BM/rootfs-setup.sh rootfs
59 # Finally, pack it up into a cpio rootfs. Skip the vulkan CTS since none of
60 # these devices use it and it would take up space in the initrd.
63 egrep -v "external/(openglcts|vulkancts|amber|glslang|spirv-tools)" | \
65 xz
--check=crc32
-T4 - > $CI_PROJECT_DIR/rootfs.
cpio.gz
68 cat $BM_KERNEL $BM_DTB > Image.gz-dtb
71 --create artifacts
/fastboot.img \
74 -c cmdline
="$BM_CMDLINE"
77 # Start watching serial, and power up the device.
78 if [ -n "$BM_SERIAL" ]; then
79 $BM/serial-buffer.py
$BM_SERIAL |
tee artifacts
/serial-output.txt
&
81 PATH
=$BM:$PATH $BM_SERIAL_SCRIPT |
tee artifacts
/serial-output.txt
&
84 while [ ! -e artifacts
/serial-output.txt
]; do
87 PATH
=$BM:$PATH $BM_POWERUP
89 # Once fastboot is ready, boot our image.
90 $BM/expect-output.sh artifacts
/serial-output.txt \
91 -f "fastboot: processing commands" \
92 -f "Listening for fastboot command on" \
95 fastboot boot
-s $BM_FASTBOOT_SERIAL artifacts
/fastboot.img
97 # Wait for the device to complete the deqp run
98 $BM/expect-output.sh artifacts
/serial-output.txt \
99 -f "bare-metal result" \
100 -e "---. end Kernel panic"
102 # power down the device
103 PATH
=$BM:$PATH $BM_POWERDOWN
106 if grep -q "bare-metal result: pass" artifacts
/serial-output.txt
; then