├── README.md ├── build.sh ├── setup.sh └── setup_archlinux.sh /README.md: -------------------------------------------------------------------------------- 1 | # Resurrected Scripts 2 | Script used for building Resurrection Remix 3 | > Android M is the only supported version for Resurrected Scripts 4 | 5 | Module | Recommended Requirements 6 | -------:|:------------------------- 7 | CPU | 64bit CPU with at least 2 cores 8 | GPU | Not applicable 9 | Memory | 4GB RAM 10 | Storage | 150GB HDD 11 | Internet| Anything decent, the more the better, you have to download ~20GB 12 | Display | Not applicable 13 | OS | x64 Linux based OS* [This guide works for ubuntu/debian/mint/others with aptitude as package manager][Will add Arch Linux Script soon] 14 | 15 | \* Currently tested on: **Linux Mint 17.3**, **Ubuntu 14.04 LTS** 16 | 17 | Sections | Estimated Time 18 | ------------:|:------------------------- 19 | Install | < 1 hour 20 | Download | Depends on net connection. 100mbit/s+ (~40 Minutes), 5mbit/s (6-8 hours) 21 | Building | Depends on PC specifications 22 | 23 | - If you're looking to upgrade your computer for better build times, consider these few pointers: 24 | 1. Better CPU: A processor with more powerful Single Core processing can process code faster. We recommend getting intel CPUs as they are better in that aspect. Anything higher than the i5-3570 can build in <2 hours 25 | 2. SSD or HDD with higher RPM: This allows faster R/W Speeds and results in faster build times. Its better to always get more drives such that there is less stress on the drive and theres more data flow per SATA connector 26 | 3. Bigger RAM: More RAM allows more instructions to be sent over to the CPU and will allow the CPU to be more efficient. It also helps if you want to use applications whilst building and not ressult in build failures caused by insufficient memory 27 | 4. Faster Internet: Nowadays internet connections are around 2mbps+ There is not a need to upgrade your internet that quick. If you have a tendency of re-downloading the full source code or downloading source code for other ROMs, consider a faster internet connection. 28 | 29 | ## How to build with Resurreected Scripts: 30 | Simply run the setup script to get your PC ready 31 | ``` 32 | cd ~/ 33 | git clone git://github.com/ResurrectionRemix/ResurrectedScripts.git -b marshmallow scripts 34 | cd scripts 35 | ./setup.sh 36 | ``` 37 | After setting up, cd to the source code folder directory and run the build script 38 | ``` 39 | cd [Default is /home/username/rr] 40 | bash build.sh 41 | ``` 42 | The build script will then prompt you for your device codename you wish to build, incase you didn't pass it as a parameter 43 | For Example; Hammerhead, Huashan 44 | Once you have input the device codename, RR will start building for your device. 45 | It will either fail and require you to fix the errors, or it will be successful. 46 | 47 | If the build was successful, the zip file will be located in: 48 | ``` 49 | /out/target/product//ResurrectionRemix-M---.zip 50 | ``` 51 | 52 | ### Tips and Tricks 53 | 1. Use Screen 54 | When you build RR, you might get disconnected from your SSH session or someone may close your Terminal Session. By using screen, RR will continue 55 | building in the background regardless if your SSH or terminal session is closed unexpectedly. To open a screen session type; 56 | ``` 57 | screen -S android 58 | ``` 59 | To diconnect a screen session, press CTRL+A+D. 60 | To connect to screen session; 61 | ``` 62 | screen -R android 63 | ``` 64 | To connect to a session that has closed unexpectedly; 65 | ``` 66 | screen -D -R android 67 | ``` 68 | To close a screen session; 69 | ``` 70 | screen -X -S android kill 71 | ``` 72 | To list screen sessions; 73 | ``` 74 | screen -ls 75 | ``` 76 | To learn more about screen and how it can help you, visit: https://www.rackaid.com/blog/linux-screen-tutorial-and-how-to/ or http://www.computerhope.com/unix/screen.htm 77 | 78 | 2. Store your builds in a seperate drive for faster compilation 79 | This results in the Read and Write operations to run simultaneously. Hard Drives benefit from this as it places less stress on the drive head. 80 | Generall, all SATA drives benefit as data can only be transferred in one direction at the same time frames. More SATA ports mean more lanes for 81 | data to flow. 82 | 83 | To do so, you will need to find where your 2nd drive is mounted in Linux. 84 | Assuming your 2nd drive is mounted at /disk2, add this to your .bashrc or other similar file 85 | ``` 86 | export OUT_DIR_COMMON_BASE=/out 87 | ``` 88 | Make sure your user has write permissions to that of course. 89 | 90 | Instead of the old build output, it will be here instead: 91 | /out//target/product//ResurrectionRemix-M-(version)-(date)-(device-codename).zip 92 | 93 | 3. Store CCache in a seperate drive for faster compilation 94 | The explanation here is similar to the previous trick although CCache is a bunch of compiled data that will be frequently accessed by the build 95 | generator to cut down build times. By placing CCache in a seperate directory, again, the data will be accessed faster and more efficiently. 96 | ``` 97 | export CCACHE_DIR=/disk3 98 | ``` 99 | Your ccache will be stored in there then. If you want to clear the ccache, just simply delete the folder 100 | 101 | #### How to make unofficial builds Official 102 | Incase you are building an unofficial build, and want to make it official, feel free to contact one of the team members 103 | [you can find them in the Google+ community]. Namely, Atlan KRK, Varun Date and Akhil Narang, Brian Koluch, Andres Pascual 104 | Enjoy! :D 105 | 106 | ##### Links 107 | 1. Resurrection Remix Community: https://plus.google.com/communities/109352646351468373340 108 | 2. Resurrection Remix Source Code: https://github.com/ResurrectionRemix 109 | 3. Resurrection Remix Device Code: https://github.com/ResurrectionRemix-Devices 110 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Make sure you're in rr source dir 4 | [ -d ".repo" ] || exit 1 5 | # Specify colors utilized in the terminal 6 | normal='tput sgr0' # White 7 | red='tput setaf 1' # Red 8 | green='tput setaf 2' # Green 9 | yellow='tput setaf 3' # Yellow 10 | blue='tput setaf 4' # Blue 11 | violet='tput setaf 5' # Violet 12 | cyan='tput setaf 6' # Cyan 13 | white='tput setaf 7' # White 14 | txtbld=$(tput bold) # Bold 15 | bldred=${txtbld}$(tput setaf 1) # Bold Red 16 | bldgrn=${txtbld}$(tput setaf 2) # Bold Green 17 | bldblu=${txtbld}$(tput setaf 4) # Bold Blue 18 | bldylw=$(txtbld)$(tput setaf 3) # Bold Yellow 19 | bldvlt=${txtbld}$(tput setaf 5) # Bold Violet 20 | bldcya=${txtbld}$(tput setaf 6) # Bold Cyan 21 | bldwht=${txtbld}$(tput setaf 7) # Bold White 22 | 23 | clear 24 | echo -e "${bldred} ___ ___ " 25 | echo -e "${bldred} / /\ / /\ " 26 | echo -e "${bldred} / /::\ / /::\ " 27 | echo -e "${bldred} / /:/\:\ / /:/\:\ " 28 | echo -e "${bldred} / /:/~/:/ / /:/~/:/ " 29 | echo -e "${bldred} /__/:/ /:/___/__/:/ /:/___" 30 | echo -e "${bldred} \ \:\/:::::/\ \:\/:::::/" 31 | echo -e "${bldred} \ \::/~~~~ \ \::/~~~~ " 32 | echo -e "${bldred} \ \:\ \ \:\ " 33 | echo -e "${bldred} \ \:\ \ \:\ " 34 | echo -e "${bldred} \__\/ \__\/ " 35 | echo -e "${bldred} " 36 | echo -e "${bldred} RESURRECTION REMIX OS " 37 | echo -e "${bldred} " 38 | echo -e "${bldred} M A R S H M A L L O W " 39 | echo -e "${bldred} " 40 | echo -e "${bldcya} Building RR! " 41 | tput setaf 3 42 | sleep 1 43 | echo 44 | echo Setting up Build Environment... 45 | echo 46 | sleep 2 47 | tput setaf 2 48 | source build/envsetup.sh 49 | tput setaf 3 50 | echo 51 | if [ ! $1 ]; 52 | then 53 | echo What is your device code name? 54 | tput setaf 4 55 | read device 56 | else 57 | device=$1 58 | fi 59 | tput setaf 3 60 | echo -e "You have chosen to build ResurrectionRemix OS for ${bldred} ${device}" 61 | echo 62 | echo -e "${bldvlt}Building Resurrection Remix OS now!" 63 | echo 64 | sleep 3 65 | tput setaf 2 66 | logfile="$device-$(date +%Y%m%d).log" 67 | lunch cm_$device-userdebug && time mka bacon 2>&1 | tee $logfile 68 | if [ $? -eq 0 ]; then 69 | printf "Build Suceeded, grab your zip at $(ls ${OUT}/R*.zip)\nBuild log is at ${logfile} incase you need it\n"; 70 | else 71 | printf "Build failed, check the log at ${logfile}\n"; 72 | exit 1; 73 | fi 74 | -------------------------------------------------------------------------------- /setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Specify colors utilized in the terminal 3 | normal='tput sgr0' # White 4 | red='tput setaf 1' # Red 5 | green='tput setaf 2' # Green 6 | yellow='tput setaf 3' # Yellow 7 | blue='tput setaf 4' # Blue 8 | violet='tput setaf 5' # Violet 9 | cyan='tput setaf 6' # Cyan 10 | white='tput setaf 7' # White 11 | txtbld=$(tput bold) # Bold 12 | bldred=${txtbld}$(tput setaf 1) # Bold Red 13 | bldgrn=${txtbld}$(tput setaf 2) # Bold Green 14 | bldblu=${txtbld}$(tput setaf 4) # Bold Blue 15 | bldylw=$(txtbld)$(tput setaf 3) # Bold Yellow 16 | bldvlt=${txtbld}$(tput setaf 5) # Bold Violet 17 | bldcya=${txtbld}$(tput setaf 6) # Bold Cyan 18 | bldwht=${txtbld}$(tput setaf 7) # Bold White 19 | 20 | clear 21 | echo -e "${bldred} ___ ___ " 22 | echo -e "${bldred} / /\ / /\ " 23 | echo -e "${bldred} / /::\ / /::\ " 24 | echo -e "${bldred} / /:/\:\ / /:/\:\ " 25 | echo -e "${bldred} / /:/~/:/ / /:/~/:/ " 26 | echo -e "${bldred} /__/:/ /:/___/__/:/ /:/___" 27 | echo -e "${bldred} \ \:\/:::::/\ \:\/:::::/" 28 | echo -e "${bldred} \ \::/~~~~ \ \::/~~~~ " 29 | echo -e "${bldred} \ \:\ \ \:\ " 30 | echo -e "${bldred} \ \:\ \ \:\ " 31 | echo -e "${bldred} \__\/ \__\/ " 32 | echo -e "${bldred} " 33 | echo -e "${bldred} RESURRECTION REMIX OS " 34 | echo -e "${bldred} " 35 | echo -e "${bldred} M A R S H M A L L O W " 36 | echo -e "${bldred} " 37 | echo -e "${bldcya} Setting up your computer! " 38 | 39 | tput setaf 3 40 | sleep 1 41 | echo 42 | echo Updating Package Lists... 43 | echo 44 | sleep 3 45 | tput setaf 2 46 | time sudo apt-get update 47 | tput setaf 3 48 | echo 49 | echo Installing necessary dependencies... 50 | echo 51 | sleep 3 52 | tput setaf 2 53 | time sudo apt-get -y install git-core python gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.8-dev \ 54 | squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev openjdk-7-jre openjdk-7-jdk pngcrush \ 55 | schedtool libxml2 libxml2-utils xsltproc lzop libc6-dev g++-multilib lib32z1-dev lib32ncurses5-dev \ 56 | lib32readline-gplv2-dev gcc-multilib liblz4-* pngquant ncurses-dev texinfo gcc patch libtool \ 57 | automake g++ gawk subversion expat libexpat1-dev python-all-dev binutils-static libgcc1:i386 bc libcloog-isl-dev \ 58 | libcap-dev autoconf libgmp-dev pkg-config libmpc-dev libmpfr-dev lzma* \ 59 | liblzma* w3m phablet-tools android-tools-adb screen maven tmux 60 | tput setaf 3 61 | echo 62 | echo Settings up USB Ports... 63 | echo 64 | sleep 3 65 | tput setaf 2 66 | sudo curl --create-dirs -L -o /etc/udev/rules.d/51-android.rules -O -L https://raw.githubusercontent.com/snowdream/51-android/master/51-android.rules 67 | sudo chmod 644 /etc/udev/rules.d/51-android.rules 68 | sudo chown root /etc/udev/rules.d/51-android.rules 69 | sudo service udev restart 70 | adb kill-server 71 | sudo killall adb 72 | tput setaf 3 73 | echo 74 | echo Setting up ccache 75 | echo 76 | tput setaf 2 77 | git clone https://git.samba.org/ccache.git 78 | cd ccache 79 | ./autogen.sh 80 | ./configure 81 | make 82 | sudo cp -v ./ccache /usr/bin/ccache 83 | echo "export USE_CCACHE=1" >> ${HOME}/.bashrc 84 | echo 85 | tput setaf 3 86 | echo Downloading repo tool, if already present will update to the latest version... 87 | tput setaf 2 88 | cd .. 89 | echo 90 | sleep 2 91 | mkdir -p ~/bin 92 | PATH=~/bin:$PATH 93 | curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo 94 | chmod a+x ~/bin/repo 95 | clear 96 | tput setaf 3 97 | echo 98 | echo -e "${bldcya}Your computer is now ready for building! " 99 | echo 100 | sleep 5 101 | tput setaf 2 102 | clear 103 | echo -e "${bldred} ___ ___ " 104 | echo -e "${bldred} / /\ / /\ " 105 | echo -e "${bldred} / /::\ / /::\ " 106 | echo -e "${bldred} / /:/\:\ / /:/\:\ " 107 | echo -e "${bldred} / /:/~/:/ / /:/~/:/ " 108 | echo -e "${bldred} /__/:/ /:/___/__/:/ /:/___" 109 | echo -e "${bldred} \ \:\/:::::/\ \:\/:::::/" 110 | echo -e "${bldred} \ \::/~~~~ \ \::/~~~~ " 111 | echo -e "${bldred} \ \:\ \ \:\ " 112 | echo -e "${bldred} \ \:\ \ \:\ " 113 | echo -e "${bldred} \__\/ \__\/ " 114 | echo -e "${bldred} " 115 | echo -e "${bldred} RESURRECTION REMIX OS " 116 | echo -e "${bldred} " 117 | echo -e "${bldred} M A R S H M A L L O W " 118 | echo -e "${bldred} " 119 | echo -e "${bldcya} Downloading Source Code! " 120 | echo 121 | sleep 2 122 | tput setaf 3 123 | echo -e "${bldcya}Enter the path where source code should be downloaded in full format.\nDefault is ${HOME}/rr" 124 | read rrpath 125 | tput setaf 2 126 | mkdir -p $rrpath 127 | cp build.sh $rrpath/build.sh 128 | cd $rrpath 129 | echo 130 | repo init -u git://github.com/ResurrectionRemix/platform_manifest.git -b marshmallow 131 | time repo sync --force-broken --force-sync --no-clone-bundle --quiet 132 | echo 133 | echo 134 | echo -e "${bldcya}The RR Source Code has been downloaded into ${rrpath}" 135 | echo -e "${bldcya}You can now run the build script in ${rrpath}" 136 | echo -e "${bldcya}Please remember to run ccache -M 40 to set 40gb of ccache, before you start your first build :D" 137 | echo -e "${bldcya}This value can be shifted up/down a bit to your liking" 138 | cd $rrpath 139 | exit 140 | -------------------------------------------------------------------------------- /setup_archlinux.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Specify colors utilized in the terminal 3 | normal='tput sgr0' # White 4 | red='tput setaf 1' # Red 5 | green='tput setaf 2' # Green 6 | yellow='tput setaf 3' # Yellow 7 | blue='tput setaf 4' # Blue 8 | violet='tput setaf 5' # Violet 9 | cyan='tput setaf 6' # Cyan 10 | white='tput setaf 7' # White 11 | txtbld=$(tput bold) # Bold 12 | bldred=${txtbld}$(tput setaf 1) # Bold Red 13 | bldgrn=${txtbld}$(tput setaf 2) # Bold Green 14 | bldblu=${txtbld}$(tput setaf 4) # Bold Blue 15 | bldylw=$(txtbld)$(tput setaf 3) # Bold Yellow 16 | bldvlt=${txtbld}$(tput setaf 5) # Bold Violet 17 | bldcya=${txtbld}$(tput setaf 6) # Bold Cyan 18 | bldwht=${txtbld}$(tput setaf 7) # Bold White 19 | 20 | clear 21 | echo -e "${bldred} ___ ___ " 22 | echo -e "${bldred} / /\ / /\ " 23 | echo -e "${bldred} / /::\ / /::\ " 24 | echo -e "${bldred} / /:/\:\ / /:/\:\ " 25 | echo -e "${bldred} / /:/~/:/ / /:/~/:/ " 26 | echo -e "${bldred} /__/:/ /:/___/__/:/ /:/___" 27 | echo -e "${bldred} \ \:\/:::::/\ \:\/:::::/" 28 | echo -e "${bldred} \ \::/~~~~ \ \::/~~~~ " 29 | echo -e "${bldred} \ \:\ \ \:\ " 30 | echo -e "${bldred} \ \:\ \ \:\ " 31 | echo -e "${bldred} \__\/ \__\/ " 32 | echo -e "${bldred} " 33 | echo -e "${bldred} RESURRECTION REMIX OS " 34 | echo -e "${bldred} " 35 | echo -e "${bldred} M A R S H M A L L O W " 36 | echo -e "${bldred} " 37 | echo -e "${bldcya} Setting up your computer! " 38 | 39 | tput setaf 3 40 | sleep 1 41 | echo 42 | echo Updating Package Lists... 43 | echo 44 | sleep 3 45 | tput setaf 2 46 | time sudo pacman -Sy && sudo pacman -Syu 47 | tput setaf 3 48 | echo 49 | echo Installing Yaourt for unofficial Packages... 50 | echo 51 | sleep 3 52 | tput setaf 2 53 | # installing yaourt and dependency package-query 54 | curl -O https://aur.archlinux.org/cgit/aur.git/snapshot/package-query.tar.gz 55 | tar -xvzf package-query.tar.gz 56 | cd package-query 57 | makepkg -si 58 | # download and install yaourt 59 | cd .. 60 | curl -O https://aur.archlinux.org/cgit/aur.git/snapshot/yaourt.tar.gz 61 | tar -xvzf yaourt.tar.gz 62 | cd yaourt 63 | makepkg -si 64 | # clean up 65 | cd .. 66 | rm -r yaourt 67 | rm -r package-query 68 | rm -r yaourt.tar.gz 69 | rm -r package-query.tar.gz 70 | # yaourt installed 71 | tput setaf 2 72 | time yaourt -S android-sdk-platform-tools gnupg flex bison gperf git zip pngcrush curl lz4 \ 73 | squashfs-tools schedtool lzop binutils texinfo haskell-yaml coreutils gtkmm3 gtkmm \ 74 | util-linux maven readline lib32-readline liburcu pngquant patch patchutils \ 75 | libtool automake gawk subversion bc cloog autoconf pkg-config w3m phablet-tools screen tmux \ 76 | python python-sip python2 python2-appdirs python2-notify python2-packaging python2-protobuf \ 77 | python2-psutil python2-virtualenv sip python2-distutils-extra python2-setuptools \ 78 | ncurses ncurses5-compat-libs lib32-ncurses lib32-ncurses5-compat-libs sdl sdl2 lib32-libtinfo \ 79 | libtinfo wxgtk wxgtk2.8 libcurl-compat zlib perl lib32-zlib libxml++ libxml2 lib32-libxml2 perl-xml-libxml \ 80 | expat lib32-expat libxslt glibc lib32-glibc aarch64-linux-gnu-glibc libconfig \ 81 | gcc-multilib gcc-libs-multilib webkit2gtk lib32-gcc-libs libvirt glib2 \ 82 | libcap lib32-libcap libgccjit libgmpris libmpc lib32-xz lrzip xz \ 83 | jdk7-openjdk jre7-openjdk jre8-openjdk jdk8-openjdk 84 | tput setaf 3 85 | echo 86 | echo Settings up USB Ports... 87 | echo 88 | sleep 3 89 | tput setaf 2 90 | sudo curl --create-dirs -L -o /etc/udev/rules.d/51-android.rules -O -L https://raw.githubusercontent.com/snowdream/51-android/master/51-android.rules 91 | sudo chmod 644 /etc/udev/rules.d/51-android.rules 92 | sudo chown root /etc/udev/rules.d/51-android.rules 93 | sudo service udev restart 94 | adb kill-server 95 | sudo killall adb 96 | tput setaf 3 97 | echo 98 | echo Setting up ccache 99 | echo 100 | tput setaf 2 101 | git clone https://git.samba.org/ccache.git 102 | cd ccache 103 | ./autogen.sh 104 | ./configure 105 | make 106 | sudo cp -v ./ccache /usr/bin/ccache 107 | echo "export USE_CCACHE=1" >> ${HOME}/.bashrc 108 | echo 109 | tput setaf 3 110 | echo Downloading repo tool, if already present will update to the latest version... 111 | tput setaf 2 112 | cd .. 113 | echo 114 | sleep 2 115 | mkdir -p ~/bin 116 | PATH=~/bin:$PATH 117 | curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo 118 | chmod a+x ~/bin/repo 119 | clear 120 | tput setaf 3 121 | echo 122 | echo -e "${bldcya}Your computer is now ready for building! " 123 | echo 124 | sleep 5 125 | tput setaf 2 126 | clear 127 | echo -e "${bldred} ___ ___ " 128 | echo -e "${bldred} / /\ / /\ " 129 | echo -e "${bldred} / /::\ / /::\ " 130 | echo -e "${bldred} / /:/\:\ / /:/\:\ " 131 | echo -e "${bldred} / /:/~/:/ / /:/~/:/ " 132 | echo -e "${bldred} /__/:/ /:/___/__/:/ /:/___" 133 | echo -e "${bldred} \ \:\/:::::/\ \:\/:::::/" 134 | echo -e "${bldred} \ \::/~~~~ \ \::/~~~~ " 135 | echo -e "${bldred} \ \:\ \ \:\ " 136 | echo -e "${bldred} \ \:\ \ \:\ " 137 | echo -e "${bldred} \__\/ \__\/ " 138 | echo -e "${bldred} " 139 | echo -e "${bldred} RESURRECTION REMIX OS " 140 | echo -e "${bldred} " 141 | echo -e "${bldred} M A R S H M A L L O W " 142 | echo -e "${bldred} " 143 | echo -e "${bldcya} Downloading Source Code! " 144 | echo 145 | sleep 2 146 | tput setaf 3 147 | echo -e "${bldcya}Enter the path where source code should be downloaded in full format.\nDefault is ${HOME}/rr" 148 | read rrpath 149 | tput setaf 2 150 | mkdir -p $rrpath 151 | cp build.sh $rrpath/build.sh 152 | cd $rrpath 153 | echo 154 | repo init -u git://github.com/ResurrectionRemix/platform_manifest.git -b marshmallow 155 | time repo sync --force-broken --force-sync --no-clone-bundle --quiet 156 | echo 157 | echo 158 | echo -e "${bldcya}The RR Source Code has been downloaded into ${rrpath}" 159 | echo -e "${bldcya}You can now run the build script in ${rrpath}" 160 | echo -e "${bldcya}Please remember to run ccache -M 40 to set 40gb of ccache, before you start your first build :D" 161 | echo -e "${bldcya}This value can be shifted up/down a bit to your liking" 162 | cd $rrpath 163 | exit 164 | --------------------------------------------------------------------------------