diff options
Diffstat (limited to '57-build-libcamera-CTS.sh')
-rwxr-xr-x | 57-build-libcamera-CTS.sh | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/57-build-libcamera-CTS.sh b/57-build-libcamera-CTS.sh new file mode 100755 index 0000000..ec23da4 --- /dev/null +++ b/57-build-libcamera-CTS.sh @@ -0,0 +1,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" + |