forked from stucki/docker-lineageos
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstartup.sh
123 lines (105 loc) · 6.19 KB
/
startup.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
#!/bin/sh
echo "
##################
#############################
###################################
#######################################
############# #############
########### ###########
######### ##########
######### #########
######### #########
######## ########
######## ############# ########
####### ################### #######
####### ##################### #######
####### ####################### #######
######## ######################### ########
######## ######################### ########
############ ############# ########################### ############## #############
#################### ################## ######################### #################### ####################
################################################## ####################### ####################################################
############# ###################################### ####################### ###################################### #############
######### ################## ####### ################### ####### ################## #########
######## ########### ######## ############# ######## ########### ########
####### ####### ######## ######## ####### #######
####### ####### ######### ####### ####### #######
####### ####### ######### ######### ####### #######
####### ######## ######### ########## ######## #######
######## ######## ########### ########### ######## ########
######### ######### ############ ############ ######### #########
########## ######### ################### ################### ########### ###########
######################## ################################### ########################
#################### ############################# ####################
"
# Initialize ccache if needed
if [ ! -f /srv/ccache/ccache.conf ]; then
echo "============================================"
echo "Initializing ccache in /srv/ccache..."
echo "============================================"
CCACHE_DIR=/srv/ccache ccache -M 50G
fi
export USER="build"
export PATH=$PATH:/home/build/bin
if [ -z $GITUSER ]; then
echo "============================================"
echo "Git user name is not define. Example : Your Name"
echo "============================================"
exit 1
fi
if [ -z $GITMAIL ]; then
echo "============================================"
echo "Git user mail is not defined. Example : you@example.com."
echo "============================================"
exit 1
fi
if [ -z $PRODUCT ]; then
echo "============================================"
echo "Env PRODUCT is not defined."
echo "============================================"
exit 1
fi
git config --global user.name $GITMAIL
git config --global user.email $GITMAIL
#Skip color with repo command
git config --global color.ui false
if [ -z $BRANCH ]; then
BRANCH="cm-14.1"
fi
echo "============================================"
echo "Sync repository ..."
echo "============================================"
repo init -u git://github.com/LineageOS/android.git -b cm-14.1
#Sync repo
if [ -n $FORCESYNC ]; then
repo sync -d
else
repo sync
fi
echo "============================================"
echo "Setup env"
echo "============================================"
#Fix Source
source build/envsetup.sh
breakfast $PRODUCT
export USE_CCACHE=1
#Fix Jack out of memory
export ANDROID_JACK_VM_ARGS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4G"
if [ -n $PREBUILD ]; then
exec $PREBUILD
fi
if [ -n $REPO ]; then
echo "============================================"
echo "Replacing OTA server"
echo "============================================"
sed -i "s,https://download.lineageos.org/api,$REPO,g" packages/apps/CMUpdater/res/values/config.xml
fi
echo "============================================"
echo "Starting build ..."
echo "============================================"
croot
brunch $PRODUCT
if [ -n $POSTBUILD ]; then
exec $POSTBUILD
fi
exit 0