-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbake.sh
executable file
·79 lines (63 loc) · 2.21 KB
/
bake.sh
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
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/bash
# Define the directories and branches
POKY_DIR="poky"
POKY_REPO="git://git.yoctoproject.org/poky"
POKY_BRANCH="nanbield"
META_OPENEMBEDDED_DIR="$POKY_DIR/meta-openembedded"
META_OPENEMBEDDED_REPO="https://github.com/openembedded/meta-openembedded"
META_OPENEMBEDDED_BRANCH="nanbield"
META_QT5_DIR="$POKY_DIR/meta-qt5"
META_QT5_REPO="https://github.com/meta-qt5/meta-qt5"
META_QT5_BRANCH="nanbield"
META_MESON_DIR="$POKY_DIR/meta-meson"
META_MESON_REPO="https://github.com/superna9999/meta-meson"
META_MESON_BRANCH="nanbield"
META_OPENSPEAKER_DIR="../../meta-openspeaker"
LOCAL_CONF="../../default.conf"
# Clone repositories if they don't exist
clone_repo() {
local dir="$1"
local repo="$2"
local branch="$3"
if [ ! -d "$dir" ]; then
echo "Cloning $repo into $dir..."
git clone -b "$branch" "$repo" "$dir"
else
echo "Repository $dir already exists. Skipping clone."
fi
}
# Clone necessary repositories
clone_repo "$POKY_DIR" "$POKY_REPO" "$POKY_BRANCH"
clone_repo "$META_OPENEMBEDDED_DIR" "$META_OPENEMBEDDED_REPO" "$META_OPENEMBEDDED_BRANCH"
clone_repo "$META_QT5_DIR" "$META_QT5_REPO" "$META_QT5_BRANCH"
clone_repo "$META_MESON_DIR" "$META_MESON_REPO" "$META_MESON_BRANCH"
# Enter the poky directory
cd "$POKY_DIR" || { echo "Failed to change directory to $POKY_DIR"; exit 1; }
# Source the environment
echo "Setting up Yocto build environment..."
source oe-init-build-env
# Add layers if they are not already added
add_layer_if_not_present() {
local layer="$1"
if ! bitbake-layers show-layers | grep -q "$layer"; then
echo "Adding layer $layer..."
bitbake-layers add-layer "$layer"
else
echo "Layer $layer is already added. Skipping."
fi
}
# Add necessary layers
add_layer_if_not_present "../meta-meson"
add_layer_if_not_present "../meta-openembedded/meta-oe"
add_layer_if_not_present "../meta-qt5"
add_layer_if_not_present "$META_OPENSPEAKER_DIR"
# Copy local.conf if it exists
if [ -f "$LOCAL_CONF" ]; then
echo "Copying local.conf..."
cp "$LOCAL_CONF" conf/local.conf
else
echo "default.conf not found at $LOCAL_CONF. Skipping copy."
fi
# Build the image
echo "Starting build for lepotato-openspeaker..."
bitbake lepotato-openspeaker