From 68a967df1cd51faddd571c33abe5938303db3b8a Mon Sep 17 00:00:00 2001 From: Alexander Amelkin Date: Fri, 2 Feb 2018 12:01:13 +0300 Subject: Add setup script for easy openbmc env setup Before this commit it was required to specify a long TEMPLATECONF string before running openbmc-env if one wanted to build a non-qemu image. This commit adds a simple setup script that can be sourced like the following to setup the environment for any machine (e.g., for palmetto): . setup palmetto Change-Id: Id3fa73dca9b8ce9347cf38e41fe8662c03ea84e3 Signed-off-by: Alexander Amelkin --- setup | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 setup (limited to 'setup') diff --git a/setup b/setup new file mode 100755 index 000000000..5d1242505 --- /dev/null +++ b/setup @@ -0,0 +1,43 @@ +#!/bin/sh + +if [ "$(basename -- "$0")" = "setup" ]; then + echo The script must be sourced, not executed + exit 1 +fi + +machine() { + local target=$1 + local arch mfg mach realmach + for arch in meta-openbmc-machines/meta-*; do + for mfg in $arch/meta-*; do + for mach in $mfg/meta-*; do + if [ -d "$mach" -a -d "$mach/conf/machine" ]; then + realmach=${mach##*meta-} + # If a target is specified, then check for a match, + # otherwise just list what we've discovered + if [ -n "$target" ]; then + if [ "$realmach" = "$target" ]; then + echo Machine $target is $mach + TEMPLATECONF="$mach/conf" source oe-init-build-env build + return + fi + else + echo "$realmach" + fi + fi + done + done + done + + [ -n "$target" ] && echo "No such machine!" +} + +if [ -z "$1" ]; then + echo Target machine must be specified. Use one of: + echo + echo qemuarm +elif [ "$1" = "qemuarm" ]; then + source openbmc-env +fi + +machine $1 | sort -- cgit v1.2.3