diff options
author | Alexander Amelkin <a.amelkin@yadro.com> | 2018-02-02 12:01:13 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-02-14 23:14:12 +0300 |
commit | 68a967df1cd51faddd571c33abe5938303db3b8a (patch) | |
tree | 6a81dfeb6d007df929921d878544765eebfca12f | |
parent | 1ae577d3d5340672341f4cc5c743957e619e5cee (diff) | |
download | openbmc-68a967df1cd51faddd571c33abe5938303db3b8a.tar.xz |
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 <a.amelkin@yadro.com>
-rwxr-xr-x | setup | 43 |
1 files changed, 43 insertions, 0 deletions
@@ -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 |