| Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 1 | #!/bin/sh | 
|  | 2 |  | 
|  | 3 | # SPDX-FileCopyrightText: Andrei Gherzan <andrei.gherzan@huawei.com> | 
|  | 4 | # | 
|  | 5 | # SPDX-License-Identifier: MIT | 
|  | 6 |  | 
|  | 7 | set -ex | 
|  | 8 |  | 
|  | 9 | # shellcheck disable=SC1091 | 
|  | 10 | . /utils.sh | 
|  | 11 |  | 
|  | 12 | META_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 |  | 
|  | 23 | TEMP_DIR="$(mktemp -d)" | 
|  | 24 | cd "$TEMP_DIR" | 
|  | 25 |  | 
|  | 26 | REPOS=" \ | 
|  | 27 | git://git.yoctoproject.org/poky.git \ | 
|  | 28 | " | 
|  | 29 | for repo in $REPOS; do | 
|  | 30 | log "Cloning $repo on branch $BASE_REF..." | 
|  | 31 | git clone --depth 1 --branch "$BASE_REF" "$repo" | 
|  | 32 | done | 
|  | 33 |  | 
|  | 34 | # shellcheck disable=SC1091,SC2240 | 
|  | 35 | . ./poky/oe-init-build-env build | 
|  | 36 |  | 
|  | 37 | # Build configuration | 
|  | 38 | printf "\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 | 
|  | 42 | cat <<EOCONF >>conf/local.conf | 
|  | 43 | BB_NUMBER_THREADS = "6" | 
|  | 44 | PARALLEL_MAKE = "-j 6" | 
| Andrew Geissler | 2edf064 | 2023-09-11 08:24:07 -0400 | [diff] [blame] | 45 | # unmerged-usr is deprecated | 
|  | 46 | # https://lore.kernel.org/all/3f2f03085301d22854e5429019fb010f27d98bc7.camel@linuxfoundation.org/t/ | 
|  | 47 | DISTRO_FEATURES:append = " systemd usrmerge" | 
| Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 48 | VIRTUAL-RUNTIME_init_manager = "systemd" | 
|  | 49 | DISTRO_FEATURES_BACKFILL_CONSIDERED:append = " sysvinit" | 
|  | 50 | VIRTUAL-RUNTIME_initscripts = "systemd-compat-units" | 
| Patrick Williams | db4c27e | 2022-08-05 08:10:29 -0500 | [diff] [blame] | 51 | LICENSE_FLAGS_ACCEPTED = "synaptics-killswitch" | 
| Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 52 | EOCONF | 
|  | 53 |  | 
|  | 54 | # Add the BSP layer | 
|  | 55 | bitbake-layers add-layer "$META_RASPBERRYPI_PATH" | 
|  | 56 |  | 
|  | 57 | # Log configs for debugging purposes | 
|  | 58 | for f in 'conf/local.conf' 'conf/bblayers.conf'; do | 
|  | 59 | printf "\n------ %s ------\n" "$f" | 
|  | 60 | cat "$f" | 
|  | 61 | done | 
|  | 62 |  | 
|  | 63 | # Fire! | 
|  | 64 | MACHINE="$MACHINE" bitbake "$IMAGE" |