forked from aws4embeddedlinux/meta-aws-demos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init-build-env
40 lines (33 loc) · 891 Bytes
/
init-build-env
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
if [ -n "$BASH_SOURCE" ]; then
THIS_SCRIPT=$BASH_SOURCE
elif [ -n "$ZSH_NAME" ]; then
THIS_SCRIPT=$0
else
THIS_SCRIPT="$(pwd)/oe-init-build-env"
if [ ! -e "$THIS_SCRIPT" ]; then
echo "Error: $THIS_SCRIPT doesn't exist!" >&2
echo "Please run this script in oe-init-build-env's directory." >&2
exit 1
fi
fi
ROOT_DIR=$(realpath $(dirname $THIS_SCRIPT))
export TEMPLATECONF="$ROOT_DIR/meta-aws-demos/conf/templates/default"
if [ -n "$1" ]; then
BUILDDIR=$(realpath "$1")
else
BUILDDIR=$ROOT_DIR/build
fi
get_devices() {
(
cd $ROOT_DIR/meta-aws-demos/conf/devices
for f in *; do
if [ -e $f/config.conf ]; then
echo $f
fi
done
)
}
cd $(dirname $THIS_SCRIPT)/poky
. oe-init-build-env "$BUILDDIR"
export BB_ENV_PASSTHROUGH_ADDITIONS="${BB_ENV_PASSTHROUGH_ADDITIONS} BUILD_DEVICE"