-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathbuild-in-docker.sh
executable file
·45 lines (38 loc) · 1.16 KB
/
build-in-docker.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
#!/usr/bin/env bash
programname=$0
function usage {
echo "usage: $programname -i image -v variant [-b branch]"
echo " -i image specify image name would you like to build"
echo " -v variant specify variant of the target platform"
echo " -b branch specify branch name which you would like to use for sources (optional)"
echo " -l layer specify layer name you want to build (optional)"
echo " -h display help"
}
BRANCH='master'
while getopts hi:v:b:l: option; do
case "${option}" in
i) IMAGE=${OPTARG};;
v) VARIANT=${OPTARG};;
b) BRANCH=$OPTARG;;
l) LAYER=${OPTARG};;
h) usage
exit 0;;
esac
done
if [[ $# -eq 0 ]] ; then
echo "variant and image are mandatory arguments"
usage
exit 1
fi
repo init -u https://github.com/Pelagicore/pelux-manifests.git -b $BRANCH;
repo sync;
if [ $LAYER ] ; then
echo ""
echo "Replacing existing meta layer with custom one"
echo ""
rm -rf sources/${LAYER};
mv ${LAYER} sources/${LAYER};
fi
TEMPLATECONF=`pwd`/sources/meta-pelux/conf/variant/$VARIANT;
source sources/poky/oe-init-build-env build;
bitbake $IMAGE;