├── .gitignore ├── res ├── extras │ ├── update-ubuntu.sh │ ├── setup-repo-tool.sh │ ├── install-packages.sh │ └── configure-git.sh └── functions.cfg ├── README.md ├── ez-aosp.sh └── quick-script.sh /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | TODO.txt 3 | -------------------------------------------------------------------------------- /res/extras/update-ubuntu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # EZ AOSP: extra scripts 5 | # 6 | # Written by Michael S Corigliano (@MikeCriggs on GitHub.com) (michael.s.corigliano@gmail.com) 7 | # 8 | # You can contribute to or fork this program here: https://github.com/mikecriggs/ez-aosp 9 | # 10 | 11 | # Update Ubuntu 12 | echo -e "Updating Ubuntu..." 13 | echo -e "" 14 | echo -e "" 15 | sleep 3 16 | clear 17 | sudo apt update -y 18 | sudo apt upgrade -y 19 | clear 20 | echo -e "Finished updating Ubuntu." 21 | echo -e "" 22 | echo -e "" 23 | -------------------------------------------------------------------------------- /res/extras/setup-repo-tool.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # EZ AOSP: extra scripts 5 | # 6 | # Written by Michael S Corigliano (@MikeCriggs on GitHub.com) (michael.s.corigliano@gmail.com) 7 | # 8 | # You can contribute to or fork this program here: https://github.com/mikecriggs/ez-aosp 9 | # 10 | 11 | # Setup repo tool 12 | echo -e "Downloading and setting up the Google repo tool..." 13 | echo -e "" 14 | echo -e "" 15 | sleep 3 16 | mkdir -p ~/bin 17 | PATH=~/bin:$PATH 18 | curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo 19 | sudo chmod a+x ~/bin/repo 20 | clear 21 | echo -e "Finished setting up the Google repo tool." 22 | echo -e "" 23 | echo -e "" 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # EZ AOSP 2 | 3 | # PLEASE CONSIDER THIS ABANDONWARE! 4 | 5 | ### EZ AOSP is a simple automated and user input driven tool for Ubuntu Linux LTS 16.04+ for an easy setup of an AOSP (Android Open Source Project) build environment. It is entirely noob friendly and the code is written very simply so that users can understand, fork, edit, and contribute to it. ### 6 | 7 | ### NOTE: This is an automated tool. It is HIGHLY recommended that you learn how to setup a build environment manually. It's very easy and a guide for it can be found here: https://github.com/nathanchance/Android-Tools/blob/master/Guides/Building_AOSP.txt ### 8 | 9 | ### How to get it ### 10 | ```bash 11 | git clone git://github.com/mikecriggs/ez-aosp.git ez-aosp 12 | ``` 13 | 14 | ### How to use it ### 15 | ```bash 16 | cd ez-aosp 17 | ./ez-aosp.sh 18 | ``` 19 | ### For a quicker environment setup: ### 20 | ```bash 21 | cd ez-aosp 22 | ./quick-script.sh 23 | ``` 24 | 25 | ### You may use this tool or any part of it in any project without any permission. Just please retain the commit history (if possible), the GPL licence, and the proper credits in the comments at the top of each script. ### 26 | 27 | -------------------------------------------------------------------------------- /res/extras/install-packages.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # EZ AOSP: extra scripts 5 | # 6 | # Written by Michael S Corigliano (@MikeCriggs on GitHub.com) (michael.s.corigliano@gmail.com) 7 | # 8 | # You can contribute to or fork this program here: https://github.com/mikecriggs/ez-aosp 9 | # 10 | 11 | # Install needed packages for building the Android Open Source Project (AOSP) 12 | echo -e "Installing needed packages for building AOSP..." 13 | echo -e "" 14 | echo -e "" 15 | sleep 3 16 | clear 17 | 18 | sudo apt install git-core python gnupg flex bison gperf libsdl1.2-dev libesd0-dev \ 19 | squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev openjdk-8-jre openjdk-8-jdk pngcrush \ 20 | schedtool libxml2 libxml2-utils xsltproc lzop libc6-dev schedtool g++-multilib lib32z1-dev lib32ncurses5-dev \ 21 | gcc-multilib liblz4-* pngquant ncurses-dev texinfo gcc gperf patch libtool \ 22 | automake g++ gawk subversion expat libexpat1-dev python-all-dev bc libcloog-isl-dev \ 23 | libcap-dev autoconf libgmp-dev build-essential gcc-multilib g++-multilib pkg-config libmpc-dev libmpfr-dev lzma* \ 24 | liblzma* w3m android-tools-adb maven ncftp htop chrpath whiptail diffstat cpio libssl-dev -y 25 | 26 | echo -e "Installing finished." 27 | echo -e "" 28 | echo -e "" 29 | -------------------------------------------------------------------------------- /res/extras/configure-git.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # EZ AOSP: extra scripts 5 | # 6 | # Written by Michael S Corigliano (@MikeCriggs on GitHub.com) (michael.s.corigliano@gmail.com) 7 | # 8 | # You can contribute to or fork this program here: https://github.com/mikecriggs/ez-aosp 9 | # 10 | 11 | # Configure GIT (using whiptail) 12 | whiptail --title "EZ AOSP" --msgbox "We will now configure GIT" 15 70 13 | 14 | USERNAME=$(whiptail --inputbox --title "EZ AOSP" "What is your name?" 10 70 3>&1 1>&2 2>&3) 15 | exitstatus=$? 16 | if [ $exitstatus = 0 ]; then 17 | echo -e "Your GIT username will be set as '$USERNAME'" 18 | git config --global user.name "$USERNAME" 19 | sleep 3 20 | fi 21 | clear 22 | 23 | EMAIL=$(whiptail --inputbox --title "EZ AOSP" "What is your email?" 10 70 3>&1 1>&2 2>&3) 24 | exitstatus=$? 25 | if [ $exitstatus = 0 ]; then 26 | echo -e "Your GIT email will be set as '$EMAIL'" 27 | git config --global user.email "$EMAIL" 28 | sleep 3 29 | fi 30 | clear 31 | 32 | # Configure GIT without whiptail (WIP) 33 | # printf "We will now configure GIT\n\n" 34 | # sleep 3 35 | # clear 36 | # 37 | # Configure GIT username 38 | # configureGitUsername () { 39 | # printf "We now need to set a name for you to use GIT with\n\n" 40 | # read -p "Your name: " USERNAME 41 | # areYouSureUsername 42 | # } 43 | # 44 | # Are you sure about that username? 45 | # areYouSureUsername () { 46 | # read -p "Your GIT username will be set as $USERNAME. Is this correct? (y/n)" choice 47 | # case "$CHOICE" in 48 | # y|Y ) git config --global user.name "$USERNAME"; printf "GIT username set as $USERNAME\n\n"; sleep 3 49 | # ;; 50 | # n|N ) configureGitUsername 51 | # ;; 52 | # * ) echo "Invalid option" 53 | # ;; 54 | # esac 55 | # } 56 | # 57 | # Configure GIT email 58 | # configureGitEmail () { 59 | # printf "We now need to set an email for you to use GIT with\n\n" 60 | # read -p "Your email: " EMAIL 61 | # areYouSureEmail 62 | # } 63 | # 64 | # Are you sure about that email? 65 | # areYouSureEmail () { 66 | # read -p "Your GIT email will be set as $EMAIL. Is this correct? (y/n)" choice 67 | # case "$CHOICE" in 68 | # y|Y ) git config --global user.email "$EMAIL"; printf "GIT email will be set as $EMAIL\n\n"; sleep 3 69 | # ;; 70 | # n|N ) configureGitEmail 71 | # ;; 72 | # * ) echo "Invalid option" 73 | # ;; 74 | # esac 75 | # } 76 | # 77 | # Run all functions 78 | # configureGitUsername 79 | # areYouSureUsername 80 | # configureGitEmail 81 | # areYouSureEmail 82 | -------------------------------------------------------------------------------- /ez-aosp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # EZ AOSP 5 | # 6 | # Written by Michael S Corigliano (@MikeCriggs on GitHub.com) (michael.s.corigliano@gmail.com) 7 | # 8 | # You can contribute to or fork this program here: https://github.com/mikecriggs/ez-aosp 9 | # 10 | # 11 | # This software is licensed under the terms of the GNU General Public 12 | # License version 2, as published by the Free Software Foundation, and 13 | # may be copied, distributed, and modified under those terms. 14 | # 15 | # This program is distributed in the hope that it will be useful, 16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | # GNU General Public License for more details. 19 | # 20 | 21 | # Import functions 22 | . $PWD/res/functions.cfg 23 | 24 | # Install whiptail 25 | TXT="We need to install the package 'whiptail' in order to use the program. To cancel installation, press CTRL+C within the next 10 seconds." 26 | echoFun 27 | sleep 10 28 | 29 | clear 30 | TXT="Installing whiptail..." 31 | echoFun 32 | 33 | clear 34 | PKGS="whiptail" 35 | installFun 36 | clear 37 | 38 | # Title, authorship, social media 39 | whiptail --title "EZ AOSP" --msgbox "Written by Michael S Corigliano (Mike Criggs) \n\nEmail: michael.s.corigliano@gmail.com \nGitHub: github.com/mikecriggs\nGoogle+: google.com/+MichaelCorigliano \nTwitter: twitter.com/MikeCriggs" 15 70 40 | 41 | # EZ AOSP description 42 | whiptail --title "EZ AOSP" --msgbox "This tool is meant to help set up an AOSP (Android Open Source Project) build environment as painlessly and user-friendly as possible. By doing this, contributions to AOSP and custom aftermarket AOSP firmware, also known as 'custom ROMs' will be much easier to make. Please be aware that this program currently only supports Ubuntu 16.04 LTS. Other Ubuntu versions and Linux distributions will be added in the future. \n\nContributions to this program can be made here: github.com/mikecriggs/ez-aosp" 20 70 43 | 44 | # Continue? 45 | if (whiptail --title "EZ AOSP" --yesno "Would you like to start setting up the build environment?" 10 70) 46 | then 47 | TXT="Continuing with setup..." 48 | echoFun 49 | sleep 3 50 | else 51 | TXT="Exiting EZ AOSP..." 52 | echoFun 53 | sleep 5 54 | clear 55 | exit 56 | fi 57 | 58 | # Starting build environment setup 59 | TXT="Setting up build environment..." 60 | echoFun 61 | sleep 3 62 | 63 | # Update Ubuntu OS 64 | if (whiptail --yesno --title "EZ AOSP" "Would you like to update Ubuntu? If not, you can update this later with 'res/extras/update-ubuntu.sh'" 10 70) 65 | then 66 | updateUbuntu 67 | clear 68 | else 69 | TXT="Not updating Ubuntu...'" 70 | echoFun 71 | sleep 3 72 | clear 73 | fi 74 | 75 | # Install packages 76 | pkgsFun 77 | clear 78 | 79 | # Install and configure JDK (OpenJDK 8) 80 | jdkFun 81 | clear 82 | 83 | # Setup repo tool 84 | repoToolSetup 85 | clear 86 | 87 | # Configure GIT 88 | gitSetupWhiptail 89 | clear 90 | 91 | # Your build environment is ready to use! 92 | whiptail --title "EZ AOSP" --msgbox "Your build environment is ready to use! Refer to your ROM's README to get started syncing and compiling your source." 20 70 93 | -------------------------------------------------------------------------------- /res/functions.cfg: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # EZ AOSP 5 | # 6 | # Written by Michael S Corigliano (@MikeCriggs on GitHub.com) (michael.s.corigliano@gmail.com) 7 | # 8 | # You can contribute to or fork this program here: https://github.com/mikecriggs/ez-aosp 9 | # 10 | # 11 | # This software is licensed under the terms of the GNU General Public 12 | # License version 2, as published by the Free Software Foundation, and 13 | # may be copied, distributed, and modified under those terms. 14 | # 15 | # This program is distributed in the hope that it will be useful, 16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | # GNU General Public License for more details. 19 | # 20 | 21 | # Define colors for terminal output 22 | BLDRED="\033[1m""\033[31m" 23 | RST="\033[0m" 24 | 25 | # Define timestamp 26 | TIMESTAMP=$(date +"%Y-%m-%d-%S") 27 | 28 | # Echo 29 | echoFun () { 30 | echo -e ${BLDRED}"$TXT"${RST} 31 | echo -e "" 32 | echo -e "" 33 | } 34 | 35 | # Install 36 | installFun () { 37 | sudo apt install $PKGS -y 38 | } 39 | 40 | # Update Ubuntu 41 | updateUbuntu () { 42 | clear 43 | TXT="Updating Ubuntu..." 44 | echoFun 45 | sleep 3 46 | 47 | clear 48 | sudo apt update -y 49 | sudo apt upgrade -y 50 | 51 | clear 52 | TXT="Finished updating Ubuntu." 53 | echoFun 54 | sleep 3 55 | clear 56 | } 57 | 58 | # Install required packages for building AOSP 59 | pkgsFun () { 60 | whiptail --title "EZ AOSP" --yesno "Install required packages? If you skip this step, you can do it later by running 'res/extras/install-packages.sh'" 15 70 61 | 62 | PKGS="git-core python gnupg flex bison gperf libsdl1.2-dev libesd0-dev \ 63 | squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev openjdk-8-jre openjdk-8-jdk pngcrush \ 64 | schedtool libxml2 libxml2-utils xsltproc lzop libc6-dev schedtool g++-multilib lib32z1-dev lib32ncurses5-dev \ 65 | gcc-multilib liblz4-* pngquant ncurses-dev texinfo gcc gperf patch libtool \ 66 | automake g++ gawk subversion expat libexpat1-dev python-all-dev bc libcloog-isl-dev \ 67 | libcap-dev autoconf libgmp-dev build-essential gcc-multilib g++-multilib pkg-config libmpc-dev libmpfr-dev lzma* \ 68 | liblzma* w3m android-tools-adb maven ncftp htop chrpath whiptail diffstat cpio libssl-dev" 69 | installFun 70 | clear 71 | 72 | whiptail --title "EZ AOSP" --msgbox "Packages installed" 15 70 73 | clear 74 | } 75 | 76 | # Install and configure JDK 77 | jdkFun () { 78 | clear 79 | TXT="Installing and configuring JDK..." 80 | echoFun 81 | sleep 3 82 | 83 | clear 84 | PKGS="openjdk-8-jdk" 85 | installFun 86 | sudo apt -f install 87 | sudo apt update 88 | 89 | clear 90 | whiptail --msgbox --title "EZ AOSP" "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." 15 70 91 | 92 | clear 93 | sudo update-alternatives --config java 94 | 95 | clear 96 | whiptail --msgbox --title "EZ AOSP" "Updating javac 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." 15 70 97 | 98 | clear 99 | sudo update-alternatives --config javac 100 | 101 | clear 102 | whiptail --msgbox --title "EZ AOSP" "JDK installed and configured. \nIf during a build, you encounter version errors for Java, set its path as described here: \nhttps://source.android.com/source/building.html#wrong-java-version" 15 70 103 | clear 104 | } 105 | 106 | # Setup repo tool 107 | repoToolSetup () { 108 | TXT="Downloading and setting up the Google repo tool..." 109 | echoFun 110 | sleep 3 111 | 112 | clear 113 | mkdir -p ~/bin 114 | PATH=~/bin:$PATH 115 | curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo 116 | sudo chmod a+x ~/bin/repo 117 | clear 118 | } 119 | 120 | # Configure GIT (whiptail) 121 | gitSetupWhiptail () { 122 | whiptail --title "EZ AOSP" --msgbox "We will now configure GIT" 15 70 123 | 124 | clear 125 | USERNAME=$(whiptail --inputbox --title "EZ AOSP" "What is your name?" 10 70 3>&1 1>&2 2>&3) 126 | exitstatus=$? 127 | if [ $exitstatus = 0 ]; then 128 | TXT="Your GIT username will be set as '$USERNAME'" 129 | echoFun 130 | sleep 3 131 | clear 132 | git config --global user.name "$USERNAME" 133 | else 134 | TXT="Skipping GIT username input for now. You can set it later by running 'res/extras/configure-git.sh' script." 135 | echoFun 136 | sleep 3 137 | fi 138 | 139 | clear 140 | EMAIL=$(whiptail --inputbox --title "EZ AOSP" "What is your email?" 10 70 3>&1 1>&2 2>&3) 141 | exitstatus=$? 142 | if [ $exitstatus = 0 ]; then 143 | TXT="Your GIT email will be set as '$EMAIL'" 144 | echoFun 145 | sleep 3 146 | git config --global user.email "$EMAIL" 147 | clear 148 | else 149 | TXT="Skipping GIT email input for now. You can set it later by running 'res/extras/configure-git.sh'." 150 | echoFun 151 | sleep 3 152 | fi 153 | clear 154 | } 155 | -------------------------------------------------------------------------------- /quick-script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # EZ AOSP 5 | # 6 | # Written by Michael S Corigliano (@MikeCriggs on GitHub.com) (michael.s.corigliano@gmail.com) 7 | # 8 | # You can contribute to or fork this program here: https://github.com/mikecriggs/ez-aosp 9 | # 10 | # 11 | # This software is licensed under the terms of the GNU General Public 12 | # License version 2, as published by the Free Software Foundation, and 13 | # may be copied, distributed, and modified under those terms. 14 | # 15 | # This program is distributed in the hope that it will be useful, 16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | # GNU General Public License for more details. 19 | # 20 | 21 | # Update Ubuntu 22 | clear 23 | echo -e "Updating Ubuntu..." 24 | sleep 3 25 | clear 26 | 27 | sudo apt update -y 28 | sudo apt upgrade -y 29 | 30 | clear 31 | echo -e "Ubuntu updated." 32 | sleep 3 33 | 34 | # Install packages required for building AOSP 35 | clear 36 | echo -e "Installing packages..." 37 | sleep 3 38 | clear 39 | 40 | sudo apt install git-core python gnupg flex bison gperf libsdl1.2-dev libesd0-dev \ 41 | squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev openjdk-8-jre openjdk-8-jdk pngcrush \ 42 | schedtool libxml2 libxml2-utils xsltproc lzop libc6-dev schedtool g++-multilib lib32z1-dev lib32ncurses5-dev \ 43 | gcc-multilib liblz4-* pngquant ncurses-dev texinfo gcc gperf patch libtool \ 44 | automake g++ gawk subversion expat libexpat1-dev python-all-dev bc libcloog-isl-dev \ 45 | libcap-dev autoconf libgmp-dev build-essential gcc-multilib g++-multilib pkg-config libmpc-dev libmpfr-dev lzma* \ 46 | liblzma* w3m android-tools-adb maven ncftp htop chrpath whiptail diffstat cpio libssl-dev -y 47 | clear 48 | 49 | echo -e "Packages installed." 50 | sleep 3 51 | clear 52 | 53 | # Install and configure JDK 54 | # Install JDK 55 | echo -e "Installing JDK 8..." 56 | sleep 3 57 | 58 | clear 59 | sudo apt install openjdk-8-jdk -y 60 | clear 61 | sudo apt -f install -y 62 | clear 63 | sudo apt update -y 64 | 65 | clear 66 | echo -e "JDK installed." 67 | sleep 2 68 | 69 | # Configure JDK 70 | clear 71 | 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." 72 | sleep 5 73 | clear 74 | 75 | sudo update-alternatives --config java 76 | sudo update-alternatives --config javac 77 | 78 | clear 79 | echo -e "JDK configured." 80 | sleep 3 81 | 82 | # Setup repo 83 | clear 84 | echo -e "Setting up repo tool..." 85 | sleep 3 86 | clear 87 | 88 | mkdir -p ~/bin 89 | PATH=~/bin:$PATH 90 | curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo 91 | sudo chmod a+x ~/bin/repo 92 | clear 93 | 94 | echo -e "Repo tool setup." 95 | sleep 3 96 | clear 97 | 98 | # Setup GIT 99 | # clear 100 | # whiptail --title "EZ AOSP" --msgbox "We will now configure GIT" 15 70 101 | # 102 | # USERNAME=$(whiptail --inputbox --title "EZ AOSP" "What is your name?" 10 70 3>&1 1>&2 2>&3) 103 | # exitstatus=$? 104 | # if [ $exitstatus = 0 ]; then 105 | # echo -e "Your GIT username will be set as '$USERNAME'" 106 | # git config --global user.name "$USERNAME" 107 | # sleep 3 108 | # fi 109 | # clear 110 | # 111 | # EMAIL=$(whiptail --inputbox --title "EZ AOSP" "What is your email?" 10 70 3>&1 1>&2 2>&3) 112 | # exitstatus=$? 113 | # if [ $exitstatus = 0 ]; then 114 | # echo -e "Your GIT email will be set as '$EMAIL'" 115 | # git config --global user.email "$EMAIL" 116 | # sleep 3 117 | # fi 118 | 119 | # Configure GIT username 120 | configureGitUsername () { 121 | printf "We will now configure GIT\n\n" 122 | sleep 3 123 | printf "We now need to set a name for you to use GIT with\n\n" 124 | read -p "Your name: " USERNAME 125 | areYouSureUsername 126 | } 127 | 128 | # Are you sure about that username? 129 | areYouSureUsername () { 130 | read -p "Your GIT username will be set as $USERNAME. Is this correct? (y/n)" choice 131 | case "$CHOICE" in 132 | y|Y ) git config --global user.name "$USERNAME"; printf "GIT username set as $USERNAME\n\n"; sleep 3 133 | ;; 134 | n|N ) configureGit2 135 | ;; 136 | * ) echo "Invalid option" 137 | ;; 138 | esac 139 | } 140 | 141 | # Configure GIT email 142 | configureGitEmail () { 143 | printf "We will now configure GIT\n\n" 144 | sleep 3 145 | printf "We now need to set an email for you to use GIT with\n\n" 146 | read -p "Your email: " EMAIL 147 | areYouSureEmail 148 | } 149 | 150 | # Are you sure about that email? 151 | areYouSureEmail () { 152 | read -p "Your GIT email will be set as $EMAIL. Is this correct? (y/n)" choice 153 | case "$CHOICE" in 154 | y|Y ) git config --global user.email "$EMAIL"; printf "GIT email will be set as $EMAIL\n\n"; sleep 3 155 | ;; 156 | n|N ) configureGit2 157 | ;; 158 | * ) echo "Invalid option" 159 | ;; 160 | esac 161 | } 162 | 163 | # Run all GIT setup functions 164 | configureGitUsername 165 | areYouSureUsername 166 | configureGitEmail 167 | areYouSureEmail 168 | 169 | # All done 170 | clear 171 | echo -e "Your build environment is ready to use! Refer to your ROM's README to get started syncing and compiling your source." 172 | echo -e "" 173 | echo -e "" 174 | --------------------------------------------------------------------------------