This tutorial will help you learn about building a custom ROM from source on Google Cloud.
Who this tutorial is for?
This tutorial is for those who want to build a custom ROM from source, but are unable to do that because of following reasons:
1. Low network speed
2. Limited bandwidth
3. Irregular power supply which obstructs the repo sync (yes, this is a reason in some countries )
What is needed for you to start with this thread?
1. A google account
2. A credit card – This is a must to start using Google Cloud Update: I read that people have successfully used debit cards as well.; so try your luck
With you card you can activate free trial and use Google Cloud without any charges for 12 months. Your card will be charged for $1 for verification purpose (and that’s it, the charges on my credit card got reversed in a day-
3. A PC with good (average will also do, I used 512 kbps connection) internet connection (to access Google Cloud, your bandwidth will not be used much).
4. Common sense (you should have it as you are reading this thread)
5. Willingness to read, search and ask right questions in right forums, communities
So, let’s start our journey!
Part – I
Activating Google Cloud FREE Trial
1. Go to Google Cloud website: https://cloud.google.com/ and click on Free Trial button
2. Login with your Google account username and password.
3. Click on SIGN UP FOR FREE TRIAL
Enter all the details and click on Accept and start free trial button
4. It will start your free trial and create first project for you
Congratulations! You have completed the most important Part – I of the process and you are now ready to setup the environment for building your ROM!
Update: Now the free trial validity is 1 year so more time to learn how to build the ROM
Part – II
Creating Virtual machine on Google Compute Engine
1. Click on the 2 lines menu displayed on the left top corner to bring on the Products and Services list on left side.
2. In this menu, click on Compute Engine
3. It’ll show following page, click on Create Instance button
4. On Create Instance page, specify the details like Name, Zone (if you want to change them). In Machine Type combo, select a machine configuration that you would like to have.
I use 4 cores and 15 GB memory
5. In Boot disk section, click on Change button.
6. On Boot disk details page, select the OS that you want to have on VM Instance. I always used Ubuntu 14.04 LTS (and it never let me down). Update: Now I use 16.04 LTS
Enter the size of disk. I used 500 GB so that I can sync 2-3 ROMs in the same VM Instance Then click on Select button.
Note: With this configuration I was able to clean build a ROM in around 70 minutes. The repo sync took around 25-30 minutes (which would have taken a week on my slow internet connection)
7. It’ll take you back to Create Instance page. Here you can specify the Firewall by checking both the check boxes. Finally click on Create button to create the VM Instance.
8. It’ll take a minute or two and create the VM instance. It’ll be in running state as indicated by the Green check box in front of the VM Name.
Note: You can start or stop the instance by selecting it and then clicking on stop or start button. It is advised to stop the VM instance once you are done with using it.
9. Click on the 3 dots menu near SSH and select option Open in browser window.
10. It’ll start the SSH connection to the VM Instance that you have created.
11. Run following command to get su
Now you are ready to install the required packages to build the ROM from source. You can follow this nice guide created by @jackeagle to start:
That was it!
Wish you all the best for building your first ROM