-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpoky-setup.sh
More file actions
51 lines (41 loc) · 1.38 KB
/
Copy pathpoky-setup.sh
File metadata and controls
51 lines (41 loc) · 1.38 KB
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
#!/bin/bash
set -e
GREEN='\033[0;32m'
RED='\033[0;31m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
function info() { echo -e "${GREEN}[INFO]${NC} $1"; }
function warn() { echo -e "${YELLOW}[WARN]${NC} $1"; }
function error() { echo -e "${RED}[ERROR]${NC} $1"; }
POKY_DIR="/home/yocto/poky"
# Clone or update poky
if [ ! -d "$POKY_DIR/.git" ]; then
echo "#########################################################"
echo " "
echo "Setting up Yocto Project build environment for Scarthgap"
echo " "
echo "#########################################################"
echo " "
info "Cloning poky repository..."
rm -rf "$POKY_DIR"
git clone git://git.yoctoproject.org/poky "$POKY_DIR"
cd "$POKY_DIR"
info "Checking out scarthgap branch..."
git checkout scarthgap
else
warn "Poky already exists. Skipping clone."
cd "$POKY_DIR"
git fetch origin
git rebase origin/scarthgap
fi
info "Setting up Yocto build environment to external mounted folders..."
source oe-init-build-env /home/yocto/builds
# change cache settings from local.conf:
# (this step is optional but very useful)
sed -i 's|^DL_DIR ?=.*|DL_DIR ?= "/home/yocto/downloads"|' conf/local.conf
sed -i 's|^SSTATE_DIR ?=.*|SSTATE_DIR ?= "/home/yocto/sstate-cache"|' conf/local.conf
echo " "
info "Now you can start building with like:"
info " bitbake core-image-minimal"
echo " "
exec /bin/bash