summaryrefslogtreecommitdiff
path: root/56-build-libcamera-CTS.sh
blob: ec23da44ef59808f68ad1da270cb02e804a3cd26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash

# SPDX-License-Identifier: GPL-2.0-or-later
#
# CTS Tree builder
#
# This is a highly specific test to compile CTS in a pre-prepared CrOS-SDK with
# a pre-installed soraka-libcamera target.

CROS=/home/kbingham/iob/libcamera/chromeos
CROS_CTS=$CROS/CTS/libcamera-cts
CROS_CTS_RESULTS=$CROS_CTS/results/
CROS_LIBCAMERA=$CROS/src/third_party/libcamera

source ./common.sh

if [ ! -d $CROS_CTS ] ;
then
	echo " [CTS] This test is highly customised to run on Kieran's Build Server"
	echo " [CTS] Feel free to adapt if possible but otherwise this will skip..."
	exit 0
fi

echo "Commencing Build for CTS" > $logfile

LIBCAMERA=${1:-$(srcdir libcamera)}

if [ ! -d $LIBCAMERA ] ;
then
	fail "A valid libcamera tree is required to test"
	# No return from fail
fi


## Install 'our' version of libcamera

update_sources() {
	# Check existing link
	ls -alh $CROS_LIBCAMERA

	# Sync our version to libcamera-integration
	rsync -av $LIBCAMERA/ $CROS_LIBCAMERA-integration/
	pass_fail $? "Synchronise sources to chrome SDK"

	unlink $CROS_LIBCAMERA
	ln -s libcamera-integration $CROS_LIBCAMERA
	ls -alh $CROS_LIBCAMERA
}

build_libcamera() {
	echo "Building and installing libcamera on the Soraka..."
	# A custom Makefile is inside the chroot to simplify this step

	( sudo $CROS/chromite/bin/cros_sdk make libcamera-clean libcamera ) 2>&1
	pass_fail $? "Install libcamera on Soraka"
}


update_sources > $logfile
echo "Updated sources"
build_libcamera >> $logfile
echo "Finished building libcamera"