-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-carbon.sh
executable file
·122 lines (94 loc) · 3.05 KB
/
build-carbon.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
# Android Compiling Script
#
# This script automates the process of compiling android
# operating system.
#
# Copyright (C) 2014 Shubhang Rathore
#
# This script is specifically for
# Carbon Kitkat ROM
# Get time at the start of the build
res1=$(date +%s.%N)
# Clear screen
clear
# Patches
# Put the *.patch or *.diff file in the base folder of each indivisual repo
# where the patches need to applied
echo -e ""
echo -e "#######################################"
echo -e "# #"
echo -e "# APPLYING PATCHES #"
echo -e "# #"
echo -e "#######################################"
echo -e ""
# Using a different script to appy ptaches
./patches/apply-patches.sh
echo -e ""
echo -e "#######################################"
echo -e "# #"
echo -e "# PATCHING CHROMIUM #"
echo -e "# #"
echo -e "#######################################"
echo -e ""
cd external/chromium_org/
repo sync .
git am 0*
cd ../../
# Review the aove patch merges before continuing.
# If any errors, resolve them before moving ahead with the
# compilation of the ROM.
echo -e ""
echo -e "#######################################"
echo -e "# #"
echo -e "# PATCHING COMPLETE #"
echo -e "# #"
echo -e "# REVIEW & CHECK FOR ERRORS #"
echo -e "# #"
echo -e "#######################################"
echo -e ""
echo -e ""
echo -e "#######################################"
echo -e "# #"
echo -e "# PRESS ENTER TO CONTINUE #"
echo -e "# #"
echo -e "#######################################"
echo -e ""
read -p
echo -e ""
# Clear screen
clear
echo -e ""
echo -e "#######################################"
echo -e "# #"
echo -e "# BUILD ENVIRONMENT #"
echo -e "# #"
echo -e "#######################################"
echo -e ""
# Setup environment
. build/envsetup.sh
echo -e ""
echo -e "#######################################"
echo -e "# #"
echo -e "# LUNCHING DEVICE #"
echo -e "# #"
echo -e "#######################################"
echo -e ""
# Lunch device
lunch carbon_i9082-userdebug
echo -e ""
echo -e "#######################################"
echo -e "# #"
echo -e "# COMPILING #"
echo -e "# #"
echo -e "#######################################"
echo -e ""
# Start compilation
make carbon -j4
echo -e ""
###### END OF BUILD ######
# Get elapsed time
res2=$(date +%s.%N)
echo "${bldgrn}Total time elapsed: ${txtrst}${grn}$(echo "($res2 - $res1) / 60"|bc ) minutes ($(echo "$res2 - $res1"|bc ) seconds) ${txtrst}"
# Sleep the laptop
sleep 60
~/suspend-laptop.sh