xref: /OK3568_Linux_fs/yocto/poky/scripts/contrib/test_build_time_worker.sh (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1#!/bin/bash
2#
3# SPDX-License-Identifier: GPL-2.0-only
4#
5# This is an example script to be used in conjunction with test_build_time.sh
6
7if [ "$TEST_BUILDDIR" = "" ] ; then
8    echo "TEST_BUILDDIR is not set"
9    exit 1
10fi
11
12buildsubdir=`basename $TEST_BUILDDIR`
13if [ ! -d $buildsubdir ] ; then
14    echo "Unable to find build subdir $buildsubdir in current directory"
15    exit 1
16fi
17
18if [ -f oe-init-build-env ] ; then
19    . ./oe-init-build-env $buildsubdir
20elif [ -f poky-init-build-env ] ; then
21    . ./poky-init-build-env $buildsubdir
22else
23    echo "Unable to find build environment setup script"
24    exit 1
25fi
26
27if [ -f ../meta/recipes-sato/images/core-image-sato.bb ] ; then
28    target="core-image-sato"
29else
30    target="poky-image-sato"
31fi
32
33echo "Build started at `date "+%Y-%m-%d %H:%M:%S"`"
34echo "bitbake $target"
35bitbake $target
36ret=$?
37echo "Build finished at `date "+%Y-%m-%d %H:%M:%S"`"
38exit $ret
39
40