aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/multi-machine
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/multi-machine')
-rwxr-xr-xscripts/multi-machine111
1 files changed, 0 insertions, 111 deletions
diff --git a/scripts/multi-machine b/scripts/multi-machine
deleted file mode 100755
index 58397fd7..00000000
--- a/scripts/multi-machine
+++ /dev/null
@@ -1,111 +0,0 @@
-#!/bin/bash
-#
-# ---------------------------------------------------------------------------------------------------------------------
-# SPDX-License-Identifier: GPL-2.0
-# ---------------------------------------------------------------------------------------------------------------------
-#
-# Copyright 2022 Siemens
-#
-# This file is licensed under the terms of the GNU General Public License
-# version 2. This program is licensed "as is" without any warranty of any
-# kind, whether express or implied.
-
-usage () {
- echo >&2 "$0 [OPTIONS...] MACHINE..."
- echo >&2
- echo >&2 "Options:"
- echo >&2 " -b BUILDDIR Specify the build directory. (default: build)"
- echo >&2 " -o BITBAKE_ARGUMENTS Specify bitbake args (default: core-image-base)"
- echo >&2 " -s SETUP_ENVIRONMENT Specify the setup-environment script to use"
- echo >&2 " -a SETUP_ENV_ARGS Add additional setup-environment args"
- echo >&2 " -k Continue when one build fails"
- echo >&2 " -c Clean the TMPDIR before each build"
- echo >&2 " -h Show this usage information"
- exit 1
-}
-
-bgrm () {
- # bgrm PATH [PATH...]
- #
- # Remove the specified paths in the background, after renaming them, so
- # you're free to recreate and use those paths while they're being removed.
-
- toremove=""
- for item in "$@"; do
- if basename "$item" | grep -q "^bgrm."; then
- continue
- fi
-
- tempdir=$(mktemp -d $(dirname $item)/bgrm.XXXXXX) || exit 1
- mkdir -p $tempdir
- toremove="$toremove $tempdir"
- mv "$item" "$tempdir/"
- done
- rm -rf $toremove &
-}
-
-builddir=build
-bitbakeopts=core-image-base
-setupscript=$(dirname $0)/../setup-environment
-setupscriptargs=
-continue=0
-clean=0
-while getopts b:o:s:a:ckh opt; do
- case "$opt" in
- b)
- builddir="$OPTARG"
- ;;
- o)
- bitbakeopts="$OPTARG"
- ;;
- s)
- setupscript="$OPTARG"
- ;;
- a)
- setupscriptargs="$OPTARG"
- ;;
- c)
- clean=1
- ;;
- k)
- continue=1
- ;;
- \?|h)
- usage
- ;;
- esac
-done
-shift $(expr $OPTIND - 1)
-unset OPTIND
-
-if [ $# -eq 0 ]; then
- usage
-fi
-
-bitbakeopts="-k $bitbakeopts"
-topdir=$PWD
-for machine; do
- eval . "$setupscript -f -b $builddir $setupscriptargs $machine"
- echo "Running bitbake $bitbakeopts for $machine.."
- eval bitbake $bitbakeopts
- ret=$?
- if [ $ret -ne 0 ]; then
- if [ $continue -eq 0 ]; then
- echo >&2 "Build for $machine failed with exit code $ret, aborting"
- exit $ret
- else
- echo >&2 "Warning: build for $machine failed with exit code $ret"
- fi
- fi
- cp -a "$TMPDIR/log/." "$builddir/log/"
- if [ $clean -eq 1 ]; then
- eval $(bitbake -e | grep '^TMPDIR=')
- if [ -z "$TMPDIR" ]; then
- echo >&2 "Error: failed to extract TMPDIR from bitbake -e"
- exit 2
- fi
- bgrm $TMPDIR
- fi
- cd $topdir
- sleep 1
-done