blob: d2c6dc0ea79ba5fb1b0b21129678dc3400cc59df [file] [log] [blame]
Andrew Geissler7e0e3c02022-02-25 20:34:39 +00001#!/bin/sh
2
3# SPDX-FileCopyrightText: Andrei Gherzan <andrei.gherzan@huawei.com>
4#
5# SPDX-License-Identifier: MIT
6
7set -ex
8
9# shellcheck disable=SC1091
10. /utils.sh
11
12META_RASPBERRYPI_PATH="/work"
13
14[ -n "$BASE_REF" ] ||
15 error "Target branch is needed. Make sure that is set in BASE_REF."
16[ -d "$META_RASPBERRYPI_PATH/.git" ] ||
17 error "Can't find a git checkout under $META_RASPBERRYPI_PATH ."
18[ -n "$MACHINE" ] ||
19 error "Machine to be used for build not provided."
20[ -n "$IMAGE" ] ||
21 error "Image to build not provided."
22
23TEMP_DIR="$(mktemp -d)"
24cd "$TEMP_DIR"
25
26REPOS=" \
27 git://git.yoctoproject.org/poky.git \
28"
29for repo in $REPOS; do
30 log "Cloning $repo on branch $BASE_REF..."
31 git clone --depth 1 --branch "$BASE_REF" "$repo"
32done
33
34# shellcheck disable=SC1091,SC2240
35. ./poky/oe-init-build-env build
36
37# Build configuration
38printf "\n# ------ ci ------\n" >> conf/local.conf
39[ -z "$SSTATE_DIR" ] || echo SSTATE_DIR = \""$SSTATE_DIR"\" >> conf/local.conf
40[ -z "$DL_DIR" ] || echo DL_DIR = \""$DL_DIR"\" >> conf/local.conf
41[ -z "$DISTRO" ] || echo DISTRO = \""$DISTRO"\" >> conf/local.conf
42cat <<EOCONF >>conf/local.conf
43BB_NUMBER_THREADS = "6"
44PARALLEL_MAKE = "-j 6"
45DISTRO_FEATURES:append = " systemd"
46VIRTUAL-RUNTIME_init_manager = "systemd"
47DISTRO_FEATURES_BACKFILL_CONSIDERED:append = " sysvinit"
48VIRTUAL-RUNTIME_initscripts = "systemd-compat-units"
Patrick Williamsdb4c27e2022-08-05 08:10:29 -050049LICENSE_FLAGS_ACCEPTED = "synaptics-killswitch"
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000050EOCONF
51
52# Add the BSP layer
53bitbake-layers add-layer "$META_RASPBERRYPI_PATH"
54
55# Log configs for debugging purposes
56for f in 'conf/local.conf' 'conf/bblayers.conf'; do
57 printf "\n------ %s ------\n" "$f"
58 cat "$f"
59done
60
61# Fire!
62MACHINE="$MACHINE" bitbake "$IMAGE"