forked from Halolo/orange-pi-distro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
source-me
38 lines (31 loc) · 896 Bytes
/
source-me
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
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$DIR"
MACHINE="$1"
if [ -z "$MACHINE" ]; then
echo "Machine name is missing" 1>&2
else
BUILD_DIR="$DIR/build"
# Create build environment
. "$DIR/poky/oe-init-build-env" "$BUILD_DIR" > /dev/null
if [ "$?" -eq 0 ]; then
# Add machine and distro
echo '' >> "$BUILD_DIR/conf/local.conf"
sed -i '/# OPI/,$d' "$BUILD_DIR/conf/local.conf"
echo '# OPI
MACHINE = "'"$MACHINE"'"
DISTRO = "opi"' >> "$BUILD_DIR/conf/local.conf"
# Add layers
echo '' >> "$BUILD_DIR/conf/bblayers.conf"
sed -i '/# OPI/,$d' "$BUILD_DIR/conf/bblayers.conf"
echo "# OPI
BBLAYERS += \" \\
$DIR/meta-openembedded/meta-oe \\
$DIR/meta-qt5 \\
$DIR/meta-opi \\
\"" >> "$BUILD_DIR/conf/bblayers.conf"
echo "Run 'bitbake <target>' (i.e. 'bitbake opiz-minimal')" 1>&2
fi
unset BUILD_DIR
fi
unset DIR