-
Notifications
You must be signed in to change notification settings - Fork 1
/
build-rom.sh
153 lines (148 loc) · 5.47 KB
/
build-rom.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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
#!/bin/bash
# Copyright (C) 2019-2020 lightvortex
#
# This guide is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This guide is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>
start=`date +%s`
echo //syncing//
repo sync -c -j$(nproc --all) --force-sync --no-clone-bundle --no-tags
echo //enable ccache//
export USE_CCACHE=1
ccache -M 50G
echo //build env setup//
virtualenv2 venv
source venv/bin/activate
. build/env*
while true; do
read -p "Do you wish to clean build?" yn
case $yn in
[Yy]* ) make clean; break;;
[Nn]* ) echo "Making Dirty Build"; break;;
* ) echo "Please answer yes or no.";;
esac
done
echo -e "Please enter a device"
echo "1)chiron"
echo "2)nx531j"
echo "3)both"
read -r device
if [[ $device -eq 1 ]]
then
echo //building chiron//
echo -e "Please enter a Version"
echo "1)non-gapps"
echo "2)gapps"
echo "3)both"
read -r gapps
if [[ $gapps -eq 1 ]]
then
echo //building chiron nongapps//
export WITH_GAPPS=false
brunch chiron
echo //build complete copying Non-gapps version//
mv /home/lightvortex/havoc/out/target/product/chiron/Havoc*.zip /run/media/lightvortex/Barracuda/
elif [[ $gapps -eq 2 ]]
then
echo //building gapps version//
export WITH_GAPPS=true && export TARGET_GAPPS_ARCH=arm64
brunch chiron
echo //build complete//
echo //copying//
mv /home/lightvortex/havoc/out/target/product/chiron/Havoc*.zip /run/media/lightvortex/Barracuda/
else
echo //building chiron nongapps//
export WITH_GAPPS=false
brunch chiron
echo //build complete copying Non-gapps version//
mv /home/lightvortex/havoc/out/target/product/chiron/Havoc*.zip /run/media/lightvortex/Barracuda/
echo //cleaning build//
make clean
echo //building gapps version//
export WITH_GAPPS=true && export TARGET_GAPPS_ARCH=arm64
brunch chiron
echo //build complete//
echo //copying//
mv /home/lightvortex/havoc/out/target/product/chiron/Havoc*.zip /run/media/lightvortex/Barracuda/
fi
elif [[ $device -eq 2 ]]
then
echo //building nx531j//
echo -e "Please enter a Version"
echo "1)non-gapps"
echo "2)gapps"
echo "3)both"
read -r gapps
if [[ $gapps -eq 1 ]]
then
echo //building nx531j nongapps//
export WITH_GAPPS=false
brunch nx531j
echo //build complete copying Non-gapps version//
mv /home/lightvortex/havoc/out/target/product/nx531j/Havoc*.zip /run/media/lightvortex/Barracuda/
elif [[ $gapps -eq 2 ]]
then
echo //building gapps version//
export WITH_GAPPS=true && export TARGET_GAPPS_ARCH=arm64
brunch nx531j
echo //build complete//
echo //copying//
mv /home/lightvortex/havoc/out/target/product/nx531j/Havoc*.zip /run/media/lightvortex/Barracuda/
else
echo //building nx531j nongapps//
export WITH_GAPPS=false
brunch nx531j
echo //build complete copying Non-gapps version//
mv /home/lightvortex/havoc/out/target/product/nx531j/Havoc*.zip /run/media/lightvortex/Barracuda/
echo //cleaning build//
make clean
echo //building gapps version//
export WITH_GAPPS=true && export TARGET_GAPPS_ARCH=arm64
brunch nx531j
echo //build complete//
echo //copying//
mv /home/lightvortex/havoc/out/target/product/nx531j/Havoc*.zip /run/media/lightvortex/Barracuda/
fi
else
echo //building both//
echo //building chiron nongapps//
export WITH_GAPPS=false && make clean
brunch chiron
echo //build complete copying Non-gapps version//
mv /home/lightvortex/havoc/out/target/product/chiron/Havoc*.zip /run/media/lightvortex/Barracuda/
echo //cleaning build//
make clean
echo //building chiron gapps version//
export WITH_GAPPS=true && export TARGET_GAPPS_ARCH=arm64
brunch chiron
echo //build complete//
echo //copying//
mv /home/lightvortex/havoc/out/target/product/chiron/Havoc*.zip /run/media/lightvortex/Barracuda/
make clean
echo //building nx531j//
echo //building nx531j nongapps//
export WITH_GAPPS=false && make clean
brunch nx531j
echo //build complete copying Non-gapps version//
mv /home/lightvortex/havoc/out/target/product/nx531j/Havoc*.zip /run/media/lightvortex/Barracuda/
echo //cleaning build//
make clean
echo //building nx531j gapps version//
export WITH_GAPPS=true && export TARGET_GAPPS_ARCH=arm64
brunch nx531j
echo //build complete//
echo //copying//
mv /home/lightvortex/havoc/out/target/product/nx531j/Havoc*.zip /run/media/lightvortex/Barracuda/
fi
end=`date +%s`
runtime=$((end-start))
echo "Time Taken $runtime"