Let me explain the process of how to flash lineage official OTA on the MiA1. The reason why this needs a separate post is because it is slightly complicated and the chances of failure are high. The process of flashing the lineage ROM on the MiA1 has changed now that we have a signed Over the Air (OTA) ROM coming in every week on Tuesday.
I am assuming that you have a basic understanding about flashing ROM’s and understand why custom ROM’s are flashed. I am also assuming you know about platform tools like adb and fastboot and have a working adb and fastboot on your PC.
WARNING: As always remember there is a good chance that the process of flashing custom ROM’s can seriously damage your phone and even permanently brick it i.e. render it useless. You have been warned and are doing so at your own risk.
Now that we are done with the warning lets start flashing.
Before you proceed download these files. Downloads:
Please note these files are available either from this web site or you can search for them on the web and download them from their original sites. I leave the option to you. The point is you would need these files to continue with the task at hand.
Copy required files Copy the boot recovery image file into the folder where you installed adb on your PC.
Copy the remaining files on to your phone. These files are Lineage ROM for 10 July + Mind the Gaps + TWRP installer.
Copy them into the download folder on your phone. You can either use the PC or try it through adb push is you are comfortable with that.
The command for an adb push would be as under
adb push TWRP-installer-3.2.1-with-Tissot-Manager-2.3.zip /Downloads
adb push <complete file name to be pushed including extension> /<destination>
Coming from Stock MiA1 ROM follow the steps given below. These steps should be the same even if you are coming from other unofficial version of the Lineage ROM and want to install the official lineage ROM.
Step 1. Boot phone into fastboot mode
From a PC which has adb and the correct drivers installed type the above command to boot the phone into the fastboot mode. This is the mode where you get the picture of a bunny wearing the Chinese army hat!
Alternately you can also switch off the phone. Press and hold volume – and power button and keep holding till you feel it vibrate. This should happen in 1-2 seconds. Then release. The bunny in the hat should be on your screen now!
Step 2 : From the folder where you have installed adb and copied the Boot recovery image type the below command in the console. fastboot boot boot-recovery.img
Within 2-3 seconds the boot image will be hot booted on you phone and you should be in the TWRP screen.
Step 3. Wipe cache, data and system
Step 4. Flash the Lineage Official ROM for July 10. This is a slightly weird step required because flashing the latest ROM directly will give you an signature verification error!!!
Hope this error is fixed in later versions of the ROM.
Step 5. Flash the TWRP installer .
This TWRP is by CosmicDan and specifically create for the Tissot. Please note the TWRP screen will give you very detailed instructions at each stage of the installation. Read it carefully. In spite of all the help on this page or the Lineage web sites the setup may still fail in some cases. That is where the messages on the TWRP screen would come in handy. Read the messages and you would be able to resolve most of the issue on your own.
Step 6. Reboot Recovery. This is a required step
Step 7. Flash Magisk 16.6
Step 8. Flash Mind the gapps
Step 9. Reboot System
Once you have the ROM up and running. Go to System >> About phone >> Tap the build number 7 times and you will be into developer mode. Enable USB debugging and Advance restart. If you are not familiar with these steps click here for details
This is just in case you are stuck again and need to recover your phone then it would be helpful to have USB debugging enabled on your phone to allow access through adb from your PC.
Now remember you are in the July 19 version of the ROM.
To get the latest OTA update
Go to System >> About Phone >> LineageOS updates and click to download the latest build for your phone.
This is a painfully slow download so have patience and relax.
The download from the lineage web site can take hours. It took about 4 hours on my phone that too on a 10 MB internet WiFi connection!
Once the download is complete install the build . This will also take some time.
When the build is finally installed, you can check the results in settings.
The latest ROM released on the Tuesday of the current week should be showing up.
Here there is an important thing to note. Once the new ROM is installed it will wipe out your magisk and TWRP installation .
Mind the Gapps will work seamlessly.
Flash TWRP and magisk again if you need them.
As the title mentions, this is a guide by a noob which spells out the steps that build a lineage ROM. What the title does not mention is that this article is aimed at noobs as well. Now lets get down to business.
Disclaimer: Please note that by following the steps as mentioned in this article you can seriously damage your smart phone. There is a good chance your phone would be bricked i.e. effectively be rendered useless and cause a lot of frustration, irritation and make you pull at your hair. If you hit that point later, Please do not look towards me to save you since I am also new to this and like you learning how to traverse this parallel universe of custom ROM development. That being said do not despair. As the saying goes browse and you shall find – Check out the internet and you would find others who have messed up their smartphones and yet somehow lived to tell the tale. In most cases you would be able to revive your phone. Ideally do not use your daily driver for such experimentation.
After reading all this if still want to go ahead then read on.
Build a custom lineage ROM for your smart phone. I own a Xiaomi MiA1 and used the same as my target phone. You may have a different model but technically the build steps should be the same for all android phone models.
Requirements: A linux based or a Mac computer.
Windows computers do not directly support the tools required for this type of development. As such they are not being covered in this article.
The recommended operating system is Ubuntu.
A basic understanding of Linux based OS specifically Ubuntu.
Ability to type and use the command line. Write or copy paste commands in the Ubuntu konsole.
A basic understanding of programming concepts, read and update XML files, understand error messages.
Fast internet access.
Steady electricity supply.
Lots and lots of patience.
You will understand why the last three requirement are mentioned as you read on
Hardware recommendations – ideally your system should exceed these conditions
64 bit environment
100 GB of free hard disk space
16 GB RAM / swap space.
My hardware configuration:
Intel i5 processor
16 GB RAM
1 TB hard disk.
Please note even with this configuration it takes me about 3 hours to build the code! Operating system:
I used the Ubuntu 18.04 build which is the latest at the time of writing. I will be covering only the Ubuntu OS as part of this article as I do not have a Mac and as such it is out of scope for me!
Now change directory and move into the newly created lineage folder.
You can do this either by Opening nautilus and right clicking inside the lineage folder and selected ‘Open Terminal here’ or by typing the below command
Important: Ensure you are in the lineage folder before executing the next set of commands
Step 8: Configure your Git user
You can set these on the GitHub website. Once you have set your GitHub web site
Type \ paste these commands. Replace the text within “ ” with your credentials.
A successful initialization will end with a message stating that Repo is initialized in your working directory. Your client directory should now contain a .repo directory where files such as the manifest will be kept.
Step 8: Download the source code
This is the step where you will realize the importance of having a fast internet connection. The source code size is about 30 – 35 GB. I have a 10 mbps line and at times the download speed shoots up to 20- 25 mbps!!! Yet it takes me anything from 4 – 10 hours to download the code!
My suggestion is check the time when your local ISP download speeds are at its best. For me it is during the night. I set the download up at night and go to sleep!
The command to type \ paste to get the source code is :
Optional Step 8 a: Take a backup of your source code
I copy the entire folder and keep a copy on an external device. This is just in case there is any need for me to format my hard disk. I do not copy the .Repo and .Cache folders on to my backup. To check hidden folders press Ctrl + H.
Step 9: Get the source code for your specific device.
This is an important part to understand. The code which you downloaded is generic in nature. For your particular device you would need to get files which are specific to your device.
The source for all these files is github. You are targeting three sets of folders – Device, Kernel and vendor. The git clone commands given below are for the tissot or Xiaomi Mia1 phone. Similarly other phones have their locations on GitHub from where you can get files specific to them.
JACK is the java compiler and can cause crashes – believe me! A simple fix is this command which you type next export _JACK_VM_ARGS=”-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4G”
Step 12: Cleaning up the build folder
Step 13: Initializing the build
Step 14: Starting the build
croot brunch tissot
Now sit back and wait for a few hours. Check the screen, occasionally for what is happening. There will a ton or warnings showing up.Do not worry about the warnings. Read the message displayed on the screen for clues as to what is happening.
The entire build took about 3 hours on my machine with nothing else running. This duration can increase and decrease based on the configuration of your build machine. It can also depend on the files downloaded during the Repo sync process.
Finally you will get the .iso file in a folder labeled out. Check the screen shot above. It shows the build settings screen. Have been using it as on my main driver and so far so good.
Handling Error messages:
There is a very good chance that the build will stop many times. When this happens read the error message and then try googling it. I can guarantee that there would be number of other people across the world who have faced similar issues while building their custom ROM’s. See what solutions have been suggested and try them out. It took me almost a week to get my first build right!
Then in the same day I got 2 builds in a row that were successful! It has a lot with having all the right files in the build environment + a good hardware configuration + lots of luck!
At times the error message which stopped the build could report that a particular file is not found in a particular folder. Do a search in the base lineage folder and see if the file is there in any other folder. Simply copy it to the folder where the build is expecting it. After that run the build commands again and restart the build.
Remember to use your default login. I used su – superuser and ran into trouble while doing a repo with the normal login. So I do not use su for the build and do the entire build and repo sync with my login. Since i installed the system Ubuntu is satisfied with my credentials.
As I mentioned at the start this is my first shot at building a custom ROM. While there is not exactly much customization being done here as the source code is available on Lineage.com and the files specific to the device were shared by various developers on GitHub. All that I have done is that I downloaded the code and recompiled it on my machine. Having said that there is a sense of pride that you feel when you see your name in the settings tab!!!!
Hope this was a easy to understand guide to help noobs around the world do their own custom ROM development. This article is as I mentioned a guide, you should refer the links given below and get a complete understanding of the process of building ROM’s before you start on your own. So good luck with your custom ROM building!!!
Some important links which you should visit to understand how the experts do it.
To download the build click the links below: Please note that you are downloading and installing the build at your own risk. I will not be responsible for your phone bricking up and also will not be able to support you in case of any issues.
On a personal note I have been using the same build on my daily driver for the last couple of days with no issues. I have GApps installed and am able to use some 46 apps with no issues including Twitter, Whatsapp, Quora, XDA, WordPress among others. The phone camera and fingerprint features are working normally.
GApps Aroma 64bit ( please note all arm64 bit variant work,but i prefer Aroma as it gives me the option to select what I want to install. You can download the latest Gapps from here open_gapps-arm64-8.1-aroma-20180511.zip