-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup-environment
65 lines (55 loc) · 1.5 KB
/
setup-environment
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/hint/bash
thisdir=$(pwd)
if [[ ! -d $thisdir/meta-newbs ]]; then
echo "meta-newbs not found!"
echo "please source this script from the NEWBS root"
return 1
fi
NEWBSROOT=$(readlink -f $thisdir)
unset thisdir
while (($#)); do
case "$1" in
32)
MACHINE=raspberrypi3
;;
64)
MACHINE=raspberrypi3-64
;;
build-*)
BUILD_DIR="$1"
;;
unifi)
DISTRO="newbs-unifi"
;;
*)
echo "Warning: unknown build option '$1'"
;;
esac
shift
done
# defaults, if not set above
: ${DISTRO:=newbs}
: ${MACHINE:=raspberrypi4-64}
: ${BUILD_DIR:=build-${MACHINE}}
echo "Using MACHINE $MACHINE"
echo "Using BUILD_DIR $BUILD_DIR"
source meta-wild-common/common-envsetup
_wild_yocto_apply_patches
if [[ $? != 0 ]]; then
echo "ERROR: failed to apply yocto patches"
return
fi
_wild_yocto_symlink_cache_dir downloads
_wild_yocto_symlink_cache_dir sstate-cache
export TEMPLATECONF="$NEWBSROOT/meta-newbs/conf/templates/newbs"
echo $TEMPLATECONF
source openembedded-core/oe-init-build-env $BUILD_DIR
unset TEMPLATECONF
# now we're in the build directory and should have bblayers.conf and local.conf
BB_CONF="conf/bblayers.conf"
LOCAL_CONF="conf/local.conf"
# post-process conf files
_wild_yocto_subst_confvars $BB_CONF $LOCAL_CONF -- NEWBSROOT MACHINE DISTRO
# unset unused variables
unset BUILD_DIR BB_CONF LOCAL_CONF NEWBSROOT MACHINE DISTRO
_wild_yocto_unset_functions