aboutsummaryrefslogtreecommitdiffstats
path: root/bitbake/bin
diff options
context:
space:
mode:
authorbrian avery <avery.brian@gmail.com>2015-11-20 18:29:34 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-12-07 17:37:07 +0000
commitdc6a489c65c067106bafbfcd1d2ba6ee6ecd7b24 (patch)
tree4233cb4eee06cc334d6b66c988b802a3c3b30a5b /bitbake/bin
parent5a42c2d05048e2742391a7bbc84d5fa7f76c5219 (diff)
downloadopenembedded-core-contrib-dc6a489c65c067106bafbfcd1d2ba6ee6ecd7b24.tar.gz
bitbake: toaster: change toasterconf.json logic to use TEMPLATECONF, like oe-setup-builddir
This changes the way we pick a toasterconf.json file so that it matches the way oe-setup-builddir does it. We now base it on TEMPLATECONF found in the .templateconf file. (Bitbake rev: 8476db82ea80edf2b70bc2082bcecee09037556d) Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/bin')
-rwxr-xr-xbitbake/bin/toaster33
1 files changed, 24 insertions, 9 deletions
diff --git a/bitbake/bin/toaster b/bitbake/bin/toaster
index 71f882e744..abc8737a4d 100755
--- a/bitbake/bin/toaster
+++ b/bitbake/bin/toaster
@@ -175,6 +175,7 @@ else
fi
BBBASEDIR=`dirname $TOASTER`/..
+OEROOT=`dirname $TOASTER`/../..
RUNNING=0
@@ -185,18 +186,33 @@ if [ "$WEB_PORT" = "" ]; then
WEB_PORT="8000"
fi
# this is the configuraton file we are using for toaster
-# note default is assuming yocto. Override this if you are
-# running in a pure OE environment and use the toasterconf.json
-# in meta/conf/toasterconf.json
-# note: for future there are a number of relative path assumptions
-# in the local layers that currently prevent using an arbitrary
-# toasterconf.json
+# we are using the same logic that oe-setup-builddir uses
+# (based on TEMPLATECONF and .templateconf) to determine
+# which toasterconf.json to use.
+# note: There are a number of relative path assumptions
+# in the local layers that currently make using an arbitrary
+# toasterconf.json difficult.
+
+. $OEROOT/.templateconf
+if [ -n "$TEMPLATECONF" ]; then
+ if [ ! -d "$TEMPLATECONF" ]; then
+ # Allow TEMPLATECONF=meta-xyz/conf as a shortcut
+ if [ -d "$OEROOT/$TEMPLATECONF" ]; then
+ TEMPLATECONF="$OEROOT/$TEMPLATECONF"
+ fi
+ if [ ! -d "$TEMPLATECONF" ]; then
+ echo >&2 "Error: '$TEMPLATECONF' must be a directory containing toasterconf.json"
+ [ "$TOASTER_MANAGED" = '1' ] && exit 1 || return 1
+ fi
+ fi
+fi
+
if [ "$TOASTER_CONF" = "" ]; then
- TOASTER_CONF="$(dirname $TOASTER)/../../meta-yocto/conf/toasterconf.json"
+ TOASTER_CONF="$TEMPLATECONF/toasterconf.json"
export TOASTER_CONF=$(python -c "import os; print os.path.realpath('$TOASTER_CONF')")
fi
if [ ! -f $TOASTER_CONF ]; then
- echo "$TOASTER_CONF configuration file not found. set TOASTER_CONF to specify a path"
+ echo "$TOASTER_CONF configuration file not found. Set TOASTER_CONF to specify file or fix .templateconf"
[ "$TOASTER_MANAGED" = '1' ] && exit 1 || return 1
fi
# this defines the dir toaster will use for
@@ -324,4 +340,3 @@ case $CMD in
echo "Successful ${CMD}."
;;
esac
-