-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·125 lines (97 loc) · 2.93 KB
/
build.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#!/bin/bash
# Script to build image for qemu.
# Author: Siddhant Jajoo.
git submodule init
git submodule sync
git submodule update
# local.conf won't exist until this step on first execution
source poky/oe-init-build-env
# Start clean
bitbake -c cleanall core-image-forceapp
CONFLINE="MACHINE = \"raspberrypi4\""
#Create image of the type rpi-sdimg
IMAGE="IMAGE_FSTYPES = \"tar.xz ext3 rpi-sdimg\""
#Set GPU memory as minimum
MEMORY="GPU_MEM = \"16\""
#Licence
LICENCE="LICENSE_FLAGS_ACCEPTED = \"synaptics-killswitch\""
INIT_MAN="INIT_MANAGER = \"systemd\""
cat conf/local.conf | grep "${CONFLINE}" > /dev/null
local_conf_info=$?
cat conf/local.conf | grep "${IMAGE}" > /dev/null
local_image_info=$?
cat conf/local.conf | grep "${MEMORY}" > /dev/null
local_memory_info=$?
cat conf/local.conf | grep "${LICENCE}" > /dev/null
local_licn_info=$?
cat conf/local.conf | grep "${INIT_MAN}" > /dev/null
local_init_man_info=$?
# Add above params to local.conf
if [ $local_conf_info -ne 0 ];then
echo "Append ${CONFLINE} in the local.conf file"
echo ${CONFLINE} >> conf/local.conf
else
echo "${CONFLINE} already exists in the local.conf file"
fi
if [ $local_image_info -ne 0 ];then
echo "Append ${IMAGE} in the local.conf file"
echo ${IMAGE} >> conf/local.conf
else
echo "${IMAGE} already exists in the local.conf file"
fi
if [ $local_memory_info -ne 0 ];then
echo "Append ${MEMORY} in the local.conf file"
echo ${MEMORY} >> conf/local.conf
else
echo "${MEMORY} already exists in the local.conf file"
fi
if [ $local_licn_info -ne 0 ];then
echo "Append ${LICENCE} in the local.conf file"
echo ${LICENCE} >> conf/local.conf
else
echo "${LICENCE} already exists in the local.conf file"
fi
if [ $local_init_man_info -ne 0 ];then
echo "Append ${INIT_MAN} in the local.conf file"
echo ${INIT_MAN} >> conf/local.conf
else
echo "${INIT_MAN} already exists in the local.conf file"
fi
# ADD raspberrypi layer
bitbake-layers show-layers | grep "meta-raspberrypi" > /dev/null
layer_info=$?
if [ $layer_info -ne 0 ];then
echo "Adding meta-raspberrypi layer"
bitbake-layers add-layer ../meta-raspberrypi
else
echo "layer meta-raspberrypi already exists"
fi
# ADD oe layer
bitbake-layers show-layers | grep "meta-oe" > /dev/null
layer_info=$?
if [ $layer_info -ne 0 ];then
echo "Adding meta-oe layer"
bitbake-layers add-layer ../meta-openembedded/meta-oe
else
echo "layer meta-oe already exists"
fi
# Add python layer
bitbake-layers show-layers | grep "meta-python" > /dev/null
layer_info=$?
if [ $layer_info -ne 0 ];then
echo "Adding meta-python layer"
bitbake-layers add-layer ../meta-openembedded/meta-python
else
echo "layer meta-python already exists"
fi
# ADD forceapp layer
bitbake-layers show-layers | grep "meta-forceapp" > /dev/null
layer_info=$?
if [ $layer_info -ne 0 ];then
echo "Adding meta-forceapp layer"
bitbake-layers add-layer ../meta-forceapp
else
echo "layer meta-forceapp already exists"
fi
set -e
bitbake core-image-forceapp