-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquick-script.sh
executable file
·173 lines (150 loc) · 4.53 KB
/
quick-script.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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
#!/bin/bash
#
# EZ AOSP
#
# Written by Michael S Corigliano (@MikeCriggs on GitHub.com) (michael.s.corigliano@gmail.com)
#
# You can contribute to or fork this program here: https://github.com/mikecriggs/ez-aosp
#
#
# This software is licensed under the terms of the GNU General Public
# License version 2, as published by the Free Software Foundation, and
# may be copied, distributed, and modified under those terms.
#
# This program 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.
#
# Update mx
clear
echo -e "Updating mx..."
sleep 3
clear
sudo apt update -y
sudo apt upgrade -y
clear
echo -e "mx updated."
sleep 3
# Install packages required for building AOSP
clear
echo -e "Installing packages..."
sleep 3
clear
sudo apt install git-core python gnupg flex bison gperf libsdl1.2-dev libesd0-dev \
squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev openjdk-8-jre openjdk-8-jdk pngcrush \
schedtool libxml2 libxml2-utils xsltproc lzop libc6-dev schedtool g++-multilib lib32z1-dev lib32ncurses5-dev \
gcc-multilib liblz4-* pngquant ncurses-dev texinfo gcc gperf patch libtool \
automake g++ gawk subversion expat libexpat1-dev python-all-dev bc libcloog-isl-dev \
libcap-dev autoconf libgmp-dev build-essential gcc-multilib g++-multilib pkg-config libmpc-dev libmpfr-dev lzma* \
liblzma* w3m android-tools-adb maven ncftp htop chrpath whiptail diffstat cpio libssl-dev -y
clear
echo -e "Packages installed."
sleep 3
clear
# Install and configure JDK
# Install JDK
echo -e "Installing JDK 8..."
sleep 3
clear
sudo apt install openjdk-8-jdk -y
clear
sudo apt -f install -y
clear
sudo apt update -y
clear
echo -e "JDK installed."
sleep 2
# Configure JDK
clear
echo -e "Updating java alternative. If asked, please select the option best matching 'openjdk-8'. Do not use Oracle's JDK or any other version of OpenJDK except for 8."
sleep 5
clear
sudo update-alternatives --config java
sudo update-alternatives --config javac
clear
echo -e "JDK configured."
sleep 3
# Setup repo
clear
echo -e "Setting up repo tool..."
sleep 3
clear
mkdir -p ~/bin
PATH=~/bin:$PATH
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
sudo chmod a+x ~/bin/repo
clear
echo -e "Repo tool setup."
sleep 3
clear
# Setup GIT
# clear
# whiptail --title "EZ AOSP" --msgbox "We will now configure GIT" 15 70
#
# USERNAME=$(whiptail --inputbox --title "EZ AOSP" "What is your name?" 10 70 3>&1 1>&2 2>&3)
# exitstatus=$?
# if [ $exitstatus = 0 ]; then
# echo -e "Your GIT username will be set as '$USERNAME'"
# git config --global user.name "$USERNAME"
# sleep 3
# fi
# clear
#
# EMAIL=$(whiptail --inputbox --title "EZ AOSP" "What is your email?" 10 70 3>&1 1>&2 2>&3)
# exitstatus=$?
# if [ $exitstatus = 0 ]; then
# echo -e "Your GIT email will be set as '$EMAIL'"
# git config --global user.email "$EMAIL"
# sleep 3
# fi
# Configure GIT username
configureGitUsername () {
printf "We will now configure GIT\n\n"
sleep 3
printf "We now need to set a name for you to use GIT with\n\n"
read -p "Your name: " USERNAME
areYouSureUsername
}
# Are you sure about that username?
areYouSureUsername () {
read -p "Your GIT username will be set as $USERNAME. Is this correct? (y/n)" choice
case "$CHOICE" in
y|Y ) git config --global user.name "$USERNAME"; printf "GIT username set as $USERNAME\n\n"; sleep 3
;;
n|N ) configureGit2
;;
* ) echo "Invalid option"
;;
esac
}
# Configure GIT email
configureGitEmail () {
printf "We will now configure GIT\n\n"
sleep 3
printf "We now need to set an email for you to use GIT with\n\n"
read -p "Your email: " EMAIL
areYouSureEmail
}
# Are you sure about that email?
areYouSureEmail () {
read -p "Your GIT email will be set as $EMAIL. Is this correct? (y/n)" choice
case "$CHOICE" in
y|Y ) git config --global user.email "$EMAIL"; printf "GIT email will be set as $EMAIL\n\n"; sleep 3
;;
n|N ) configureGit2
;;
* ) echo "Invalid option"
;;
esac
}
# Run all GIT setup functions
configureGitUsername
areYouSureUsername
configureGitEmail
areYouSureEmail
# All done
clear
echo -e "Your build environment is ready to use! Refer to your ROM's README to get started syncing and compiling your source."
echo -e ""
echo -e ""