summaryrefslogtreecommitdiffstats
path: root/setup
diff options
context:
space:
mode:
authorAlexander Amelkin <a.amelkin@yadro.com>2018-02-02 12:01:13 +0300
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2018-02-14 20:14:12 +0000
commit68a967df1cd51faddd571c33abe5938303db3b8a (patch)
tree6a81dfeb6d007df929921d878544765eebfca12f /setup
parent1ae577d3d5340672341f4cc5c743957e619e5cee (diff)
downloadtalos-openbmc-68a967df1cd51faddd571c33abe5938303db3b8a.tar.gz
talos-openbmc-68a967df1cd51faddd571c33abe5938303db3b8a.zip
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>
Diffstat (limited to 'setup')
-rwxr-xr-xsetup43
1 files changed, 43 insertions, 0 deletions
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
OpenPOWER on IntegriCloud